Skip to content

Migrate from Grafana Cloud to Logfire

Grafana Cloud’s recommended pipeline is Grafana Alloy, Grafana’s distribution of the OpenTelemetry Collector, exporting OTLP to the Grafana Cloud endpoint (Tempo for traces, Loki for logs, Mimir for metrics). Because that’s standard OpenTelemetry, migrating 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 Grafana Cloud

Grafana Cloud authenticates OTLP with HTTP Basic auth (instanceID:token). Point the SDK at Logfire and replace that with Logfire’s Authorization header:

Terminal
# before (Grafana Cloud — copy your exact values from the Grafana Cloud
# "OpenTelemetry" tile, which generates the endpoint and Basic-auth header):
#   OTEL_EXPORTER_OTLP_ENDPOINT=https://otlp-gateway-<region>.grafana.net/otlp
#   OTEL_EXPORTER_OTLP_HEADERS='Authorization=Basic <base64 instanceID:token>'
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 Grafana Alloy

Change the otelcol.exporter.otlphttp block’s endpoint and auth to Logfire, and keep the rest of your pipeline. Alloy uses its own configuration syntax:

otelcol.exporter.otlphttp "logfire" {
  client {
    endpoint = "https://logfire-us.pydantic.dev"  // or https://logfire-eu.pydantic.dev
    headers  = {
      "Authorization" = "Bearer " + sys.env("LOGFIRE_TOKEN"),
    }
  }
}

Then point your processors’ output at otelcol.exporter.otlphttp.logfire.input. During a cutover you can send to both Grafana Cloud and Logfire from the same pipeline.

Verify

Run your workload and open the Live view. Traces should appear within seconds.

See also