Documentation ¶
Overview ¶
Package metrics contains helper functions for Datadog metric export
Index ¶
- func DefaultMetrics(exporterType string, hostname string, timestamp uint64, tags []string) []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 TagsFromBuildInfo(buildInfo component.BuildInfo) []string
- type Consumer
- func (c *Consumer) All(timestamp uint64, buildInfo component.BuildInfo, tags []string, ...) ([]datadogV2.MetricSeries, sketches.SketchSeriesList)
- 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)
- 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, tags []string) []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 TagsFromBuildInfo ¶ added in v0.80.0
TagsFromBuildInfo returns a list of tags derived from buildInfo to be used when creating metrics
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, metadata metrics.Metadata) ([]datadogV2.MetricSeries, sketches.SketchSeriesList)
All gets all metrics (consumed metrics and running metrics).
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)
All gets all metrics (consumed metrics and running metrics).
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.