metrics

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2024 License: MPL-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMetricBatch added in v1.0.0

func NewMetricBatch() *metricBatch

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) SendMetrics

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

func (*LMMetricIngest) UpdateInstanceProperties

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

func (*LMMetricIngest) UpdateResourceProperties

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

type LMMetricIngestResponse added in v1.0.0

type LMMetricIngestResponse struct {
	Success    bool                     `json:"success"`
	Message    string                   `json:"message"`
	Code       int                      `json:"code"`
	ResourceID map[string]string        `json:"resourceId"`
	Errors     []map[string]interface{} `json:"errors"`
}

type Option added in v0.2.0

type Option func(*LMMetricIngest) error

func WithAuthentication added in v0.3.0

func WithAuthentication(authParams utils.AuthParams) Option

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

func WithEndpoint added in v0.6.2

func WithEndpoint(endpoint string) Option

WithEndpoint is used to set Endpoint URL to export logs

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 WithHTTPClient added in v0.6.2

func WithHTTPClient(client *http.Client) Option

WithHTTPClient is used to set HTTP client

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

WithMetricBatchingInterval 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

func WithUserAgent added in v1.3.0

func WithUserAgent(userAgent string) Option

WithUserAgent sets the provided user agent

type SendMetricResponse added in v1.2.0

type SendMetricResponse struct {
	StatusCode int    `json:"statusCode"`
	Success    bool   `json:"success"`
	Message    string `json:"message"`

	Error       error `json:"error"`
	MultiStatus []struct {
		Code  float64 `json:"code"`
		Error string  `json:"error"`
	} `json:"multiStatus"`
}

type SendMetricsOptionalParameters added in v1.0.0

type SendMetricsOptionalParameters struct {
}

func NewSendMetricsOptionalParameters added in v1.0.0

func NewSendMetricsOptionalParameters() *SendMetricsOptionalParameters

type UpdateInstancePropertiesResponse added in v1.2.0

type UpdateInstancePropertiesResponse struct {
	StatusCode int    `json:"statusCode"`
	Success    bool   `json:"success"`
	Message    string `json:"message"`

	Error       error `json:"error"`
	MultiStatus []struct {
		Code  float64 `json:"code"`
		Error string  `json:"error"`
	} `json:"multiStatus"`
}

type UpdateResourcePropertiesResponse added in v1.2.0

type UpdateResourcePropertiesResponse struct {
	StatusCode int    `json:"statusCode"`
	Success    bool   `json:"success"`
	Message    string `json:"message"`

	Error       error `json:"error"`
	MultiStatus []struct {
		Code  float64 `json:"code"`
		Error string  `json:"error"`
	} `json:"multiStatus"`
}

Jump to

Keyboard shortcuts

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