Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Composite Head Samplers #4321

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

PeterF778
Copy link

Changes

Migrating from open-telemetry/oteps#250.

This is another approach for introducing Composite (Head) Samplers. The previous one (open-telemetry/oteps#240) proved too large, with some controversial elements.
This OTEP is a split-off from that one, focusing just on one area - new Composite Samplers.

@carlosalberto carlosalberto added the OTEP OpenTelemetry Enhancement Proposal (OTEP) label Dec 5, 2024
Copy link

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

@github-actions github-actions bot added the Stale label Dec 12, 2024
@PeterF778 PeterF778 marked this pull request as draft December 14, 2024 01:14
@PeterF778
Copy link
Author

Added IsAdjustedCountReliable to SamplingIntent, as discussed by the Sampling SIG.

@github-actions github-actions bot removed the Stale label Dec 14, 2024
Comment on lines +240 to +241
### ConsistentParentBased

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Notes: In the prototype I worked on, I decomposed the logic described below, for the parent-sampled case(s). My goal was to preserve the existing ParentBased sampler's ability to distinguish local from remote parents, by registering more delegates. The way I was thinking, there would be 3 delegates: one root, one local-parent, and one remote-parent case. The two parent cases would default to a type named ConsistentParentThreshold case which is the behavior described in lines 250-270.

This lets us advise users who formerly wrote something like

ParentBased(root, localSampled=AlwaysOn, remoteSampled=AlwaysOn, localUnsampled=AlwaysOff, remoteUnsampled=AlwaysOff)

with

ConsistentParentBased(root, localParent=ConsistentParentThreshold, remoteParent=ConsistentParentThresohld)

then, in case the user has remote and/or local-specific attributes they want to add, it'll be clear how they do that.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, adding attributes for spans with remote parent is an important use case. I had hoped that this could be achieved using ConsistentRuleBased (where we can test for remote parent) and attribute adding wrappers.

What would ConsistentParentThreshold do for root spans (if misused this way)?


The returned `SamplingIntent` is constructed as follows.

- If using the obtained threshold value as the final threshold would entail sampling more spans than the declared target rate, the sampler SHOULD set the threshold to a value that would meet the target rate. Several algorithms can be used for threshold adjustment, no particular behavior is prescribed by the specification though.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link

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

@github-actions github-actions bot added the Stale label Dec 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OTEP OpenTelemetry Enhancement Proposal (OTEP) Stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants