Repository navigation
Conversation
Overall package sizeSelf size: 3 MB Dependency sizes| name | version | self size | total size | |------|---------|-----------|------------| | pprof-format | 2.4.0 | 912.36 kB | 912.36 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 |
szegedi
force-pushed
the
szegedi/otel-builder-extensions
branch
from
November 12, 2026 12:13
b00c035 to
6f9e989
Compare
szegedi
force-pushed
the
szegedi/otel-serializer
branch
from
November 12, 2026 12:13
1cca0e8 to
6d9b255
Compare
❌ ErrorsYour PR has failed checks. Please review the issues below and take necessary action before merging. 🚦 7 Pipeline jobs failed
Useful? React with 👍 / 👎 This comment will be updated automatically if new data arrives.🔗 Commit SHA: a6a083c | Docs | View more details | Give us feedback! |
PprofProfileBuilder is the pprof counterpart of OtelProfilesBuilder: its visitor() collects one normalized profile, and build() returns it as a pprof Profile. A profiler that emits samples itself, such as a timeline of events, can then produce pprof through the same visitor it uses for OTel, instead of building pprof objects by hand. serializeTimeProfile() and serializeHeapProfile() now use it, and their output is unchanged. The builder and its options are exported from the package. The missing source map comment comes from the visitor's end() call, which reports the same result the normalizer returns. pprof samples have no timestamps, so sample timestamps aren't encoded; a profiler that needs them carries them as labels.
teeVisitor() passes a single visit on to several visitors, so that one collection can produce a profile in more than one format, e.g. pprof and OTel while the two are compared. Each visitor returns its own frame and stack IDs, so the tee hands out IDs of its own and translates them for each visitor. It is exported from the package.
szegedi
force-pushed
the
szegedi/otel-serializer
branch
from
November 12, 2026 12:40
6d9b255 to
a136cc8
Compare
szegedi
force-pushed
the
szegedi/otel-builder-extensions
branch
from
November 12, 2026 12:40
6f9e989 to
a6a083c
Compare
This branch has not been deployed
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 does this PR do?:
Adds two visitor utilities on top of #437:
PprofProfileBuilder: the pprof counterpart ofOtelProfilesBuilder.visitor()collects one normalized profile,build()returns it as a pprofProfile.serializeTimeProfile()andserializeHeapProfile()now use it; their output is unchanged.teeVisitor(...visitors): delivers one visit to several visitors, translating frame and stack IDs for each.Both are exported from the package.
Motivation:
Needed for the upcoming OTel support in dd-trace-js:
PprofProfileBuilderit can emit through a visitor, and the same code produces pprof or, throughOtelProfilesBuilder, OTel.teeVisitorlets one collection produce both formats, so pprof and OTel output can be compared while OTel support is rolled out.Additional Notes:
PprofProfileBuilderdoesn't encode sample timestamps. A visitor that needs them carries them as labels, as dd-trace-js already does withend_timestamp_ns.end()call, which reports the same result the normalizer returns.How to test the change?:
ts/test/test-profile-serializer.tschecks thatPprofProfileBuilderproduces byte-identical output toserializeTimeProfile(), and handles a visitor that emits samples itself (no frames, labels, the missing-source-map comment).ts/test/test-otel-serializer.tschecks that a tee'd visit produces the same pprof and OTel bytes as separate visits.npm test.