Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ddtrace/tracer: introduce priorities PriorityRuleSamplerKeep (3) and …
…PriorityRuleSamplerReject (-3) for rulesSampler choices. (#1012) So far there were 3 mechanisms to control sampling decisions in the agent, using the following priority values: * Sampling based on rates set by feedback loop between Agent and Tracer using priorities 1 (accept) and 0 (reject) * Sampling based on sampling rate rules set on the tracer using priorities 1 (accept) and 0 (reject) * Sampling based on explicit manual (programatic) user choice using priorities 2 (accept) and -2 (reject) Priorities 0 and 1 being used by both the dynamic agent-tracer feedback loop and by the configuration rules sampling, has two problems, that we intend to resolve by using separate priority values (-3 and 3) when the sampling decision is based on config rules. * 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. Backwards compatibility The behaviour of the agent is to reject spans with negative priority and accept those with priority > 0 and so no corresponding changes on the agent are required for this to be the behaviour.
- Loading branch information