Documentation ¶
Index ¶
Constants ¶
View Source
const ( ConversionAsGauge = "AsGauge" ConversionAsHistogram = "AsHistogram" )
View Source
const (
BackendName = `otlp`
)
Variables ¶
This section is empty.
Functions ¶
func NewClientFromViper ¶
func NewClientFromViper(v *viper.Viper, logger logrus.FieldLogger, pool *transport.TransportPool) (gostatsd.Backend, error)
Types ¶
type Backend ¶
type Backend struct { CompressPayload bool // contains filtered or unexported fields }
Backend contains additional meta data in order to export values as OTLP metrics. The zero value is not safe to use.
func (*Backend) SendMetricsAsync ¶
type Config ¶
type Config struct { gostatsd.TimerSubtypes `mapstructure:"disabled_timer_aggregations"` // MetricsEndpoint (Required) is the FQDN with path for the metrics ingestion endpoint MetricsEndpoint string `mapstructure:"metrics_endpoint"` // LogsEndpoint (Required) is the FQDN with path for the logs ingestion endpoint LogsEndpoint string `mapstructure:"logs_endpoint"` // MaxRequests (Optional, default: cpu.count * 2) is the upper limit on the number of inflight requests MaxRequests int `mapstructure:"max_requests"` // MaxRetries (Optional, default: 3) is the maximum number of retries to send a batch MaxRetries int `mapstructure:"max_retries"` // CompressPayload (Optional, default: true) is used to enable payload compression CompressPayload bool `mapstructure:"compress_payload"` // MetricsPerBatch (Optional, default: 1000) is the maximum number of metrics to send in a single batch. MetricsPerBatch int `mapstructure:"metrics_per_batch"` // ResourceKeys (Optional) is used to extract values from provided tags // to apply to all values within a resource instead within each attribute. // Strongly encouraged to allow down stream consumers to // process based on values defined at the top level resource. ResourceKeys []string `mapstructure:"resource_keys"` // Conversion (Optional, Default: AsGauge) controls if timers and histograms are captured as histograms or gauges. // The options will enable the following: // - AsGauge : This will emit timers withe their calculated suffixes // and histograms as gauges with the suffix `histogram` // - AsHistogram : This will emit timers as histograms with no buckets defined, // and histograms sets the bucket values. Conversion string `mapstructure:"conversion"` // Transport (Optional, Default: "default") is used to reference to configured transport // to be used for this backend Transport string `mapstructure:"transport"` // UserAgent (Optional, default: "gostatsd") allows you to set the // user agent header when making requests. UserAgent string `mapstructure:"user_agent"` // EventTitleAttributeKey (Optional, default: "title") // OTLP backend sends event in log format, this is the key used to store the title from the event in the log attributes EventTitleAttributeKey string `mapstructure:"event_title_attribute_key"` // EventPropertiesAttributeKey (Optional, default: "properties") // OTLP backend sends event in log format, this is the key used to store the properties from the event in the log attributes EventPropertiesAttributeKey string `mapstructure:"event_properties_attribute_key"` }
Click to show internal directories.
Click to hide internal directories.