feat(otlp-transformer): add custom logs protobuf serializer#6390
Open
pichlermarc wants to merge 5 commits intoopen-telemetry:mainfrom
Open
feat(otlp-transformer): add custom logs protobuf serializer#6390pichlermarc wants to merge 5 commits intoopen-telemetry:mainfrom
pichlermarc wants to merge 5 commits intoopen-telemetry:mainfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6390 +/- ##
==========================================
+ Coverage 95.50% 95.61% +0.11%
==========================================
Files 365 370 +5
Lines 11609 11992 +383
Branches 2677 2740 +63
==========================================
+ Hits 11087 11466 +379
- Misses 522 526 +4
🚀 New features to boost your workflow:
|
3a90e81 to
bef2eb7
Compare
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.
Which problem is this PR solving?
Currently we run into warnings that CSPs are being violated by
protobuf.js(#4987). Also, to convert toprotobuf.js' format, we do have to go through an intermediate representation, which is costly in terms of allocations.This PR moves toward fixing this by introducing a custom protobuf serializer that can be used instead.
Note: my previous PR #6228 had a simple dynamic growing approach. However, since there is a risk that memory behavior will change for the worse from the current
protobuf.js-based implementation, which does a double-pass to determine the size of the final message, I opted to also implement a double-pass approach. The first pass determines the buffer size and the second pass actually writes to said buffer. This makes the approach slightly slower than what I proposed in #6228 (also slower than JSON serialization, but faster than theprotobuf.js-based approach), but more predictable than the doubling the buffer size or always allocating 64KB, which may not be needed.Towards fixing:
Part of:
Supersedes #6228
Relevant benchmark results:
Old:
New:
Disclosure of AI use: I generated the initial prototype of this with GitHub Copilot and Claude Sonnet 4.5, but then applied a whole bunch of optimizations and changes to it to make it fit what we're trying to do here.
Short description of the changes
Type of change
How Has This Been Tested?