metrics

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2022 License: MPL-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LMMetricIngest

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

func NewLMMetricIngest

func NewLMMetricIngest(ctx context.Context, opts ...Option) (*LMMetricIngest, error)

NewLMMetricIngest initializes LMMetricIngest

func (LMMetricIngest) BatchInterval

func (lmi LMMetricIngest) BatchInterval() time.Duration

BatchInterval returns the time interval for batching

func (*LMMetricIngest) CreateRequestBody

func (lmi *LMMetricIngest) CreateRequestBody() model.DataPayload

CreateRequestBody merges the requests present in batching cache and creates metric payload at the end of every batching interval

func (*LMMetricIngest) ExportData

func (lmi *LMMetricIngest) ExportData(payloadList model.DataPayload, uri, method string) error

ExportData exports metrics to the LM platform

func (*LMMetricIngest) SendMetrics

func (lmi *LMMetricIngest) SendMetrics(ctx context.Context, rInput model.ResourceInput, dsInput model.DatasourceInput, instInput model.InstanceInput, dpInput model.DataPointInput) error

SendMetrics is the entry point for receiving metric data. It also validates the attributes of metrics before creating metric payload.

func (LMMetricIngest) URI

func (lmi LMMetricIngest) URI() string

URI returns the endpoint/uri of metric ingest API

func (*LMMetricIngest) UpdateInstanceProperties

func (lmi *LMMetricIngest) UpdateInstanceProperties(resIDs, insProps map[string]string, dsName, dsDisplayName, insName string, patch bool) error

func (*LMMetricIngest) UpdateResourceProperties

func (lmi *LMMetricIngest) UpdateResourceProperties(resName string, resIDs, resProps map[string]string, patch bool) error

type Option added in v0.2.0

type Option func(*LMMetricIngest) error

func WithAuthentication added in v0.3.0

func WithAuthentication(authProvider model.AuthProvider) Option

WithAuthentication is used for passing authentication token if not set in environment variables.

func WithGzipCompression added in v0.4.0

func WithGzipCompression(gzip bool) Option

WithGzipCompression can be used to enable/disable gzip compression of metric payload Note: By default, gzip compression is enabled.

func WithMetricBatchingDisabled added in v0.5.0

func WithMetricBatchingDisabled() Option

WithMetricBatchingDisabled is used for disabling metric batching.

func WithMetricBatchingInterval added in v0.5.0

func WithMetricBatchingInterval(batchingInterval time.Duration) Option

WithMetricBatchingEnabled is used for passing batch time interval.

func WithRateLimit added in v0.6.0

func WithRateLimit(requestCount int) Option

WithRateLimit is used to limit the metric request count per minute

Jump to

Keyboard shortcuts

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