Skip to content

Migrate from Datadog to Logfire

Datadog ingests OpenTelemetry (OTel) two ways: OTel SDKs that export to the Datadog Agent’s OpenTelemetry Protocol (OTLP) intake, or the Datadog Distribution of the OpenTelemetry Collector (DDOT) with the datadog exporter. In both cases your instrumentation is standard OpenTelemetry, so moving to Logfire is an exporter change — see Migrate to Logfire for the general shape.

You’ll need a Logfire write token and your region endpoint (https://logfire-us.pydantic.dev or -eu).

If your apps export OTLP to the Datadog Agent

You were pointing the OpenTelemetry SDK at the Agent’s OTLP receiver (usually http://localhost:4317/:4318), or straight at Datadog’s Direct OTLP Ingest endpoint. Either way, point it at Logfire instead — no agent in the middle:

Terminal
export OTEL_EXPORTER_OTLP_ENDPOINT=https://logfire-us.pydantic.dev
export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
export OTEL_EXPORTER_OTLP_HEADERS='Authorization=your-write-token'
export OTEL_SERVICE_NAME=your-service-name

If you run a Collector with the datadog exporter (DDOT or upstream)

Replace the datadog exporter with an otlphttp exporter that targets Logfire, and reference it from each pipeline. Receivers and processors stay as they are.

exporters:
  # remove (or keep alongside during cutover):
  # datadog:
  #   api:
  #     site: datadoghq.com  # yours may differ: datadoghq.eu, us5.datadoghq.com, etc.
  #     key: ${env:DD_API_KEY}
  otlphttp/logfire:
    endpoint: "https://logfire-us.pydantic.dev"  # or https://logfire-eu.pydantic.dev
    headers:
      Authorization: "Bearer ${env:LOGFIRE_TOKEN}"

service:
  pipelines:
    traces:
      exporters: [otlphttp/logfire]
    metrics:
      exporters: [otlphttp/logfire]
    logs:
      exporters: [otlphttp/logfire]

To run both during a cutover, list both exporters ([datadog, otlphttp/logfire]) and compare the same traffic in each backend before dropping Datadog.

Verify

Run your workload and open the Live view. Traces should appear within seconds. If not, re-check the write token and region.

See also