package
0.9.0
Repository: https://github.com/datadog/datadog-agent.git
Documentation: pkg.go.dev

# README

Metrics

The agent offers different type of metric. Each metrics offers 2 methods addSample and flush.

  • addSample: add a new sample to the metrics.
  • flush: aggregate all samples received since the last flush and return a Series to be forwarded to the Datadog backend.

gauge

Gauge tracks the value of a metric. The last value received is the one returned by the flush method.

counter

Counter tracks how many times something happened per second. Counters are only used by DogStatsD and are very similar to Count: the main diffence is that they are sent as Rate.

count

Count is used to count the number of events that occur between 2 flushes. Each sample's value is added to the value that's flushed.

histogram

Histogram tracks the distribution of samples added over one flush period.

historate

Historate tracks the distribution of samples added over one flush period for "rate" like metrics. Warning this doesn't use the harmonic mean, beware of what it means when using it.

monotonic_count

MonotonicCount tracks a raw counter, based on increasing counter values. Samples that have a lower value than the previous sample are ignored (since it usually means that the underlying raw counter has been reset).

Example:

Submitting samples 2, 3, 6, 7 returns 5 (i.e. 7-2) on flush, then submitting samples 10, 11 on the same MonotonicCount returns 4 (i.e. 11-7) on the second flush.

percentile

Percentile tracks the distribution of samples added over one flush period. Designed to be globally accurate for percentiles.

Percentile is not usable yet; it is still undergoing development and testing.

rate

Rate tracks the rate of a metric over 2 successive flushes (ie: no metrics will be returned on the first flush).

set

Set tracks the number of unique elements in a set. This is only used by DogStatsD; you cannot create sets from an Agent check.

service_check

Service checks track the status of any service: OK, WARNING, CRITICAL, or UNKNOWN. The Agent does not aggregate service checks, it sends every check straight to Datadog's backend.

event

Events represent discrete moments in time, e.g. thrown exceptions, code deploys, etc. The Agent does not aggregate events, it sends every event straight to your Datadog event stream.

# Functions

GetAlertTypeFromString returns the EventAlertType from its string representation.
GetEventPriorityFromString returns the EventPriority from its string representation.
GetServiceCheckStatus returns the ServiceCheckStatus from and integer value.
MakeContextMetrics returns a new ContextMetrics.
NewCheckMetrics returns new CheckMetrics instance.
NewCounter return a new initialized Counter.
NewHistogram returns a newly initialized histogram.
NewHistorate returns a newly-initialized historate.
NewMetricSamplePool creates a new MetricSamplePool.
NewSet return a new initialized Set.

# Constants

Enumeration of the existing API metric types.
Enumeration of the existing API metric types.
Enumeration of the existing API metric types.
metric type constants enumeration.
metric type constants enumeration.
metric type constants enumeration.
Enumeration of the existing event alert types, and their values.
Enumeration of the existing event alert types, and their values.
Enumeration of the existing event alert types, and their values.
Enumeration of the existing event alert types, and their values.
Enumeration of the existing event priorities, and their values.
Enumeration of the existing event priorities, and their values.
metric type constants enumeration.
metric type constants enumeration.
metric type constants enumeration.
metric type constants enumeration.
metric type constants enumeration.
Enumeration of the existing service check statuses, and their values.
Enumeration of the existing service check statuses, and their values.
Enumeration of the existing service check statuses, and their values.
Enumeration of the existing service check statuses, and their values.
metric type constants enumeration.

# Variables

DistributionMetricTypes contains the MetricTypes that are used for percentiles.

# Structs

AddSampleTelemetry counts number of new metrics added.
CheckMetrics stores metrics for the check sampler.
CheckMetricsTelemetryAccumulator aggregates telemetry collected from multiple CheckMetrics instances.
Count is used to count the number of events that occur between 2 flushes.
Counter tracks how many times something happened per second.
Event holds an event (w/ serialization to DD agent 5 intake format).
Gauge tracks the value of a metric.
Histogram tracks the distribution of samples added over one flush period.
HistogramBucket represents a prometheus/openmetrics histogram bucket.
Historate tracks the distribution of samples added over one flush period for "rate" like metrics.
MetricSample represents a raw metric sample.
MetricSamplePool is a pool of metrics sample.
MonotonicCount tracks a raw counter, based on increasing counter values.
NoSerieError is the error returned by a metric when not enough samples have been submitted to generate a serie.
Point represents a metric value at a specific time.
Rate tracks the rate of a metric over 2 successive flushes.
Serie holds a timeseries (w/ json serialization to DD API format).
ServiceCheck holds a service check (w/ serialization to DD api format).
Set tracks the number of unique elements in a set.
A SketchPoint represents a quantile sketch at a specific time.
A SketchSeries is a timeseries of quantile sketches.

# Interfaces

Metric is the interface of all metric types.
MetricSampleContext allows to access a sample context data.

# Type aliases

APIMetricType represents an API metric type.
ContextMetrics stores all the metrics by context key.
EventAlertType represents the alert type of an event.
EventPriority represents the priority of an event.
Events represents a list of events ready to be serialize.
MetricType is the representation of an aggregator metric type.
Series represents a list of Serie ready to be serialize.
ServiceChecks represents a list of service checks ready to be serialize.
ServiceCheckStatus represents the status associated with a service check.
A SketchSeriesList implements marshaler.Marshaler.