metrics

package
v0.49.0 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultMetrics

func DefaultMetrics(exporterType string, hostname string, timestamp uint64, buildInfo component.BuildInfo) []datadog.Metric

DefaultMetrics creates built-in metrics to report that an exporter is running

func NewCount

func NewCount(name string, ts uint64, value float64, tags []string) datadog.Metric

NewCount creates a new Datadog count metric given a name, a Unix nanoseconds timestamp a value and a slice of tags

func NewGauge

func NewGauge(name string, ts uint64, value float64, tags []string) datadog.Metric

NewGauge creates a new Datadog Gauge metric given a name, a Unix nanoseconds timestamp a value and a slice of tags

func NewMetric added in v0.32.0

func NewMetric(name string, dt MetricDataType, ts uint64, value float64, tags []string) datadog.Metric

NewMetric creates a new Datadog metric given a name, a type, a Unix nanoseconds timestamp a value and a slice of tags

func ProcessMetrics

func ProcessMetrics(ms []datadog.Metric)

ProcessMetrics adds the hostname to the metric and prefixes it with the "otel" namespace as the Datadog backend expects

Types

type Consumer added in v0.38.0

type Consumer struct {
	// contains filtered or unexported fields
}

Consumer is the metrics Consumer.

func NewConsumer added in v0.38.0

func NewConsumer() *Consumer

NewConsumer creates a new zorkian consumer.

func (*Consumer) All added in v0.38.0

func (c *Consumer) All(timestamp uint64, buildInfo component.BuildInfo) ([]datadog.Metric, sketches.SketchSeriesList)

All gets all metrics (consumed metrics and running metrics).

func (*Consumer) ConsumeHost added in v0.38.0

func (c *Consumer) ConsumeHost(host string)

ConsumeHost implements the translator.HostConsumer interface.

func (*Consumer) ConsumeSketch added in v0.38.0

func (c *Consumer) ConsumeSketch(
	_ context.Context,
	dims *translator.Dimensions,
	timestamp uint64,
	sketch *quantile.Sketch,
)

ConsumeSketch implements the translator.Consumer interface.

func (*Consumer) ConsumeTag added in v0.42.0

func (c *Consumer) ConsumeTag(tag string)

ConsumeTag implements the translator.TagsConsumer interface.

func (*Consumer) ConsumeTimeSeries added in v0.38.0

func (c *Consumer) ConsumeTimeSeries(
	_ context.Context,
	dims *translator.Dimensions,
	typ translator.MetricDataType,
	timestamp uint64,
	value float64,
)

ConsumeTimeSeries implements the translator.Consumer interface.

type MetricDataType added in v0.32.0

type MetricDataType string
const (
	// Gauge is the Datadog Gauge metric type
	Gauge MetricDataType = "gauge"
	// Count is the Datadog Count metric type
	Count MetricDataType = "count"
)

Jump to

Keyboard shortcuts

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