METRIC

datadog_metrics sink

The datadog_metrics sink batches metric events to Datadog metrics service using HTTP API.

Configuration

  • Common
  • Advanced
vector.toml
[sinks.my_sink_id]
# REQUIRED
type = "datadog_metrics" # example, must be: "datadog_metrics"
inputs = ["my-source-id"] # example
api_key = "3111111111111111aaaaaaaaaaaaaaaa" # example
namespace = "service" # example
# OPTIONAL
host = "https://api.datadoghq.com" # default

Options

12 items
commonstringrequired

api_key

Datadog API key

No default
View examples
intbytesoptional

batch_size

The maximum size of a batch before it is flushed.

Default: 20
View examples
intsecondsoptional

batch_timeout

The maximum age of a batch before it is flushed.

Default: 1
View examples
booloptional

healthcheck

Enables/disables the sink healthcheck upon start. See Health Checks for more info.

Default: true
View examples
commonstringoptional

host

Datadog endpoint to send metrics to.

Default: "https://api.datadoghq.com"
View examples
commonstringrequired

namespace

A prefix that will be added to all metric names.

No default
View examples
intoptional

request_in_flight_limit

The maximum number of in-flight requests allowed at any given time. See Rate Limits for more info.

Default: 5
View examples
intsecondsoptional

request_rate_limit_duration_secs

The window used for therequest_rate_limit_num option See Rate Limits for more info.

Default: 1
View examples
intoptional

request_rate_limit_num

The maximum number of requests allowed within therequest_rate_limit_duration_secs window. See Rate Limits for more info.

Default: 5
View examples
intoptional

request_retry_attempts

The maximum number of retries to make for failed requests. See Retry Policy for more info.

Default: 5
View examples
intsecondsoptional

request_retry_backoff_secs

The amount of time to wait before attempting a failed request again. See Retry Policy for more info.

Default: 1
View examples
intsecondsoptional

request_timeout_secs

The maximum time a request can take before being aborted. It is highly recommended that you do not lower value below the service's internal timeout, as this could create orphaned requests, pile on retries, and result in deuplicate data downstream.

Default: 60
View examples

Output

The datadog_metrics sink batches metric events to Datadog metrics service using HTTP API. Batches are flushed via the batch_size or batch_timeout options. You can learn more in the buffers & batches section.

How It Works

Environment Variables

Environment variables are supported through all of Vector's configuration. Simply add ${MY_ENV_VAR} in your Vector configuration file and the variable will be replaced before being evaluated.

You can learn more in the Environment Variables section.

Health Checks

Health checks ensure that the downstream service is accessible and ready to accept data. This check is performed upon sink initialization. If the health check fails an error will be logged and Vector will proceed to start.

Require Health Checks

If you'd like to exit immediately upon a health check failure, you can pass the --require-healthy flag:

vector --config /etc/vector/vector.toml --require-healthy

Disable Health Checks

If you'd like to disable health checks for this sink you can set thehealthcheck option to false.

Metric Types

Datadog accepts the following types for submission via API:

  • Count
  • Gauge
  • Rate

The following matrix outlines how Vector metric types are mapped into Datadog metrics types.

Vector MetricsDatadog Metrics
CounterCount
GaugeGauge
Gauge DeltaN/A
HistogramCount [1]
SetN/A
  1. Aggregation of Histogram values is not supported at the moment. Histogram values will be sent as is, as raw Count values.

Rate Limits

Vector offers a few levers to control the rate and volume of requests to the downstream service. Start with therequest_rate_limit_duration_secs andrequest_rate_limit_num options to ensure Vector does not exceed the specified number of requests in the specified window. You can further control the pace at which this window is saturated with therequest_in_flight_limit option, which will guarantee no more than the specified number of requests are in-flight at any given time.

Please note, Vector's defaults are carefully chosen and it should be rare that you need to adjust these. If you found a good reason to do so please share it with the Vector team by opening an issie.

Retry Policy

Vector will retry failed requests (status == 429, >= 500, and != 501). Other responses will not be retried. You can control the number of retry attempts and backoff rate with therequest_retry_attempts andrequest_retry_backoff_secs options.