Omnibus
200 skills · 1230 min
Omnibus
Skill 81 of 200
Add PostHog metric capture to track counters, gauges, and histograms.
4 minutes · 824 words · 4 sections
Install
npx skills add PostHog/skills --skill instrument-metricsnpx skills add PostHog/skills/plugin marketplace add PostHog/skillsThe first command installs just this skill, by the name in its SKILL.md; the second installs the whole repository.
Use this skill to add PostHog metric capture (counters, gauges, and histograms) for new or changed code. Use it after implementing features or reviewing PRs to ensure key operations are measured, when the user asks to add metrics or counters, or to mirror existing metrics instrumentation into PostHog. Supports any platform or language.
Supported platforms: Web (JavaScript), Node.js, Python via the posthog.metrics SDK API, Kubernetes via the metrics agent, and any language via OpenTelemetry (OTLP).
Follow these steps IN ORDER:
STEP 1: Analyze the codebase and detect the platform.
STEP 2: Choose the capture path.
posthog.metrics API — no OpenTelemetry packages needed. Read the matching platform reference now.STEP 3: Instrument alongside existing metrics.
STEP 4: Add new metrics where they belong.
ms, bytes).jobs.processed, api.request.duration) and set a service name so systems stay easy to tell apart.STEP 5: Keep cardinality low.
route, status, plan, or queue are good; user IDs, session IDs, request IDs, and timestamps are not. Every unique attribute combination creates a new series.STEP 6: Set up environment variables. (Skip if the PostHog SDK is already configured — posthog.metrics reuses the SDK’s existing project token.)
.env, .env.local, or framework-specific env files). If valid values already exist, skip this step.projects-get tool to retrieve the project’s api_token. If multiple projects are returned, ask the user which project to use. If the MCP server is not connected or not authenticated, ask the user for their PostHog project token instead.projects-get MCP response for a region field — US maps to https://us.i.posthog.com, EU maps to https://eu.i.posthog.com. If the region is not available from the MCP response or from existing project configuration, ask the user: “Are you on PostHog US Cloud or EU Cloud?” Do not assume US Cloud.https://us.i.posthog.com/i/v1/metrics (US) or https://eu.i.posthog.com/i/v1/metrics (EU), matching the region determined above, with the project token as an Authorization: Bearer header.STEP 7: Verify metrics arrive.
posthog.metrics.flush(), or the OTel provider’s forceFlush()/shutdown()).references/javascript.md - JavaScript (web) metrics installationreferences/nodejs.md - Node.js metrics installationreferences/python.md - Python metrics installationreferences/kubernetes.md - Kubernetes metrics installationreferences/other.md - Other languages metrics installationreferences/start-here.md - Getting started with metricsreferences/basics.md - Why you need metricsreferences/architecture.md - How metrics worksreferences/COMMANDMENTS.md - Framework-specific rules the integration must followEach platform reference contains specific SDK setup, OTLP configuration, and integration patterns. Find the one matching the user’s stack.
posthog.metrics needs no new packages and no extra authentication. Reserve OTLP setup for codebases already invested in OpenTelemetry or languages without SDK support.Add PostHog metric capture to track counters, gauges, and histograms. Use after implementing features or reviewing PRs to ensure key operations are measured, or when asked to add metrics, counters, or track a value over time. Also handles mirroring existing Prometheus/StatsD/OpenTelemetry metrics into PostHog and initial OTLP exporter setup.
The verbatim description from this skill’s front matter — the string an agent matches on to decide whether to load it.
main, last pushed 24 September 2026.SKILL.md, not by matching a directory convention. 2 distinct layouts observed: skills/omnibus/*/SKILL.md, skills/posthog/all/skills/*/SKILL.md.h1 and no skipped levels:.claude-plugin/marketplace.json by PostHog, declaring 6 plugins. It is read for editorial metadata only — never as the skill index, which is always the repository tree./PostHog/skills.md, and each skill at its own .md URL.9 files · 42 KB
Everything this skill ships beside its prose. All of it is set here, as subchapters of skill 81.
Documentation the agent loads on demand, rather than up front.