metrics

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2022 License: MPL-2.0 Imports: 12 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() internal.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 internal.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 WithMetricBatchingEnabled added in v0.2.0

func WithMetricBatchingEnabled(batchingInterval time.Duration) Option

WithMetricBatchingEnabled is used for enabling batching for metrics. Pass time interval for batch as an input parameter.

Jump to

Keyboard shortcuts

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