dimensions

package
v0.108.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 27, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const RequestFailedCallbackKey key = 1
View Source
const RequestSuccessCallbackKey key = 2

Variables

This section is empty.

Functions

This section is empty.

Types

type DimensionClient

type DimensionClient struct {
	sync.RWMutex

	Token  configopaque.String
	APIURL *url.URL

	// ExcludeProperties will filter DimensionUpdate content to not submit undesired metadata.
	ExcludeProperties []dpfilters.PropertyFilter
	// contains filtered or unexported fields
}

DimensionClient sends updates to dimensions to the SignalFx API This is a port of https://github.com/signalfx/signalfx-agent/blob/main/pkg/core/writer/dimensions/client.go with the only major difference being deduplication of dimension updates are currently not done by this port.

func NewDimensionClient

func NewDimensionClient(ctx context.Context, options DimensionClientOptions) *DimensionClient

NewDimensionClient returns a new client

func (*DimensionClient) PushMetadata

func (dc *DimensionClient) PushMetadata(metadata []*metadata.MetadataUpdate) error

func (*DimensionClient) Start

func (dc *DimensionClient) Start()

Start the client's processing queue

type DimensionClientOptions

type DimensionClientOptions struct {
	Token        configopaque.String
	APIURL       *url.URL
	APITLSConfig *tls.Config
	LogUpdates   bool
	Logger       *zap.Logger
	SendDelay    time.Duration
	// In case of having issues sending dimension updates to SignalFx,
	// buffer a fixed number of updates.
	MaxBuffered         int
	MetricsConverter    translation.MetricsConverter
	ExcludeProperties   []dpfilters.PropertyFilter
	MaxConnsPerHost     int
	MaxIdleConns        int
	MaxIdleConnsPerHost int
	IdleConnTimeout     time.Duration
	Timeout             time.Duration
}

type DimensionKey

type DimensionKey struct {
	Name  string
	Value string
}

DimensionKey is what uniquely identifies a dimension, its name and value together.

func (DimensionKey) String

func (dk DimensionKey) String() string

type DimensionUpdate

type DimensionUpdate struct {
	Name       string
	Value      string
	Properties map[string]*string
	Tags       map[string]bool
}

func (*DimensionUpdate) Key

func (d *DimensionUpdate) Key() DimensionKey

func (*DimensionUpdate) String

func (d *DimensionUpdate) String() string

type MetadataUpdateClient

type MetadataUpdateClient interface {
	PushMetadata([]*metadata.MetadataUpdate) error
}

MetadataUpdateClient is an interface for pushing metadata updates

type ReqSender

type ReqSender struct {
	// contains filtered or unexported fields
}

ReqSender is a direct port of https://github.com/signalfx/signalfx-agent/blob/main/pkg/core/writer/requests/sender.go.

func NewReqSender

func NewReqSender(ctx context.Context, client *http.Client,
	workerCount uint, diagnosticDimensions map[string]string) *ReqSender

func (*ReqSender) Send

func (rs *ReqSender) Send(req *http.Request)

Send sends the request. Not thread-safe.

type RequestFailedCallback

type RequestFailedCallback func(statusCode int, err error)

type RequestSuccessCallback

type RequestSuccessCallback func([]byte)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL