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

ddtrace/tracer: have RuleSampler use User{Keep,Reject} instead of new values #1030

Merged
merged 2 commits into from
Oct 20, 2021

Conversation

j-rufino
Copy link
Contributor

@j-rufino j-rufino commented Oct 20, 2021

In this previous PR we changed priority to 3,-3 for traces sampled/not based on sampling rate configuration, to solve two problems:

  • Problem 1: The agent will always reject spans/traces with negative priority, but it might decide to keep some with priority 0. This behaviour is not intuitive for users that intend to reject a specific % of spans/traces.

  • Problem 2: In the backend it's not possible to differentiate and produce stats on which spans/traces were sampled based on one mechanism vs the other.

However we discovered that PHP, C++ and .Net are doing a hard validation on the priority (accept only -1,0,1,2) when they receive it via http headers and anything else is considered as if priority is not set. See here, here.

Based on that, we can not modify the sampling priority values in a backwards compatible way and the only way to obtain the desired behaviour to solve Problem 1 with the existing values is using (-1,2).

For Problem 2, we will not be able to encode the specific "reason" or mechanism used by the user to make the sampling decision via samplingPriority, and we will need to introduce (together with the trace format changes we are making) a trace-level tag to track that reason separately.

Updated documentation here: https://docs.google.com/document/d/1lVhgeG6uS0C9DVmN3t74tBDL7h44duwynIQqExljxRc/edit#

@j-rufino j-rufino added this to the 1.34.0 milestone Oct 20, 2021
@j-rufino j-rufino requested a review from gbbr October 20, 2021 10:20
@j-rufino j-rufino marked this pull request as ready for review October 20, 2021 10:20
… library rules to use USER_ACCEPT and USER_REJECT
@j-rufino j-rufino changed the title ddtrace/tracer: Updated encoding for no-sample decision based tracer rules to use USER_ACCEPT and USER_REJECT ddtrace/tracer: Updated encoding for sampling decisions based tracing library rules to use USER_ACCEPT and USER_REJECT Oct 20, 2021
@gbbr gbbr changed the title ddtrace/tracer: Updated encoding for sampling decisions based tracing library rules to use USER_ACCEPT and USER_REJECT ddtrace/tracer: have RuleSampler use User{Keep,Reject} instead of new values Oct 20, 2021
@gbbr gbbr merged commit 4cfcd67 into v1 Oct 20, 2021
@gbbr gbbr deleted the jrufino/p3 branch October 20, 2021 10:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants