Repository navigation
feat(skills): add instrument-tracing skill - #439
Merged
Merged
Conversation
Adds the omnibus instrument-tracing skill, the sibling of instrument-logs and instrument-metrics. It detects the stack, sets up the OpenTelemetry SDK with auto-instrumentation, points the OTLP exporter at /i/v1/traces, covers serverless flushing, and verifies spans arrive.
The main path is now the OpenTelemetry SDK with an OTLP HTTP trace exporter and auto-instrumentation. It does not need the PostHog SDK. The PostHog SDK is an optional way to put person and session IDs on spans. Without it, the agent copies the tracing headers onto spans. Python uses opentelemetry-distro and opentelemetry-bootstrap, and sets the HTTP/protobuf protocol because the distro defaults to gRPC. CODEOWNERS gives the skill to @PostHog/team-apm. Co-Authored-By: Claude Opus 5.5 <[email protected]>
🧙 Wizard CIRun the Wizard CI and test your changes against wizard-workbench example apps by replying with a GitHub comment using one of the following commands: Test all apps:
Test all apps in a directory:
Test an individual app:
Show more apps
Test against a wizard branch:
Add Results will be posted here when complete. |
jonmcwest
marked this pull request as ready for review
October 23, 2026 11:55
johncwaters
approved these changes
Oct 23, 2026
johncwaters
left a comment
Contributor
There was a problem hiding this comment.
Note
Automated review. Not written by a human.
Approved by hand after checking the automated review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The omnibus skill set has
instrument-logsandinstrument-metrics, but no tracing sibling. An agent that must add distributed tracing to an app has no single skill that detects the stack and sets up span export to PostHog.Changes
Adds
omnibus/instrument-tracing, the sibling ofinstrument-logsandinstrument-metrics. It uses the same nine-step shape./i/v1/traceswith the project token as anAuthorization: Bearerheader. If the app already exports OpenTelemetry traces, the skill points that exporter at PostHog.traceparentinjection, so they cannot give distributed traces across services.opentelemetry-distroplusopentelemetry-bootstrap -a install, notopentelemetry-instrumentation-all. It setsOTEL_EXPORTER_OTLP_TRACES_PROTOCOL=http/protobuf, because the distro defaults to gRPC. It also turns off the distro's metric and log export.X-POSTHOG-DISTINCT-IDandX-POSTHOG-SESSION-IDheaders onto spans asposthogDistinctIdandsessionId. If the app already has the PostHog SDK, it can add these attributes instead, for examplePostHogContextSpanProcessorin Python. The skill does not install the PostHog SDK only for this step.context/skills/omnibus/instrument-tracing/to@PostHog/team-apm, as withmetrics/.Endpoints, env var names, and the token format come from the
distributed-tracingdocs on posthog.com.How this relates to the
tracing/skills (#391, #399)The
tracing/family has one docs-only skill per platform (tracing-nodejs,tracing-python, and so on). It routes Node.js and Python apps that already use the PostHog SDK to the SDK span API. This PR does not change those files.instrument-tracingis the omnibus, all-platform skill. It is OpenTelemetry-first for the reason above. It uses the same docs as references, and keeps the SDK span API as an option for apps that do not run OpenTelemetry.Not in this PR
The skill has no
cli:block, so the wizard does not run it yet. Wizard wiring is a follow-up, modeled on #390 and PostHog/wizard#1235.How did you test this code?
npm test: 28 files, 219 tests pass.npm run build: passes.dist/skills/omnibus-instrument-tracing.ziphasSKILL.mdand 12 reference files.🤖 Generated with Claude Code