otlp

package
v0.0.0-...-65a99ba Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConversionAsGauge     = "AsGauge"
	ConversionAsHistogram = "AsHistogram"
)

Variables

This section is empty.

Functions

func NewClientFromViper

func NewClientFromViper(v *viper.Viper, logger logrus.FieldLogger, pool *transport.TransportPool) (gostatsd.Backend, error)

Types

type Client

type Client struct{}

Client contains additional meta data in order to export values as OTLP metrics. The zero value is not safe to use.

func (Client) Name

func (Client) Name() string

func (Client) SendEvent

func (Client) SendEvent(ctx context.Context, e *gostatsd.Event) error

func (Client) SendMetricsAsync

func (Client) SendMetricsAsync(ctx context.Context, mm *gostatsd.MetricMap, cb gostatsd.SendCallback)

type Config

type Config struct {
	// Endpoint (Required) is the FQDN with path for the metrics ingestion endpoint
	Endpoint string `mapstructure:"endpoint"`
	// MaxRequests (Optional, default: cpu.count * 2) is the upper limit on the number of inflight requests
	MaxRequests int `mapstructure:"max_requests"`
	// 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"`
	// TimerConversion (Optional, Default: AsGauge) determines if a timers are emitted as one of the following:
	// - AsGauges emits each calcauted value (min, max, sum, count, upper, upper_99, etc...) as a guage value
	// - AsHistograms each timer is set as an empty bucket histogram with only Min, Max, Sum, and Count set
	TimerConversion string `mapstructure:"timer_conversion"`
	// HistogramConversion (Optional, Default: AsGauge) determines how a GoStatsD histogram should be converted into OTLP.
	// The allowed values for this are:
	// - AsGauges: sends each bucket count (including +inf) as a guage value and the bucket boundry as a tag
	// - AsHistogram: sends each histogram as a single Histogram value with bucket and statistics calculated.
	HistogramConversion string `mapstructure:"histogram_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"`
}

func NewConfig

func NewConfig(v *viper.Viper) (*Config, error)

func (Config) Validate

func (c Config) Validate() (errs error)

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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