dimensions

package
v0.36.0 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2021 License: Apache-2.0 Imports: 18 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  string
	APIURL *url.URL

	// TODO: Look into collecting these metrics and other traces via obsreport
	DimensionsCurrentlyDelayed int64
	TotalDimensionsDropped     int64
	// The number of dimension updates that happened to the same dimension
	// within sendDelay.
	TotalFlappyUpdates           int64
	TotalClientError4xxResponses int64
	TotalRetriedUpdates          int64
	TotalInvalidDimensions       int64
	TotalSuccessfulUpdates       int64
	// 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                 string
	APIURL                *url.URL
	LogUpdates            bool
	Logger                *zap.Logger
	SendDelay             int
	PropertiesMaxBuffered int
	MetricsConverter      translation.MetricsConverter
}

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 {
	RunningWorkers         int64
	TotalRequestsStarted   int64
	TotalRequestsCompleted int64
	TotalRequestsFailed    int64
	// 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