Documentation
¶
Index ¶
- type LMMetricIngest
- func (lmi LMMetricIngest) BatchInterval() time.Duration
- func (lmi *LMMetricIngest) CreateRequestBody() model.DataPayload
- func (lmi *LMMetricIngest) ExportData(payloadList model.DataPayload, uri, method string) error
- func (lmi *LMMetricIngest) SendMetrics(ctx context.Context, rInput model.ResourceInput, dsInput model.DatasourceInput, ...) error
- func (lmi LMMetricIngest) URI() string
- func (lmi *LMMetricIngest) UpdateInstanceProperties(resIDs, insProps map[string]string, dsName, dsDisplayName, insName string, ...) error
- func (lmi *LMMetricIngest) UpdateResourceProperties(resName string, resIDs, resProps map[string]string, patch bool) error
- type Option
- func WithAuthentication(authParams utils.AuthParams) Option
- func WithEndpoint(endpoint string) Option
- func WithGzipCompression(gzip bool) Option
- func WithHTTPClient(client *http.Client) Option
- func WithMetricBatchingDisabled() Option
- func WithMetricBatchingInterval(batchingInterval time.Duration) Option
- func WithRateLimit(requestCount int) Option
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 (*LMMetricIngest) UpdateResourceProperties ¶
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
WithEndpoint is used to set Endpoint URL to export logs
func WithGzipCompression ¶ added in v0.4.0
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
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
WithMetricBatchingInterval is used for passing batch time interval.
func WithRateLimit ¶ added in v0.6.0
WithRateLimit is used to limit the metric request count per minute