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).
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:
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
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.
Run your workload and open the Live view. Traces should appear within seconds. If not, re-check the write token and region.
- Migrate to Logfire — the general two-path pattern and parallel-run guidance
- Alternative clients — worked SDK examples
- Logfire vs Datadog — how the platforms compare
- Datadog’s own docs, to confirm your current setup: OpenTelemetry Collector & the Datadog exporter