feat: add doc_url field to Profile message#81
Merged
Conversation
The pprof spec's Profile message carries doc_url (field 15, an int64 index into the string table pointing at documentation for the profile). Add it to the Profile message — ProfileInput type, constructor, length, encode (field 15, varint), and decode — mirroring the existing defaultSampleType field. Also add doc_url to the reference testing proto so the protobuf.js interop test round-trips it, and add Profile encode/decode tests for it. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
nsavoire
approved these changes
Jul 24, 2026
Merged
szegedi
added a commit
that referenced
this pull request
Jul 24, 2026
The pprof spec's Profile message carries doc_url (field 15, an int64 index into the string table pointing at documentation for the profile). Add it to the Profile message — ProfileInput type, constructor, length, encode (field 15, varint), and decode — mirroring the existing defaultSampleType field. Also add doc_url to the reference testing proto so the protobuf.js interop test round-trips it, and add Profile encode/decode tests for it.
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.
What
Adds the
doc_urlfield (field 15, anint64index into the string table) to the pprofProfilemessage:ProfileInputtype, constructor,length, encode (varint, tag0x78), and decode — mirroring the existingdefaultSampleTypefield.The pprof spec's
Profilecarriesdoc_urlas a link to documentation for the profile; this library didn't encode or decode it, so adoc_urlset on a profile was silently dropped on the wire.Changes
src/index.ts—docUrlon theProfilemessage.testing/proto/profile.proto— addint64 doc_url = 15;so the protobuf.js interop test round-trips the field;profile.js/profile.d.tswere hand-edited to add onlydoc_urlin the existing codegen style (avoiding the unrelated churn a fullnpm run protoproduces with the current protobuf.js version).src/index.test.ts— encode/decode/default tests forProfile.docUrl.Testing
npm test— 80/80 pass, including the protobuf.js interop round-trip.Context
Follows #80 (which added
Line.column). Together these sync pprof-format with the current pprof spec so a release can be cut, after whichpprof-nodejscan adopt both (emitting a realLine.columnfor server-side unminification).🤖 Generated with Claude Code