addDatadogExporter

fun OpenTelemetryConfig.addDatadogExporter(datadogApiKey: String? = null, url: String? = null, timeout: Duration? = null, resourceAttributes: Map<String, String>? = null)(source)

Configure an OpenTelemetry span exporter that sends data to Datadog via direct OTLP intake.

Registered via addSpanExporter, which wraps the exporter in a batch span processor - the cloud HTTP round-trip happens on a worker thread instead of blocking the agent on each span end.

Parameters

datadogApiKey

Datadog API key. If not set, is retrieved from DD_API_KEY environment variable;

url

Datadog site. If not set, is retrieved from DD_SITE environment variable. Defaults to datadoghq.com;

timeout

request timeout (10 seconds by default);

resourceAttributes

resource-level attributes to add to all exported spans.

See also