Skip to Content

How do I pair Datadog monitors with OpenTelemetry log records for an AI SRE?

Tares pairs Datadog monitors with OpenTelemetry log records by giving both sources a primary label named service, so one timeline holds the alert and its logs. Datadog reaches Tares through the webhook connector and a Datadog-side setup, because Tares has no connector of its own for Datadog today. The OpenTelemetry logs arrive through the otlp connector. When a monitor fires, the alert and the log lines for that service sit on the same clock, ready for an agent to read.

How it works

Tares builds one timeline per service. Every source that carries the same service label lands on that service’s timeline, merged on one clock. That is what pairs the two signals.

  • The otlp source reads the label from the resource attribute service.name, using the path resourceAttributes.service.name. A bare service field does not exist on an OTLP event, so a label that uses field: service gets no value there.
  • The Datadog source is a webhook source. You write the JSON payload in Datadog, so you choose a top-level field that carries the service name and map it to the service label.
  • Mark the service label primary on both sources. The value Datadog sends must match the value in service.name, character for character, or the two sources land on different timelines.
  • Keep the Datadog payload flat. The webhook connector reads event_type_field and text_template from top-level fields only.

The OpenTelemetry connector takes one source for every service, so you do not add a source per service. The inbound webhook connector stores the Datadog payload lossless and maps only the fields you declare as labels.

Set it up

  1. Create the OTLP source. In Sources, Add source, otlp, or by asking a connected agent, save this source:

    - name: otel connector: otlp config: labels: - { name: service, field: resourceAttributes.service.name, primary: true }
  2. Point your OpenTelemetry exporter or Collector at the daemon:

    OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:8787 # OTLP/HTTP → /v1/{logs,traces,metrics} # or gRPC (otlp-grpc extra): OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317

    On a secured instance, the exporter sends an ingest-scoped API key in an Authorization Bearer header. For example, set OTEL_EXPORTER_OTLP_HEADERS to Authorization=Bearer followed by the key.

  3. Create the Datadog webhook source with the same primary label name. Its field reads the top-level payload field you will write in Datadog. Here that field is also called service:

    - name: datadog connector: webhook config: labels: - { name: service, field: service, primary: true }

    Save it, then copy the ingest endpoint from the source page.

  4. In Datadog, open the Webhooks integration and add a webhook whose URL is that Tares ingest URL.

  5. Write the payload as flat JSON from Datadog variables such as $ALERT_ID, $EVENT_MSG and $LINK. Include a top-level field that holds the service name, spelled exactly as the OpenTelemetry service.name value. When Tares has auth on, add custom headers as JSON with an Authorization Bearer header holding an ingest-scoped API key.

  6. Put the webhook handle, @webhook- followed by the webhook name, in the monitor message so the monitor calls it.

  7. Check the result. On the webhook source page, Recent events shows the alert arriving and Fields shows which payload fields come in and how often. In Explore, pick the service: the Datadog alert and the OTLP log lines appear on one timeline.

  8. Add a trigger over both sources, keyed by service, and subscribe an agent to it, as the AI SRE guide describes. Datadog keeps owning the alerting. Tares ingests what fired and correlates it with the logs.

What you get

  • One timeline per service that holds the Datadog alert and the OpenTelemetry log records on the same clock.
  • A trigger keyed by service can wake an agent with that correlated timeline, or you can read the same evidence over MCP.
  • Datadog stays your alerting system. Nothing is re-thresholded in Tares.
  • A single OTLP source for every service, since the service name comes from the resource attributes of each export.
  • A way to check the pairing. Fields shows whether your Datadog payload carries the service field reliably, and Explore lists the services under the service key.

When something else fits

  • If your alerts come from Prometheus rules or Alertmanager, the AI SRE guide shows connectors that ingest them without a payload you write yourself.
  • If your logs come from a container rather than an OpenTelemetry pipeline, the docker_logs connector keys them by the same service label.
  • If the Datadog service name cannot match service.name exactly, fix the value on one side first, because the two sources only join when the label values are equal.

Still stuck? Get help

Last updated on