diff --git a/docs/source/images/router/datadog-apm-ops-example.png b/docs/source/images/router/datadog-apm-ops-example.png new file mode 100644 index 0000000000..6d92a5e2d5 Binary files /dev/null and b/docs/source/images/router/datadog-apm-ops-example.png differ diff --git a/docs/source/reference/router/telemetry/metrics-exporters/datadog.mdx b/docs/source/reference/router/telemetry/metrics-exporters/datadog.mdx index 4aa7850a76..4526ab38d4 100644 --- a/docs/source/reference/router/telemetry/metrics-exporters/datadog.mdx +++ b/docs/source/reference/router/telemetry/metrics-exporters/datadog.mdx @@ -8,27 +8,13 @@ Enable and configure the [OTLP exporter](/router/configuration/telemetry/exporte For general tracing configuration, refer to [Router Metrics Configuration](/router/configuration/telemetry/exporters/metrics/overview). -## Datadog configuration +## Configuration -To export metrics to Datadog, you must both: - -- Configure the Datadog agent to accept OpenTelemetry Protocol (OTLP) metrics, and -- Configure the router to send traces to the Datadog agent. - -### Datadog agent configuration - -To configure the Datadog agent, add OTLP configuration (`otlp_config`) to your `datadog.yaml`. For example: - -```yaml title="datadog.yaml" -otlp_config: - receiver: - protocols: - grpc: - endpoint: :4317 -``` +To export metrics to Datadog, you must configure both the router to send traces to the Datadog agent and the Datadog agent to accept OpenTelemetry Protocol (OTLP) metrics. ### Router configuration -To configure the router, enable the [OTLP exporter](/router/configuration/telemetry/exporters/metrics/otlp#configuration) and set both `temporality: delta` and `endpoint: `. For example: + +You should enable the [OTLP exporter](/router/configuration/telemetry/exporters/metrics/otlp#configuration) and set both `temporality: delta` and `endpoint: `. For example: ```yaml title="router.yaml" telemetry: @@ -44,9 +30,20 @@ telemetry: -**You must set `temporality: delta`**, otherwise the router generates incorrect metrics. +You must set `temporality: delta`, otherwise the router generates incorrect metrics. -For more details about Datadog configuration, see [Datadog's docs on Agent configuration](https://docs.datadoghq.com/opentelemetry/otlp_ingest_in_the_agent/?tab=host). +### Datadog agent configuration + +To configure the Datadog agent, add OTLP configuration (`otlp_config`) to your `datadog.yaml`. For example: +```yaml title="datadog.yaml" +otlp_config: + receiver: + protocols: + grpc: + endpoint: :4317 +``` + +For more details about Datadog configuration, see [Datadog's docs on Agent configuration](https://docs.datadoghq.com/opentelemetry/otlp_ingest_in_the_agent/?tab=host). diff --git a/docs/source/reference/router/telemetry/trace-exporters/datadog.mdx b/docs/source/reference/router/telemetry/trace-exporters/datadog.mdx index e1b105d338..23cd378332 100644 --- a/docs/source/reference/router/telemetry/trace-exporters/datadog.mdx +++ b/docs/source/reference/router/telemetry/trace-exporters/datadog.mdx @@ -10,6 +10,52 @@ Enable and configure the [Datadog](https://www.datadoghq.com/) exporter for trac For general tracing configuration, refer to [Router Tracing Configuration](/router/configuration/telemetry/exporters/tracing/overview). +## Attributes for Datadog APM UI + +The router should set attributes that Datadog uses to organize its APM view and other UI: + +- `otel.name`: span name that's fixed for Datadog +- `resource.name`: Datadog resource name that's displayed in traces +- `operation.name`: Datadog operation name that populates a dropdown menu in the Datadog service page + +You should add these attributes to your `router.yaml` configuration file. The example below sets these attributes for the `router`, `supergraph`, and `subgraph` stages of the router's request lifecycle: + +```yaml title="router.yaml" +telemetry: + instrumentation: + spans: + mode: spec_compliant + router: + attributes: + otel.name: router + operation.name: "router" + resource.name: + request_method: true + + supergraph: + attributes: + otel.name: supergraph + operation.name: "supergraph" + resource.name: + operation_name: string + + subgraph: + attributes: + otel.name: subgraph + operation.name: "subgraph" + resource.name: + subgraph_operation_name: string +``` + +Consequently you can filter for these operations in Datadog APM: + +Datadog APM showing operations set with example attributes set in router.yaml + ## OTLP configuration To export traces to Datadog via OTLP, you must do the following: