Subchapter 81.7
references/other.mdMarkdown4 KBView on GitHub
AI agents: this is one page from PostHog’s docs. Full index of Markdown docs for LLMs: https://posthog.com/llms.txt (opens in a new tab)
Note: Metrics is in open alpha. Any team can turn it on — open Metrics (opens in a new tab) and select Enable metrics in the onboarding view. Setup details, including the ingestion endpoint, may change before general availability.
PostHog’s application metrics work with any OpenTelemetry-compatible client. If your app or infrastructure already exports OTLP metrics, point the exporter at PostHog. No PostHog packages required.
1
Required
The key requirements are:
?token= query parameterFind the OpenTelemetry SDK for your language in the official registry (opens in a new tab). If you already run an OpenTelemetry Collector, you can add PostHog as an additional exporter without touching application code.
2
Required
You’ll need your PostHog project token to authenticate metrics requests. This is the same key you use for capturing events and exceptions with the PostHog SDK.
Important: Use your project token which starts with
phc_. Do not use a personal API key (which starts withphx_).
You can find your project token in Project Settings (opens in a new tab).
3
Required
Most OpenTelemetry SDKs pick up standard environment variables, so configuration is often no more than:
Terminal
OTEL_EXPORTER_OTLP_METRICS_ENDPOINT="https://us.i.posthog.com/i/v1/metrics"
OTEL_EXPORTER_OTLP_METRICS_HEADERS="Authorization=Bearer <ph_project_token>"
OTEL_SERVICE_NAME="my-app"Set OTEL_SERVICE_NAME so metrics from different systems stay easy to tell apart. It’s attached to every series and used by the Metrics UI for filtering.
If you configure the exporter in code instead:
Endpoint:
https://us.i.posthog.com/i/v1/metricsAuthentication: Include your project token either as an Authorization header:
4
Recommended
If nothing shows up, check that the endpoint ends in /i/v1/metrics, that the token starts with phc_, and see the troubleshooting section (opens in a new tab).
Checkpoint
What you can do with your metrics
| Action | Description |
|---|---|
| Why you need metrics (opens in a new tab) | What metrics show you that events and logs don’t |
| Getting started guide (opens in a new tab) | Pick the right metric type, add attributes carefully, and chart what matters |
| Group and filter | Group by an attribute for one line per value, or filter with key=value chips |
| How metrics works |
Ask PostHog AI
HelpfulCould be better
Authorization: Bearer <ph_project_token>Or as a query parameter on the endpoint:
https://us.i.posthog.com/i/v1/metrics?token=<ph_project_token>| How metrics are ingested, stored, and queried |
| Query with SQL | Every metric lands in the posthog.metrics table, queryable from the SQL tab |