Skip to content
This repository has been archived by the owner on Aug 30, 2022. It is now read-only.

Getting sampled spans when using const sampler and param 0 #144

Closed
andremarianiello opened this issue Dec 26, 2018 · 0 comments
Closed

Getting sampled spans when using const sampler and param 0 #144

andremarianiello opened this issue Dec 26, 2018 · 0 comments

Comments

@andremarianiello
Copy link
Contributor

andremarianiello commented Dec 26, 2018

Requirement - what kind of business use case are you trying to solve?

I am trying to disable all non-debug sampling, so that I specifically get traces only when I ask for them via the debug header.

Problem - what in Jaeger blocks you from solving the requirement?

I am using the following config:

{
  "service_name": "avm-nginx",
  "sampler": {
        "type": "const",
        "param": 0
  },
  "reporter": {
        "localAgentHostPort": "jaeger-agent.tracing:6831"
  }
}

via the nginx-opentracing module, but traces are still being sampled.

Proposal - what do you suggest to solve the problem or improve the existing situation?

Make const sampler work as documented when param is set to 0.

I believe the issue is that if the param option is not set, the yaml config parser sets it to 0. A value of 0 is later interpreted as the param being not set, so the param is set to 0.001 because that is default probabilistic sampling rate. Then even later, any non-zero param is interpreted as always sample for the ConstSampler, so there is no way to make the ConstSampler have a false decision. I don't expect this to be intended behavior.

If some other sentinel value was used, like -1, then specifying param = 0 would make ConstSampler and ProbablisticSampler work as documented, and not specifying the param would still work the same.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant