Include if a trace is too large in the cache metadata#46080
Closed
csmarchbanks wants to merge 2 commits into
Closed
Include if a trace is too large in the cache metadata#46080csmarchbanks wants to merge 2 commits into
csmarchbanks wants to merge 2 commits into
Conversation
e9e52bc to
2adec4e
Compare
1195433 to
cfc53ae
Compare
It can be helpful for cache adapters to know if a trace they are caching is too large or not since there is no policy name to use. For example, logging dropped trace ids or propagating the information to another system. Signed-off-by: Chris Marchbanks <csmarchbanks@gmail.com>
cfc53ae to
729352f
Compare
portertech
approved these changes
Feb 13, 2026
axw
approved these changes
Feb 16, 2026
Contributor
Author
|
Though this has approval I am going to move it back to draft. I would like to try a different approach with specific sampled/not sampled hooks instead. I don't love that we are adding fields to the cache metadata to never use them in the core tail sampling processor. |
Contributor
Author
|
I opened #46161 as an alternative. I'd love your thoughts on that one as well. I think it will be far more flexible for those of us running TSP as part of custom solutions. |
Contributor
|
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
Contributor
Author
|
#46161 was approved so closing this one. |
songy23
pushed a commit
that referenced
this pull request
Mar 4, 2026
<!--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. #1234) or full URL to issue, if applicable. --> #### 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. <!--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>
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 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
It can be helpful for cache adapters to know if a trace they are caching is too large or not since there is no policy name to use. For example, logging information about the dropped trace ids, or propagating the information to another system.
Testing
Test assertions added that verify the new metadata is appropriately set.