Install tracing

Contents

PostHog Tracing works with any OpenTelemetry-compatible client – point its OTLP trace exporter at PostHog and you're done, with no PostHog-specific packages.

On Node.js and Python, the PostHog SDK can also create and export spans on its own, with no OpenTelemetry dependency. See the Node.js and Python guides for both routes.

SDK support by signal

SDKLogsTracesMetrics
JavaScript web (posthog-js)Native, 1.368.0+OpenTelemetry. posthog-js doesn't create spans. Use tracing_headers to link requests to sessions.Native posthog.metrics, 1.399.0+
Node.js (posthog-node)Native posthog.logger, 5.65.0+, or OpenTelemetryNative, 5.52.0+ (experimental), or OpenTelemetryNative posthog.metrics, 5.43.0+
Python (posthog)OpenTelemetryNative, 7.58.0+, or OpenTelemetryNative posthog.metrics, 7.23.0+
React NativeNative, posthog-react-native@4.44.0+OpenTelemetryOpenTelemetry
iOSNative, posthog-ios@3.58.0+OpenTelemetryOpenTelemetry
AndroidNative, posthog-android@3.46.0+OpenTelemetryOpenTelemetry
FlutterNative, posthog_flutter@5.27.0+OpenTelemetryOpenTelemetry
Any other languageOpenTelemetryOpenTelemetryOpenTelemetry

"Native" means the PostHog SDK records the signal with no OpenTelemetry packages. "OpenTelemetry" means you send it with an OpenTelemetry SDK or Collector pointed at your PostHog OTLP endpoint (/i/v1/logs, /i/v1/traces, or /i/v1/metrics) and your project token. Every PostHog SDK also captures events natively. Prometheus exporters can send metrics through the metrics agent.

Platforms

Note: Tracing uses the OpenTelemetry Protocol (OTLP) standard over HTTP. If your language isn't listed, check the OpenTelemetry documentation for a compatible SDK and point its OTLP trace exporter at PostHog.

Still have questions?

Was this page useful?