processor/tailsampling: Implement decision time hooks#46161
Merged
Conversation
19fb286 to
c31a381
Compare
c31a381 to
b67bff3
Compare
Allow distributions of the tail sampling processor to create hooks that are called at decision time. These can be useful for anything from extra logging to additional processing of specific traces such as adding custom attributes if desired. This also moves the trace size bytes to be part of samplingpolicy so that sampling extensions can directly use the size of the trace without recalculating it. Signed-off-by: Chris Marchbanks <csmarchbanks@gmail.com>
6b7f897 to
9ed1d75
Compare
jmacd
approved these changes
Feb 23, 2026
Contributor
|
Thank you for your contribution @csmarchbanks! 🎉 We would like to hear from you about your experience contributing to OpenTelemetry by taking a few minutes to fill out this survey. If you are getting started contributing, you can also join the CNCF Slack channel #opentelemetry-new-contributors to ask for guidance and get help. |
antonio-mazzini
pushed a commit
to antonio-mazzini/opentelemetry-collector-contrib
that referenced
this pull request
Mar 5, 2026
…#46161) <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description Allow distributions of the tail sampling processor to create hooks that are called at decision time. These can be useful for anything from extra logging to additional processing of specific traces such as adding custom attributes if desired. This also moves the trace size bytes to be part of samplingpolicy so that sampling extensions can directly use the size of the trace without recalculating it. <!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. --> #### Link to tracking issue This is an alternative to open-telemetry#46080 which allows significantly more functionality and does not put non-used data into the cache metadata and therefore increasing cache size. <!--Describe what testing was performed and which tests were added.--> #### Testing New tests added exercising the new functionality. <!--Please delete paragraphs that you did not use before submitting.--> Signed-off-by: Chris Marchbanks <csmarchbanks@gmail.com>
avleentwilio
pushed a commit
to avleentwilio/opentelemetry-collector-contrib
that referenced
this pull request
Apr 1, 2026
…#46161) <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description Allow distributions of the tail sampling processor to create hooks that are called at decision time. These can be useful for anything from extra logging to additional processing of specific traces such as adding custom attributes if desired. This also moves the trace size bytes to be part of samplingpolicy so that sampling extensions can directly use the size of the trace without recalculating it. <!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. --> #### Link to tracking issue This is an alternative to open-telemetry#46080 which allows significantly more functionality and does not put non-used data into the cache metadata and therefore increasing cache size. <!--Describe what testing was performed and which tests were added.--> #### Testing New tests added exercising the new functionality. <!--Please delete paragraphs that you did not use before submitting.--> Signed-off-by: Chris Marchbanks <csmarchbanks@gmail.com>
This was referenced Apr 10, 2026
atoulme
pushed a commit
that referenced
this pull request
Apr 23, 2026
…47535) #### Description Replaces @Logiraptor with @csmarchbanks as a codeowner of the tail sampling processor as I have been more active recently and @Logiraptor is working on other efforts. In addition, adds @carsonip as a new code owner. Some of my TSP efforts: * #42573 * #44878 * #45286 * #46161 TSP work that @carsonip has done: * #43561 * #46762 * #42326
AndrewCharlesHay
pushed a commit
to AndrewCharlesHay/opentelemetry-collector-contrib
that referenced
this pull request
Apr 23, 2026
…pen-telemetry#47535) #### Description Replaces @Logiraptor with @csmarchbanks as a codeowner of the tail sampling processor as I have been more active recently and @Logiraptor is working on other efforts. In addition, adds @carsonip as a new code owner. Some of my TSP efforts: * open-telemetry#42573 * open-telemetry#44878 * open-telemetry#45286 * open-telemetry#46161 TSP work that @carsonip has done: * open-telemetry#43561 * open-telemetry#46762 * open-telemetry#42326
gracewehner
pushed a commit
to gracewehner/opentelemetry-collector-contrib
that referenced
this pull request
Apr 29, 2026
…pen-telemetry#47535) #### Description Replaces @Logiraptor with @csmarchbanks as a codeowner of the tail sampling processor as I have been more active recently and @Logiraptor is working on other efforts. In addition, adds @carsonip as a new code owner. Some of my TSP efforts: * open-telemetry#42573 * open-telemetry#44878 * open-telemetry#45286 * open-telemetry#46161 TSP work that @carsonip has done: * open-telemetry#43561 * open-telemetry#46762 * open-telemetry#42326
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.
Description
Allow distributions of the tail sampling processor to create hooks that are called at decision time. These can be useful for anything from extra logging to additional processing of specific traces such as adding custom attributes if desired.
This also moves the trace size bytes to be part of samplingpolicy so that sampling extensions can directly use the size of the trace without recalculating it.
Link to tracking issue
This is an alternative to #46080 which allows significantly more functionality and does not put non-used data into the cache metadata and therefore increasing cache size.
Testing
New tests added exercising the new functionality.