Skip to content

processor/tailsampling: Implement decision time hooks#46161

Merged
songy23 merged 1 commit into
open-telemetry:mainfrom
csmarchbanks:tsp-decision-hooks
Mar 4, 2026
Merged

processor/tailsampling: Implement decision time hooks#46161
songy23 merged 1 commit into
open-telemetry:mainfrom
csmarchbanks:tsp-decision-hooks

Conversation

@csmarchbanks
Copy link
Copy Markdown
Contributor

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.

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>
@ArthurSens ArthurSens added ready to merge Code review completed; ready to merge by maintainers and removed waiting-for-code-owners labels Mar 4, 2026
@songy23 songy23 merged commit 1df0a2c into open-telemetry:main Mar 4, 2026
238 of 241 checks passed
@otelbot
Copy link
Copy Markdown
Contributor

otelbot Bot commented Mar 4, 2026

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>
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

processor/tailsampling Tail sampling processor ready to merge Code review completed; ready to merge by maintainers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants