Overview
PostHog Distributed Tracing works with the OpenTelemetry Protocol (OTLP). Use standard OpenTelemetry libraries to send spans to PostHog using your project token. On Node.js, posthog-node can also create and export spans itself, with no OpenTelemetry dependency – see the Node.js guide.
Distributed tracing is currently in beta. Setup details may change before general availability.
Why use PostHog Distributed Tracing?
- OpenTelemetry-compatible - Use standard OpenTelemetry SDKs, no PostHog packages required. Works with any compatible client, or with
posthog-node's own span API. - Part of the observability suite - Traces use the same OpenTelemetry ingestion as Logs, in the same PostHog project as session replays, errors, and analytics.
- No vendor lock-in - Works with your existing OpenTelemetry setup.
How it works
Distributed tracing acts as a generic OTLP receiver built by PostHog. Here's how it works:
- Use standard OpenTelemetry tracing APIs in your application
- Include your project token in the Authorization header or as a query parameter
- Configure your OpenTelemetry client to send spans to PostHog's HTTP endpoint
- Search and explore your traces in the PostHog interface