[processor/tailsampling] Added bytes_limiting policy type#42509
Merged
atoulme merged 40 commits intoopen-telemetry:mainfrom Nov 20, 2025
Merged
[processor/tailsampling] Added bytes_limiting policy type#42509atoulme merged 40 commits intoopen-telemetry:mainfrom
atoulme merged 40 commits intoopen-telemetry:mainfrom
Conversation
Signed-off-by: Sean Porter <portertech@gmail.com>
Signed-off-by: Sean Porter <portertech@gmail.com>
Signed-off-by: Sean Porter <portertech@gmail.com>
Signed-off-by: Sean Porter <portertech@gmail.com>
Signed-off-by: Sean Porter <portertech@gmail.com>
Signed-off-by: Sean Porter <portertech@gmail.com>
Signed-off-by: Sean Porter <portertech@gmail.com>
Signed-off-by: Sean Porter <portertech@gmail.com>
Signed-off-by: Sean Porter <portertech@gmail.com>
Signed-off-by: Sean Porter <portertech@gmail.com>
Signed-off-by: Sean Porter <portertech@gmail.com>
Signed-off-by: Sean Porter <portertech@gmail.com>
Signed-off-by: Sean Porter <portertech@gmail.com>
Signed-off-by: Sean Porter <portertech@gmail.com>
Signed-off-by: Sean Porter <portertech@gmail.com>
Logiraptor
reviewed
Oct 13, 2025
Contributor
Logiraptor
left a comment
There was a problem hiding this comment.
The actual change looks good to me, nice and simple. Looks like there's some extra stuff in here though
Signed-off-by: Sean Porter <portertech@gmail.com>
Signed-off-by: Sean Porter <portertech@gmail.com>
Signed-off-by: Sean Porter <portertech@gmail.com>
Signed-off-by: Sean Porter <portertech@gmail.com>
Signed-off-by: Sean Porter <portertech@gmail.com>
Signed-off-by: Sean Porter <portertech@gmail.com>
Logiraptor
approved these changes
Oct 24, 2025
Signed-off-by: Sean Porter <portertech@gmail.com>
atoulme
reviewed
Nov 13, 2025
| // Use the OpenTelemetry Collector's built-in method for accurate size calculation | ||
| // This gives us the exact protobuf marshaled size | ||
| marshaler := &ptrace.ProtoMarshaler{} | ||
| return int64(marshaler.TracesSize(trace.ReceivedBatches)) |
Contributor
There was a problem hiding this comment.
this makes the assumption that the traces will be serialized to proto format, is there a way to allow a different encoding, for example using the encoding extension?
Contributor
Author
There was a problem hiding this comment.
curious, when would this processor encounter other encodings?
Contributor
There was a problem hiding this comment.
OTLP JSON is one. Splunk HEC another. You can see all the encodings we support under extensions/encoding.
atoulme
approved these changes
Nov 20, 2025
Contributor
atoulme
left a comment
There was a problem hiding this comment.
I think this can get in, just need to have an issue open to follow up on the marshaling strategy to count bytes.
andrzej-stencel
pushed a commit
that referenced
this pull request
Nov 20, 2025
#42509 introduced a regression ; this fixes the issue and the main build
RealAnna
pushed a commit
to RealAnna/opentelemetry-collector-contrib
that referenced
this pull request
Nov 20, 2025
open-telemetry#42509 introduced a regression ; this fixes the issue and the main build
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.
This pull-request introduces a new tailsampling processor sampling policy type,
bytes_limiting.Bytes Limiting Policy
The
bytes_limitingpolicy uses a token bucket algorithm implemented by golang.org/x/time/rate to control the rate of data throughput.This policy is particularly useful for:
Configuration
The
bytes_limitingpolicy supports the following configuration parameters:bytes_per_second: The sustained rate at which bytes are allowed through (required)burst_capacity: The maximum number of bytes that can be processed in a burst (optional, defaults to 2xbytes_per_second)Token Bucket Algorithm
The policy implements a token bucket algorithm where:
bytes_per_secondrateburst_capacitytokens for handling traffic burstsExample Configuration