Community
otelcol.exporter.datadog
Community: This component is developed, maintained, and supported by the Alloy user community. Grafana doesn’t offer commercial support for this component. To enable and use community components, you must set the
--feature.community-components.enabled
flag totrue
.
otelcol.exporter.datadog
accepts metrics and traces telemetry data from other otelcol
components and sends it to Datadog.
Note
otelcol.exporter.datadog
is a wrapper over the upstream OpenTelemetry Collectordatadog
exporter from theotelcol-contrib
distribution. Bug reports or feature requests will be redirected to the upstream repository, if necessary.
You can specify multiple otelcol.exporter.datadog
components by giving them different labels.
Usage
otelcol.exporter.datadog "LABEL" {
api {
api_key = "YOUR_API_KEY_HERE"
}
}
Arguments
The following arguments are supported:
If hostname
is unset, the hostname is determined automatically. For more information, refer to the Datadog Fallback hostname logic documentation.
This option will NOT change the hostname applied to metrics or traces if they already have hostname-identifying attributes.
Blocks
The following blocks are supported inside the definition of otelcol.exporter.datadog
:
The >
symbol indicates deeper levels of nesting. For example, metrics > summaries
refers to a summaries
block defined inside a metrics
block.
api block
The api
block configures authentication with the Datadog API. This is required to send telemetry
to Datadog. If you do not provide the api
block, you can’t send telemetry to Datadog.
The following arguments are supported:
traces block
The traces
block configures the trace exporter settings.
The following arguments are supported:
If compute_stats_by_span_kind
is disabled, only top-level and measured spans will have stats computed.
If you are sending OTel traces and want stats on non-top-level spans, this flag must be set to true
.
If you are sending OTel traces and do not want stats computed by span kind, you must disable this flag and disable compute_top_level_by_span_kind
.
If endpoint
is unset, the value is obtained through the site
parameter in the api section.
logs block
The logs
block configures the logs exporter settings.
The following arguments are supported:
If use_compression
is disabled, compression_level
has no effect.
If endpoint
is unset, the value is obtained through the site
parameter in the api section.
metrics block
The metrics
block configures Metric specific exporter settings.
The following arguments are supported:
Any of the subset of resource attributes in the semantic mapping list are converted to Datadog conventions and set to to metric tags whether resource_attributes_as_tags
is enabled or not.
If endpoint
is unset, the value is obtained through the site
parameter in the api section.
exporter block
The exporter
block configures the metric exporter settings.
The following arguments are supported:
histograms block
The histograms
block configures the histogram settings.
The following arguments are supported:
Valid values for mode
are:
"distributions"
to report metrics as Datadog distributions (recommended)."nobuckets"
to not report bucket metrics."counters"
to report one metric per histogram bucket.
sums block
The sums
block configures the sums settings.
The following arguments are supported:
Valid values for cumulative_monotonic_mode
are:
"to_delta"
to calculate delta for sum in the client side and report as Datadog counts."raw_value"
to report the raw value as a Datadog gauge.
Valid values for initial_cumulative_monotonic_value
are:
"auto"
reports the initial value if its start timestamp is set, and it happens after the process was started."drop"
always drops the initial value."keep"
always reports the initial value.
summaries block
The summaries
block configures the summary settings.
The following arguments are supported:
Valid values for mode
are:
"noquantiles"
to not report quantile metrics."gauges"
to report one gauge metric per quantile.
host_metadata block
The host_metadata
block configures the host metadata configuration.
Host metadata is the information used to populate the infrastructure list and the host map, and provide host tags functionality within the Datadog app.
The following arguments are supported:
By default, the exporter will only send host metadata for a single host, whose name is chosen according to host_metadata::hostname_source
.
Valid values for hostname_source
are:
"first_resource"
picks the host metadata hostname from the resource attributes on the first OTLP payload that gets to the exporter. If the first payload lacks hostname-like attributes, it will fallback to ‘config_or_system’ behavior. Do not use this hostname source if receiving data from multiple hosts."config_or_system"
picks the host metadata hostname from the ‘hostname’ setting, falling back to system and cloud provider APIs.
client block
The client
block configures the HTTP client used by the component.
Not all fields are supported by the Datadog Exporter.
The following arguments are supported:
retry_on_failure block
The retry_on_failure
block configures how failed requests to Datadog are retried.
The following arguments are supported:
When enabled
is true
, failed batches are retried after a given interval.
The initial_interval
argument specifies how long to wait before the first retry attempt.
If requests continue to fail, the time to wait before retrying increases by the factor specified by the multiplier
argument, which must be greater than 1.0
.
The max_interval
argument specifies the upper bound of how long to wait between retries.
The randomization_factor
argument is useful for adding jitter between retrying Alloy instances.
If randomization_factor
is greater than 0
, the wait time before retries is multiplied by a random factor in the range [ I - randomization_factor * I, I + randomization_factor * I]
, where I
is the current interval.
If a batch hasn’t been sent successfully, it’s discarded after the time specified by max_elapsed_time
elapses.
If max_elapsed_time
is set to "0s"
, failed requests are retried forever until they succeed.
queue block
The queue
block configures an in-memory buffer of batches before data is sent to the HTTP server.
The following arguments are supported:
When enabled
is true
, data is first written to an in-memory buffer before sending it to the configured server.
Batches sent to the component’s input
exported field are added to the buffer as long as the number of unsent batches doesn’t exceed the configured queue_size
.
queue_size
determines how long an endpoint outage is tolerated.
Assuming 100 requests/second, the default queue size 1000
provides about 10 seconds of outage tolerance.
To calculate the correct value for queue_size
, multiply the average number of outgoing requests per second by the time in seconds that outages are tolerated. A very high value can cause Out Of Memory (OOM) kills.
The num_consumers
argument controls how many readers read from the buffer and send data in parallel.
Larger values of num_consumers
allow data to be sent more quickly at the expense of increased network traffic.
debug_metrics block
The debug_metrics
block configures the metrics that this component generates to monitor its state.
The following arguments are supported:
disable_high_cardinality_metrics
is the Grafana Alloy equivalent to the telemetry.disableHighCardinalityMetrics
feature gate in the OpenTelemetry Collector.
It removes attributes that could cause high cardinality metrics.
For example, attributes with IP addresses and port numbers in metrics about HTTP and gRPC connections are removed.
Note
If configured,
disable_high_cardinality_metrics
only applies tootelcol.exporter.*
andotelcol.receiver.*
components.
level
is the Alloy equivalent to the telemetry.metrics.level
feature gate in the OpenTelemetry Collector.
Possible values are "none"
, "basic"
, "normal"
and "detailed"
.
Exported fields
The following fields are exported and can be referenced by other components:
input
accepts otelcol.Consumer
data for any telemetry signal (metrics, logs, or traces).
Component health
otelcol.exporter.datadog
is only reported as unhealthy if given an invalid
configuration.
Debug information
otelcol.exporter.datadog
does not expose any component-specific debug
information.
Example
Forward Prometheus Metrics
This example forwards Prometheus metrics from Alloy through a receiver for conversion to Open Telemetry format before finally sending them to Datadog.
If you are using the US Datadog APIs, the api
field is required for the exporter to function.
Full OTel pipeline
This example forwards metrics and traces received in Datadog format to Alloy, converts them to OTel format, and exports them to Datadog.
Compatible components
otelcol.exporter.datadog
has exports that can be consumed by the following components:
- Components that consume OpenTelemetry
otelcol.Consumer
Note
Connecting some components may not be sensible or components may require further configuration to make the connection work correctly. Refer to the linked documentation for more details.