Skip to content

Include if a trace is too large in the cache metadata#46080

Closed
csmarchbanks wants to merge 2 commits into
open-telemetry:mainfrom
csmarchbanks:trace-too-large-decision-metadata
Closed

Include if a trace is too large in the cache metadata#46080
csmarchbanks wants to merge 2 commits into
open-telemetry:mainfrom
csmarchbanks:trace-too-large-decision-metadata

Conversation

@csmarchbanks
Copy link
Copy Markdown
Contributor

@csmarchbanks csmarchbanks commented Feb 13, 2026

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.

@csmarchbanks csmarchbanks force-pushed the trace-too-large-decision-metadata branch from e9e52bc to 2adec4e Compare February 13, 2026 20:37
@csmarchbanks csmarchbanks marked this pull request as ready for review February 13, 2026 20:38
@csmarchbanks csmarchbanks requested review from a team and jmacd as code owners February 13, 2026 20:38
@csmarchbanks csmarchbanks requested a review from songy23 February 13, 2026 20:38
@github-actions github-actions Bot added the processor/tailsampling Tail sampling processor label Feb 13, 2026
@csmarchbanks csmarchbanks marked this pull request as draft February 13, 2026 20:55
@csmarchbanks csmarchbanks force-pushed the trace-too-large-decision-metadata branch 2 times, most recently from 1195433 to cfc53ae Compare February 13, 2026 21:13
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>
@csmarchbanks csmarchbanks force-pushed the trace-too-large-decision-metadata branch from cfc53ae to 729352f Compare February 13, 2026 21:14
@csmarchbanks csmarchbanks marked this pull request as ready for review February 13, 2026 21:16
@csmarchbanks
Copy link
Copy Markdown
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.

@csmarchbanks csmarchbanks marked this pull request as draft February 16, 2026 03:43
@csmarchbanks
Copy link
Copy Markdown
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.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 4, 2026

This PR was marked stale due to lack of activity. It will be closed in 14 days.

@github-actions github-actions Bot added the Stale label Mar 4, 2026
@csmarchbanks
Copy link
Copy Markdown
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

processor/tailsampling Tail sampling processor Stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants