metrics

package
v0.99.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package metrics contains helper functions for Datadog metric export

Index

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

func NewCount(name string, ts uint64, value float64, tags []string) datadogV2.MetricSeries

NewCount creates a new DatadogV2 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) datadogV2.MetricSeries

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

func NewZorkianCount(name string, ts uint64, value float64, tags []string) zorkian.Metric

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

func NewZorkianGauge(name string, ts uint64, value float64, tags []string) zorkian.Metric

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

func TagsFromBuildInfo(buildInfo component.BuildInfo) []string

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

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

func (c *Consumer) ConsumeHost(host string)

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

func (c *Consumer) ConsumeTag(tag string)

ConsumeTag implements the metrics.TagsConsumer interface.

func (*Consumer) ConsumeTimeSeries added in v0.38.0

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

ConsumeTimeSeries implements the metrics.Consumer 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

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.

Directories

Path Synopsis
Package sketches is a copy of part from github.com/DataDog/datadog-agent/pkg/metrics.
Package sketches is a copy of part from github.com/DataDog/datadog-agent/pkg/metrics.

Jump to

Keyboard shortcuts

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