Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,58 @@ 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:
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.

- Configure the Datadog agent to accept OpenTelemetry Protocol (OTLP) metrics, and
- Configure the router to send traces to the Datadog agent.
### Router configuration

### Datadog agent configuration
The router should set attributes that Datadog uses to organize its APM view and other UI:

To configure the Datadog agent, add OTLP configuration (`otlp_config`) to your `datadog.yaml`. For example:
- `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

```yaml title="datadog.yaml"
otlp_config:
receiver:
protocols:
grpc:
endpoint: <dd-agent-ip>:4317
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:
Comment thread
shorgi marked this conversation as resolved.
Outdated
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
```

### 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:
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"
/>


You should also 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 +75,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).