docs(node): document distributed tracing - #19837
Draft
turnipdabeets wants to merge 11 commits into
Draft
Conversation
Covers withSpan/startSpan/getActiveSpan, the traces option, W3C trace context propagation, and the person/session join.
23 tasks
Contributor
Deploy preview
|
Contributor
|
Vale prose linter → found 13 errors, 37 warnings, 3 suggestions in your markdown Full report → Copy the linter results into an LLM to batch-fix issues. Linter being weird? Update the rules!
|
| Line | Severity | Message | Rule |
|---|---|---|---|
| 38:52 | error | Hi, Andy here... use an en dash ( – ) with spaces. On Mac, holding down the Option and hyphen key will give you an en dash. | PostHogBase.EnDash |
| 38:57 | warning | Use 'X' instead of 'x'. | Vale.Terms |
| 38:193 | error | Hi, Andy here... use an en dash ( – ) with spaces. On Mac, holding down the Option and hyphen key will give you an en dash. | PostHogBase.EnDash |
| 142:135 | error | Hi, Andy here... use an en dash ( – ) with spaces. On Mac, holding down the Option and hyphen key will give you an en dash. | PostHogBase.EnDash |
contents/docs/distributed-tracing/installation/nodejs.mdx — 0 errors, 3 warnings, 0 suggestions
| Line | Severity | Message | Rule |
|---|---|---|---|
| 3:15 | warning | 'nodejs' is a possible misspelling. | PostHogBase.Spelling |
| 60:68 | warning | Use the Oxford comma before 'and' or 'or' in a list of three or more items. | PostHogBase.OxfordComma |
| 118:4 | warning | 'With OpenTelemetry' heading should be in sentence case, and product names should be capitalized. | PostHogBase.SentenceCase |
contents/docs/distributed-tracing/start-here.mdx — 0 errors, 1 warnings, 0 suggestions
| Line | Severity | Message | Rule |
|---|---|---|---|
| 77:21 | warning | Capitalize 'Logs' for PostHog's product. Use 'logs' for the general industry concept. | PostHogBase.ProductNames |
contents/docs/libraries/node/index.mdx — 10 errors, 32 warnings, 3 suggestions
| Line | Severity | Message | Rule |
|---|---|---|---|
| 6:18 | warning | Use 'GitHub' instead of 'github'. | Vale.Terms |
| 6:37 | warning | Use 'PostHog' instead of 'posthog'. | Vale.Terms |
| 7:15 | warning | 'nodejs' is a possible misspelling. | PostHogBase.Spelling |
| 19:416 | warning | Capitalize 'Feature Flags' for PostHog's product. Use 'feature flags' for the general industry concept. | PostHogBase.ProductNames |
| 40:131 | warning | Capitalize 'Feature Flags' for PostHog's product. Use 'feature flags' for the general industry concept. | PostHogBase.ProductNames |
| 40:210 | warning | Capitalize 'Feature Flags' for PostHog's product. Use 'feature flags' for the general industry concept. | PostHogBase.ProductNames |
| 40:258 | warning | Capitalize 'Feature Flags' for PostHog's product. Use 'feature flags' for the general industry concept. | PostHogBase.ProductNames |
| 41:81 | warning | Capitalize 'Feature Flags' for PostHog's product. Use 'feature flags' for the general industry concept. | PostHogBase.ProductNames |
| 43:62 | warning | 'deduplicates' is a possible misspelling. | PostHogBase.Spelling |
| 44:97 | warning | Capitalize 'Feature Flags' for PostHog's product. Use 'feature flags' for the general industry concept. | PostHogBase.ProductNames |
| 46:80 | warning | Capitalize 'Feature Flags' for PostHog's product. Use 'feature flags' for the general industry concept. | PostHogBase.ProductNames |
| 145:33 | error | Hi, Andy here... use an en dash ( – ) with spaces. On Mac, holding down the Option and hyphen key will give you an en dash. | PostHogBase.EnDash |
| 270:4 | warning | 'Add request context to Express' heading should be in sentence case, and product names should be capitalized. | PostHogBase.SentenceCase |
| 309:19 | suggestion | Address the reader directly. Use 'you' instead of 'the user'. | PostHogDocs.DirectAddress |
| 324:107 | error | Hi, Andy here... use an en dash ( – ) with spaces. On Mac, holding down the Option and hyphen key will give you an en dash. | PostHogBase.EnDash |
| 328:27 | error | Hi, Andy here... use an en dash ( – ) with spaces. On Mac, holding down the Option and hyphen key will give you an en dash. | PostHogBase.EnDash |
| 328:267 | suggestion | Address the reader directly. Use 'you' instead of 'the user'. | PostHogDocs.DirectAddress |
| 343:19 | error | Hi, Andy here... use an en dash ( – ) with spaces. On Mac, holding down the Option and hyphen key will give you an en dash. | PostHogBase.EnDash |
| 364:186 | error | Hi, Andy here... use an en dash ( – ) with spaces. On Mac, holding down the Option and hyphen key will give you an en dash. | PostHogBase.EnDash |
| 380:54 | error | Hi, Andy here... use an en dash ( – ) with spaces. On Mac, holding down the Option and hyphen key will give you an en dash. | PostHogBase.EnDash |
| 380:175 | warning | 'bigints' is a possible misspelling. | PostHogBase.Spelling |
| 436:157 | error | Hi, Andy here... use an en dash ( – ) with spaces. On Mac, holding down the Option and hyphen key will give you an en dash. | PostHogBase.EnDash |
| 448:41 | warning | Avoid trivializing words. 'simply' can sound dismissive to the reader. | PostHogDocs.Trivializers |
| 472:62 | warning | 'unscrubbed' is a possible misspelling. | PostHogBase.Spelling |
| 479:227 | error | Hi, Andy here... use an en dash ( – ) with spaces. On Mac, holding down the Option and hyphen key will give you an en dash. | PostHogBase.EnDash |
| 506:154 | error | Hi, Andy here... use an en dash ( – ) with spaces. On Mac, holding down the Option and hyphen key will give you an en dash. | PostHogBase.EnDash |
| 523:4 | warning | Capitalize 'Feature Flags' for PostHog's product. Use 'Feature flags' for the general industry concept. | PostHogBase.ProductNames |
| 523:4 | warning | 'Feature flags' heading should be in sentence case, and product names should be capitalized. | PostHogBase.SentenceCase |
| 552:16 | warning | Capitalize 'Feature Flags' for PostHog's product. Use 'feature flags' for the general industry concept. | PostHogBase.ProductNames |
| 554:68 | warning | Capitalize 'Feature Flags' for PostHog's product. Use 'feature flags' for the general industry concept. | PostHogBase.ProductNames |
| 568:8 | warning | Capitalize 'Experiments' for PostHog's product. Use 'experiments' for the general industry concept. | PostHogBase.ProductNames |
| 568:55 | warning | Capitalize 'Feature Flags' for PostHog's product. Use 'feature flags' for the general industry concept. | PostHogBase.ProductNames |
| 579:28 | warning | Capitalize 'Experiments' for PostHog's product. Use 'experiments' for the general industry concept. | PostHogBase.ProductNames |
| 579:54 | warning | Capitalize 'Feature Flags' for PostHog's product. Use 'feature flags' for the general industry concept. | PostHogBase.ProductNames |
| 616:274 | suggestion | Address the reader directly. Use 'you' instead of 'the user'. | PostHogDocs.DirectAddress |
| 660:62 | warning | Capitalize 'Feature Flags' for PostHog's product. Use 'feature flags' for the general industry concept. | PostHogBase.ProductNames |
| 660:100 | warning | Capitalize 'Surveys' for PostHog's product. Use 'surveys' for the general industry concept. | PostHogBase.ProductNames |
| 662:98 | warning | Capitalize 'Logs' for PostHog's product. Use 'logs' for the general industry concept. | PostHogBase.ProductNames |
| 716:4 | warning | Capitalize 'Error Tracking' for PostHog's product. Use 'Error tracking' for the general industry concept. | PostHogBase.ProductNames |
| 716:4 | warning | 'Error tracking' heading should be in sentence case, and product names should be capitalized. | PostHogBase.SentenceCase |
| 718:207 | warning | Capitalize 'Error Tracking' for PostHog's product. Use 'error tracking' for the general industry concept. | PostHogBase.ProductNames |
| 720:4 | warning | 'Upgrading from V1 to V2' heading should be in sentence case, and product names should be capitalized. | PostHogBase.SentenceCase |
| 722:4 | warning | Use 'X' instead of 'x'. | Vale.Terms |
| 722:4 | error | 'x' is repeated! | Vale.Repetition |
| 722:58 | warning | Use 'TypeScript' instead of 'Typescript'. | Vale.Terms |
Contributor
Bundle reportTotal JS (gzip)8.16 MiB (+8.9 KiB / +0.1%) Largest changed named chunks
Eager graph (modules shipped in each entrypoint's initial chunks)
Largest modules in the
|
| Module | Size |
|---|---|
./src/data/mcp-tools.json |
1081.4 KiB |
css ./node_modules/.pnpm/css-loader@5.2.7_webpack@5.101.3/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[8].oneOf[1].use[1]!./node_modules/.pnpm/postcss-loader@4.3.0_postcss@8.5.6_webpack@5.101.3/node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[8].oneOf[1].use[2]!./src/styles/global.css |
758.8 KiB |
./src/components/Stickers/Stickers.tsx |
696.4 KiB |
./node_modules/.pnpm/@radix-ui+react-icons@1.3.2_react@18.3.1/node_modules/@radix-ui/react-icons/dist/react-icons.esm.js |
481.4 KiB |
./node_modules/.pnpm/@posthog+brand@0.8.0_react@18.3.1/node_modules/@posthog/brand/dist/generated/hoggies/svg/x-ray.mjs |
480.8 KiB |
./node_modules/.pnpm/rehype-raw@7.0.0/node_modules/rehype-raw/lib/index.js + 29 modules |
395.1 KiB |
./node_modules/.pnpm/@posthog+brand@0.8.0_react@18.3.1/node_modules/@posthog/brand/dist/generated/hoggies/svg/im-the-driver.mjs |
385.7 KiB |
./src/hooks/useCustomers.tsx + 55 modules |
370.0 KiB |
./node_modules/.pnpm/@posthog+icons@0.36.6_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@posthog/icons/dist/posthog-icons.es.js |
354.8 KiB |
./node_modules/.pnpm/react-markdown@8.0.7_@types+react@16.14.66_react@18.3.1/node_modules/react-markdown/lib/react-markdown.js + 88 modules |
351.4 KiB |
./src/components/ProductComparisonTable/index.tsx + 126 modules |
301.8 KiB |
./node_modules/.pnpm/cloudinary-core@2.14.0_lodash@4.17.21/node_modules/cloudinary-core/cloudinary-core.js |
281.9 KiB |
./node_modules/.pnpm/@posthog+brand@0.8.0_react@18.3.1/node_modules/@posthog/brand/dist/generated/hoggies/svg/doll-house.mjs |
281.7 KiB |
./node_modules/.pnpm/@posthog+brand@0.8.0_react@18.3.1/node_modules/@posthog/brand/dist/generated/hoggies/svg/director.mjs |
275.6 KiB |
./src/components/SearchUI/index.tsx + 87 modules |
273.0 KiB |
Eager-graph budgets are report-only until a baseline is established. Sizes are gzip of public/**/*.js; eager size is webpack module source bytes for the modules actually shipped in the entrypoint's initial chunks (post-tree-shake).
Adds a tracing key to the node page's features block and a Tracing column to the SDK comparison table.
The Node.js and Next.js guides now cover posthog-node alongside OpenTelemetry, and the pages that claimed no PostHog packages are needed say where that no longer holds.
The SDK PR scopes tracing to posthog-node, so the Next.js page keeps its OpenTelemetry steps and only notes that server-side code can use the Node span API.
23 tasks
Adds the scrubbing hook and per-span cap sections, and the config rows for the limits and the live-span bounds. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0138vKReknFeXLbvMyUX7fPZ
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0138vKReknFeXLbvMyUX7fPZ
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0138vKReknFeXLbvMyUX7fPZ
5 tasks
The event cap turned out to be absolute, and `maxAttributesPerEvent`, `tracestate()`, the start options and sampled-flag propagation were missing. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013sbvfpzMFXrtwcz5S5zhtt
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.
Changes
Documents the distributed tracing API added in PostHog/posthog-js#4579.
Node.js library page — a new
## Distributed tracingsection, placed after the Express request-context section it builds on:tracesclient option (tracing is off until it is set, no OpenTelemetry dependency)withSpanfor scoped spans,startSpanfor detached ones,getActiveSpankindtraceparentposthogDistinctIdandsessionIdshutdown()behavior, and the edge-runtimeawaitcaveatDistributed tracing product docs — the installation guides told Node users to install six
@opentelemetry/*packages, andinstallation/index.mdxandstart-here.mdxboth stated that no PostHog-specific packages are required. That is no longer true on Node:installation/nodejs.mdxnow opens with a comparison of the two routes and coversposthog-nodebefore the existing OpenTelemetry steps. Verification and next steps moved into a shared closing block so both routes end in the same place.installation/nextjs.mdxkeeps its OpenTelemetry steps and gains one note: server-side code can use the Node span API instead, and spans are server-side only. Tutorial: how to build a site app #4579 scopes tracing toposthog-node, so this page claims no more than that.installation/index.mdxandstart-here.mdxpoint at the Node guide for the SDK-native route, and the section is retitled from "Install OpenTelemetry tracing" to "Install tracing" in the page frontmatter andsrc/navs/index.js.Feature comparison —
tracing: truein the Node page'sfeatures:frontmatter and aTracingcolumn insrc/components/LibraryComparison/index.tsx, which is what renders the table on/docs/libraries.Do not merge until PostHog/posthog-js#4579 has merged and shipped. Nothing on these pages exists in a released
posthog-nodeyet.The version in
> Requires posthog-node version >= 5.52.0.(and the same floor on the two tracing install pages) is a guess — current released version is 5.51.4 and the changeset is aminor. Update it to whatever actually ships.Notes for reviewers
posthog-node's span API is manual-only —extensions/express.tscreates no spans — so OTel remains the only path to auto-instrumentation, and it's what the other seven language guides teach.@posthog/nextwould work transitively (getPostHog()returnsIPostHog,optionspassestracesthrough, and the request-scoped proxy applieswithContext), but nothing inpackages/nexttests it and Tutorial: how to build a site app #4579 doesn't claim it, so the Next.js page only points at the Node guide.scheduleDebouncedFlushfires fromenqueue, so a serverless request that creates spans but captures no events gets nowaitUntilflush and must callflush()itself.Checklist
vercel.json