Documentation ¶
Index ¶
- type Consumer
- type HistogramMode
- type HostConsumer
- type HostnameProvider
- type MetricDataType
- type NumberMode
- type Option
- func WithCountSumMetrics() Option
- func WithDeltaTTL(deltaTTL int64) Option
- func WithFallbackHostnameProvider(provider HostnameProvider) Option
- func WithHistogramMode(mode HistogramMode) Option
- func WithNumberMode(mode NumberMode) Option
- func WithQuantiles() Option
- func WithResourceAttributesAsTags() Option
- type SketchConsumer
- type TimeSeriesConsumer
- type Translator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Consumer ¶
type Consumer interface { TimeSeriesConsumer SketchConsumer }
Consumer is a metrics consumer.
type HistogramMode ¶
type HistogramMode string
HistogramMode is an export mode for OTLP Histogram metrics.
const ( // HistogramModeNoBuckets disables bucket export. HistogramModeNoBuckets HistogramMode = "nobuckets" // HistogramModeCounters exports buckets as Datadog counts. HistogramModeCounters HistogramMode = "counters" // HistogramModeDistributions exports buckets as Datadog distributions. HistogramModeDistributions HistogramMode = "distributions" )
type HostConsumer ¶
type HostConsumer interface { // ConsumeHost consumes a hostname. ConsumeHost(host string) }
HostConsumer is a hostname consumer. It is an optional interface that can be implemented by a Consumer.
type HostnameProvider ¶
type HostnameProvider interface { // Hostname gets the hostname from the machine. Hostname(ctx context.Context) (string, error) }
HostnameProvider gets a hostname
type MetricDataType ¶
type MetricDataType int
MetricDataType is a timeseries-style metric type.
const ( // Gauge is the Datadog Gauge metric type. Gauge MetricDataType = iota // Count is the Datadog Count metric type. Count )
type NumberMode ¶
type NumberMode string
NumberMode is an export mode for OTLP Number metrics.
const ( // NumberModeCumulativeToDelta calculates delta for // cumulative monotonic metrics in the client side and reports // them as Datadog counts. NumberModeCumulativeToDelta NumberMode = "cumulative_to_delta" // NumberModeRawValue reports the raw value for cumulative monotonic // metrics as a Datadog gauge. NumberModeRawValue NumberMode = "raw_value" )
type Option ¶
type Option func(*translatorConfig) error
Option is a translator creation option.
func WithCountSumMetrics ¶
func WithCountSumMetrics() Option
WithCountSumMetrics exports .count and .sum histogram metrics.
func WithDeltaTTL ¶
WithDeltaTTL sets the delta TTL for cumulative metrics datapoints. By default, 3600 seconds are used.
func WithFallbackHostnameProvider ¶
func WithFallbackHostnameProvider(provider HostnameProvider) Option
WithFallbackHostnameProvider sets the fallback hostname provider. By default, an empty hostname is used as a fallback.
func WithHistogramMode ¶
func WithHistogramMode(mode HistogramMode) Option
WithHistogramMode sets the histograms mode. The default mode is HistogramModeOff.
func WithNumberMode ¶
func WithNumberMode(mode NumberMode) Option
WithNumberMode sets the number mode. The default mode is NumberModeCumulativeToDelta.
func WithQuantiles ¶
func WithQuantiles() Option
WithQuantiles enables quantiles exporting for summary metrics.
func WithResourceAttributesAsTags ¶
func WithResourceAttributesAsTags() Option
WithResourceAttributesAsTags sets resource attributes as tags.
type SketchConsumer ¶
type SketchConsumer interface { // ConsumeSketch consumes a pkg/quantile-style sketch. ConsumeSketch( ctx context.Context, name string, timestamp uint64, sketch *quantile.Sketch, tags []string, host string, ) }
SketchConsumer is a pkg/quantile sketch consumer.
type TimeSeriesConsumer ¶
type TimeSeriesConsumer interface { // ConsumeTimeSeries consumes a timeseries-style metric. ConsumeTimeSeries( ctx context.Context, name string, typ MetricDataType, timestamp uint64, value float64, tags []string, host string, ) }
TimeSeriesConsumer is timeseries consumer.
type Translator ¶
type Translator struct {
// contains filtered or unexported fields
}
Translator is a metrics translator.
func New ¶
func New(logger *zap.Logger, options ...Option) (*Translator, error)
New creates a new translator with given options.
func (*Translator) MapMetrics ¶
MapMetrics maps OTLP metrics into the DataDog format