Document updated on Jun 15, 2022
Exporting traces to Datadog
Datadog is a cloud monitoring and security platform for developers, IT operations teams, and businesses.
Datadog configuration
The Opencensus exporter allows you to export data to Datadog. Enabling it only requires you to add the datadog
exporter in the opencensus module.
The following configuration snippet sends data to your Datadog:
{
"extra_config": {
"telemetry/opencensus": {
"exporters": {
"datadog": {
"tags": [
"gw"
],
"global_tags": {
"env": "prod"
},
"disable_count_per_buckets": true,
"trace_address": "localhost:8126",
"stats_address": "localhost:8125",
"namespace": "krakend",
"service": "gateway"
}
}
}
}
}
namespace
(string) the namespace to which metric keys are appended.tags
(list) specifies a set of global tags to attach to each metricglobal_tags
(object) GlobalTags holds a set of tags (key/value) that will automatically be applied to all exported spans.service
(string) Service specifies the service name used for tracingtrace_address
(string) TraceAddr specifies thehost[:port]
address of the Datadog Trace Agent. It defaults to localhost:8126.stats_address
(string) StatsAddr specifies thehost[:port]
address for DogStatsD. It defaults to localhost:8125. To enable ingestion using Unix Domain Socket (UDS) mount your UDS path and reference it in thestats_address
using a path likeunix:///var/run/datadog/dsd.socket
.disable_count_per_buckets
(bool) Specifies whether to emit count_per_bucket metrics
See also the additional settings of the Opencensus module that can be declared.
B3 propagation
The Opencensus module uses B3 style propagation headers, while the rest of your services might be using datadog-specific propagation headers. If this difference is actual, krakend traces will show up in Datadog but they won’t be connected to the frontend and backend traces.
The ddtrace-run
adds an option to support B3 style propagation using the environment variables DD_TRACE_PROPAGATION_STYLE_EXTRACT
and DD_TRACE_PROPAGATION_STYLE_INJECT
. Use these variables to have your traces perfectly aligned.
For more information see its configuration.