Skip to content

docs(metrics): add the standard instrumentation recipe for internal teams - #70805

Closed
DanielVisca wants to merge 3 commits into
masterfrom
posthog-code/metrics-team-onboarding
Closed

docs(metrics): add the standard instrumentation recipe for internal teams#70805
DanielVisca wants to merge 3 commits into
masterfrom
posthog-code/metrics-team-onboarding

Conversation

@DanielVisca

Copy link
Copy Markdown
Contributor

Problem

With the Metrics alpha live in the nav and metric alerting merged, internal teams are the first adopters — but there's no single standard answer to "how do I add metrics to my service?". Without one, each team picks its own naming, its own service_name convention, and (worst case) stands up a Prometheus registry + bridge, which we've already decided against for application instrumentation.

Changes

Adds docs/internal/metrics/instrumenting-your-service.md — one page: SDK decision table (js released / node + python in review / OTel for the rest), the standard config block (service_name = k8s deployment name, environment from the deploy env), dot-separated domain-first naming, cardinality rules, the 4-metric starter set (throughput/failures/latency/backlog), and the verify → save insight → alert → dashboard loop.

Companion PRs it links: posthog-js#4117 (node wiring, rebased + ready), posthog-python#739 (new python port).

How did you test this code?

Docs-only. Snippets match the actual SDK APIs in the linked PRs (metrics client option shape verified against both implementations).

🤖 Agent context

Autonomy: Human-driven (agent-assisted) — Daniel directed this; assigned as DRI. Written by Claude as part of the metrics SDK-onboarding track; conventions distilled from the existing /docs/metrics public docs, the dogfood-SDK-first decision, and the alerting work that just merged.

…eams

One page teams can follow without asking the APM team: which SDK per
runtime, the standard service_name/environment config, naming and
cardinality conventions, the throughput/failures/latency/backlog starter
set, and the verify-then-alert loop now that metric alerting is merged.

Generated-By: PostHog Code
Task-Id: 0d65d94c-c18a-4d84-93f6-18eb54876551
@DanielVisca DanielVisca self-assigned this Jul 14, 2026
@github-actions

github-actions Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

🤖 CI report

ℹ️ Docs preview — preview build triggered

Docs from this PR will be published at posthog.com.

Project Preview Updated (UTC)
posthog.com Open preview Jul 14, 2026, 5:35 PM

The preview should be ready in about 10 minutes. Open the preview at /handbook/engineering/.

Explicit environment fallback (unset env var silently omitted the attribute,
defeating the staging/production split the doc promises), version
prerequisite note for the metrics client option, configurable-cap wording
instead of "hard-caps", clearer backlog phrasing, and a sharper prefork
gotcha for module-level Django clients.

Generated-By: PostHog Code
Task-Id: 0d65d94c-c18a-4d84-93f6-18eb54876551
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant