Documentation ¶
Overview ¶
Package metrics contains helper functions for Datadog metric export
Index ¶
- func DefaultMetrics(exporterType string, hostname string, timestamp uint64, ...) []datadogV2.MetricSeries
- func DefaultZorkianMetrics(exporterType string, hostname string, timestamp uint64, ...) []zorkian.Metric
- func NewCount(name string, ts uint64, value float64, tags []string) datadogV2.MetricSeries
- func NewGauge(name string, ts uint64, value float64, tags []string) datadogV2.MetricSeries
- func NewMetric(name string, dt datadogV2.MetricIntakeType, ts uint64, value float64, ...) datadogV2.MetricSeries
- func NewZorkianCount(name string, ts uint64, value float64, tags []string) zorkian.Metric
- func NewZorkianGauge(name string, ts uint64, value float64, tags []string) zorkian.Metric
- func NewZorkianMetric(name string, dt MetricType, ts uint64, value float64, tags []string) zorkian.Metric
- func PrepareContainerMetrics(ms []datadogV2.MetricSeries) []datadogV2.MetricSeries
- func PrepareSystemMetrics(ms []datadogV2.MetricSeries) []datadogV2.MetricSeries
- func PrepareZorkianContainerMetrics(ms []zorkian.Metric) []zorkian.Metric
- func PrepareZorkianSystemMetrics(ms []zorkian.Metric) []zorkian.Metric
- type Consumer
- func (c *Consumer) All(timestamp uint64, buildInfo component.BuildInfo, tags []string) ([]datadogV2.MetricSeries, sketches.SketchSeriesList, []pb.ClientStatsPayload)
- func (c *Consumer) ConsumeAPMStats(s pb.ClientStatsPayload)
- func (c *Consumer) ConsumeHost(host string)
- func (c *Consumer) ConsumeSketch(_ context.Context, dims *metrics.Dimensions, timestamp uint64, ...)
- func (c *Consumer) ConsumeTag(tag string)
- func (c *Consumer) ConsumeTimeSeries(_ context.Context, dims *metrics.Dimensions, typ metrics.DataType, ...)
- type MetricType
- type ZorkianConsumer
- func (c *ZorkianConsumer) All(timestamp uint64, buildInfo component.BuildInfo, tags []string) ([]zorkian.Metric, sketches.SketchSeriesList, []pb.ClientStatsPayload)
- func (c *ZorkianConsumer) ConsumeAPMStats(s pb.ClientStatsPayload)
- func (c *ZorkianConsumer) ConsumeHost(host string)
- func (c *ZorkianConsumer) ConsumeSketch(_ context.Context, dims *metrics.Dimensions, timestamp uint64, ...)
- func (c *ZorkianConsumer) ConsumeTag(tag string)
- func (c *ZorkianConsumer) ConsumeTimeSeries(_ context.Context, dims *metrics.Dimensions, typ metrics.DataType, ...)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultMetrics ¶
func DefaultMetrics(exporterType string, hostname string, timestamp uint64, buildInfo component.BuildInfo) []datadogV2.MetricSeries
DefaultMetrics creates built-in metrics to report that an exporter is running
func DefaultZorkianMetrics ¶ added in v0.67.0
func DefaultZorkianMetrics(exporterType string, hostname string, timestamp uint64, buildInfo component.BuildInfo) []zorkian.Metric
DefaultZorkianMetrics creates built-in metrics to report that an exporter is running
func NewCount ¶
NewCount creates a new DatadogV2 count metric given a name, a Unix nanoseconds timestamp a value and a slice of tags
func NewGauge ¶
NewGauge creates a new DatadogV2 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 datadogV2.MetricIntakeType, ts uint64, value float64, tags []string) datadogV2.MetricSeries
NewMetric creates a new DatadogV2 metric given a name, a type, a Unix nanoseconds timestamp a value and a slice of tags
func NewZorkianCount ¶ added in v0.67.0
NewZorkianCount creates a new Datadog count metric given a name, a Unix nanoseconds timestamp a value and a slice of tags
func NewZorkianGauge ¶ added in v0.67.0
NewZorkianGauge creates a new Datadog Gauge metric given a name, a Unix nanoseconds timestamp a value and a slice of tags
func NewZorkianMetric ¶ added in v0.67.0
func NewZorkianMetric(name string, dt MetricType, ts uint64, value float64, tags []string) zorkian.Metric
NewZorkianMetric creates a new Zorkian Datadog metric given a name, a type, a Unix nanoseconds timestamp a value and a slice of tags
func PrepareContainerMetrics ¶ added in v0.78.0
func PrepareContainerMetrics(ms []datadogV2.MetricSeries) []datadogV2.MetricSeries
PrepareContainerMetrics converts OTEL container.* metrics to Datadog container metrics.
func PrepareSystemMetrics ¶ added in v0.62.0
func PrepareSystemMetrics(ms []datadogV2.MetricSeries) []datadogV2.MetricSeries
PrepareSystemMetrics prepends system hosts metrics with the otel.* prefix to identify them as part of the Datadog OpenTelemetry Integration. It also extracts Datadog compatible system metrics and returns the full set of metrics to be used.
func PrepareZorkianContainerMetrics ¶ added in v0.78.0
PrepareZorkianContainerMetrics converts OTEL container.* metrics to Datadog container metrics.
func PrepareZorkianSystemMetrics ¶ added in v0.67.0
PrepareZorkianSystemMetrics prepends system hosts metrics with the otel.* prefix to identify them as part of the Datadog OpenTelemetry Integration. It also extracts Datadog compatible system metrics and returns the full set of metrics to be used.
Types ¶
type Consumer ¶ added in v0.38.0
type Consumer struct {
// contains filtered or unexported fields
}
Consumer implements metrics.Consumer. It records consumed metrics, sketches and APM stats payloads. It provides them to the caller using the All method.
func NewConsumer ¶ added in v0.38.0
func NewConsumer() *Consumer
NewConsumer creates a new Datadog consumer. It implements metrics.Consumer.
func (*Consumer) All ¶ added in v0.38.0
func (c *Consumer) All(timestamp uint64, buildInfo component.BuildInfo, tags []string) ([]datadogV2.MetricSeries, sketches.SketchSeriesList, []pb.ClientStatsPayload)
All gets all metrics (consumed metrics and running metrics).
func (*Consumer) ConsumeAPMStats ¶ added in v0.68.0
func (c *Consumer) ConsumeAPMStats(s pb.ClientStatsPayload)
ConsumeAPMStats implements metrics.APMStatsConsumer.
func (*Consumer) ConsumeHost ¶ added in v0.38.0
ConsumeHost implements the metrics.HostConsumer interface.
func (*Consumer) ConsumeSketch ¶ added in v0.38.0
func (c *Consumer) ConsumeSketch( _ context.Context, dims *metrics.Dimensions, timestamp uint64, sketch *quantile.Sketch, )
ConsumeSketch implements the metrics.Consumer interface.
func (*Consumer) ConsumeTag ¶ added in v0.42.0
ConsumeTag implements the metrics.TagsConsumer interface.
type MetricType ¶ added in v0.61.0
type MetricType string
const ( // Gauge is the Datadog Gauge metric type Gauge MetricType = "gauge" // Count is the Datadog Count metric type Count MetricType = "count" )
type ZorkianConsumer ¶ added in v0.67.0
type ZorkianConsumer struct {
// contains filtered or unexported fields
}
ZorkianConsumer implements metrics.Consumer. It records consumed metrics, sketches and APM stats payloads. It provides them to the caller using the All method.
func NewZorkianConsumer ¶ added in v0.67.0
func NewZorkianConsumer() *ZorkianConsumer
NewZorkianConsumer creates a new ZorkianConsumer. It implements metrics.Consumer.
func (*ZorkianConsumer) All ¶ added in v0.67.0
func (c *ZorkianConsumer) All(timestamp uint64, buildInfo component.BuildInfo, tags []string) ([]zorkian.Metric, sketches.SketchSeriesList, []pb.ClientStatsPayload)
All gets all metrics (consumed metrics and running metrics).
func (*ZorkianConsumer) ConsumeAPMStats ¶ added in v0.68.0
func (c *ZorkianConsumer) ConsumeAPMStats(s pb.ClientStatsPayload)
ConsumeAPMStats implements metrics.APMStatsConsumer.
func (*ZorkianConsumer) ConsumeHost ¶ added in v0.67.0
func (c *ZorkianConsumer) ConsumeHost(host string)
ConsumeHost implements the metrics.HostConsumer interface.
func (*ZorkianConsumer) ConsumeSketch ¶ added in v0.67.0
func (c *ZorkianConsumer) ConsumeSketch( _ context.Context, dims *metrics.Dimensions, timestamp uint64, sketch *quantile.Sketch, )
ConsumeSketch implements the metrics.Consumer interface.
func (*ZorkianConsumer) ConsumeTag ¶ added in v0.67.0
func (c *ZorkianConsumer) ConsumeTag(tag string)
ConsumeTag implements the metrics.TagsConsumer interface.
func (*ZorkianConsumer) ConsumeTimeSeries ¶ added in v0.67.0
func (c *ZorkianConsumer) ConsumeTimeSeries( _ context.Context, dims *metrics.Dimensions, typ metrics.DataType, timestamp uint64, value float64, )
ConsumeTimeSeries implements the metrics.Consumer interface.