Skip to content

add 'emit' column-numbers mode using pprof-format Line.column - #382

Merged
szegedi merged 1 commit into
mainfrom
szegedi/PROF-15470-emit-column-numbers
Aug 7, 2026
Merged

add 'emit' column-numbers mode using pprof-format Line.column#382
szegedi merged 1 commit into
mainfrom
szegedi/PROF-15470-emit-column-numbers

Conversation

@szegedi

@szegedi szegedi commented Aug 5, 2026

Copy link
Copy Markdown

What does this PR do?:
Adds a new 'emit' value to the columnNumbers option (alongside the existing 'drop' and 'pack'). In 'emit' mode the serializer records the frame's column in the dedicated pprof Line.column field rather than packing it into the high 32 bits of the line field. This requires pprof-format >= 2.3.0 (the version that added Line.column), so the dependency is bumped from ^2.2.1 to ^2.3.0.

Like 'pack', 'emit' only carries a column for frames whose source map was declared but is missing locally — i.e. exactly the frames bound for server-side unminification (the same condition that sets dd:has-missing-map-files). Locally-resolved frames keep a plain line and no column, so column data never reaches profiles that skip server-side unminification.

Motivation:
Server-side deobfuscation of minified Node.js/Next.js profiles needs the column number to discriminate between functions on a single (bundled) line. The existing 'pack' mode encodes the column into the line field, but that produces a non-standards-compliant line value. 'emit' keeps the two concerns cleanly separated: the pprof file carries a real Line.column, and the Datadog backend does the column << 32 | line packing itself for Node.js profiles when it consumes the column field. The backend-side column parsing/packing has already landed.

Additional Notes:
'drop' remains the default, so existing consumers are unaffected. This is purely additive.

How to test the change?:
Covered by unit tests in ts/test/test-profile-serializer.ts:

  • 'emit' populates the real Line.column field and keeps the line plain for a frame with a missing source map.
  • 'emit' carries no column for a frame with no missing map.

Full serializer suite: 24 passing. gts check clean (one pre-existing unrelated warning in otel-thread-ctx.ts).

Jira: PROF-15672

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown

Overall package size

Self size: 2.45 MB
Deduped: 3.16 MB
No deduping: 3.16 MB

Dependency sizes | name | version | self size | total size | |------|---------|-----------|------------| | pprof-format | 2.3.0 | 503.97 kB | 503.97 kB | | source-map | 0.8.0 | 185.66 kB | 185.66 kB | | node-gyp-build | 4.8.4 | 13.86 kB | 13.86 kB |

🤖 This report was automatically generated by heaviest-objects-in-the-universe

@datadog-prod-us1-5

datadog-prod-us1-5 Bot commented Aug 5, 2026

Copy link
Copy Markdown

Pipelines

⚠️ Warnings

🚦 2 Pipeline jobs failed

DataDog/apm-reliability/pprof-nodejs | benchmarks-pr-comment   View in Datadog   GitLab

Pull Request Labels | label   View in Datadog   GitHub Actions

See error Label error. Requires exactly 1 of: semver-patch, semver-minor, semver-major

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: fb9bbc0 | Docs | Datadog PR Page | Give us feedback!

@szegedi szegedi added the semver-minor Usually minor non-breaking improvements label Aug 7, 2026
@szegedi szegedi changed the title [PROF-15470]: add 'emit' column-numbers mode using pprof-format Line.column add 'emit' column-numbers mode using pprof-format Line.column Aug 7, 2026
@szegedi
szegedi marked this pull request as ready for review August 7, 2026 07:34
@szegedi
szegedi merged commit 53e2899 into main Aug 7, 2026
123 of 129 checks passed
@szegedi
szegedi deleted the szegedi/PROF-15470-emit-column-numbers branch August 7, 2026 08:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

semver-minor Usually minor non-breaking improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants