Skip to content

Commit

Permalink
docs: router setup for Datadog (#6008)
Browse files Browse the repository at this point in the history
  • Loading branch information
shorgi authored Nov 22, 2024
1 parent dc0426c commit 214b2e4
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 20 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -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: <dd-agent-ip>: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: <datadog-agent-endpoint>`. For example:

You should enable the [OTLP exporter](/router/configuration/telemetry/exporters/metrics/otlp#configuration) and set both `temporality: delta` and `endpoint: <datadog-agent-endpoint>`. For example:

```yaml title="router.yaml"
telemetry:
Expand All @@ -44,9 +30,20 @@ telemetry:
<Note>
**You must set `temporality: delta`**, otherwise the router generates incorrect metrics.
You must set `temporality: delta`, otherwise the router generates incorrect metrics.

</Note>

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: <dd-agent-ip>: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).
46 changes: 46 additions & 0 deletions docs/source/reference/router/telemetry/trace-exporters/datadog.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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:
<img
className="screenshot"
alt="Datadog APM showing operations set with example attributes set in router.yaml"
src="../../../../images/router/datadog-apm-ops-example.png"
width="600"
/>
## OTLP configuration
To export traces to Datadog via OTLP, you must do the following:
Expand Down

0 comments on commit 214b2e4

Please sign in to comment.