-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
sampler.param shows defaultSamplingProbability instead of samplingRate #2171
Comments
What is the implementation language of ServiceA? |
ServiceA is in go This is serviceA:
This is go.mod:
strategies is the one in the original question. I hit endpoints aaa, bbb and ccc 10 times each:
What I expect: 30 traces, 10 for each service The trace has Changing just the part of the service strategy to
The service gets this:
I get the same result (7-8 traces) instead of 30. Finally, only declaring a service_strategy and no default strategy:
In this case I do get what I expect (though the ratelimiting applies globaly instead of per operation, but I think that this is how it works) |
per-operation strategies do not work with rate limiting, only probabilistic sampling. |
Any update on this? |
Going back to your question. $ cat sampling.json {
"service_strategies": [
{
"service": "ServiceA",
"type": "probabilistic",
"param": 1.0
}
],
"default_strategy": {
"type": "probabilistic",
"param": 0.2,
"operation_strategies": [
{
"operation": "/health",
"type": "probabilistic",
"param": 0.0
}
]
}
} $ SPAN_STORAGE_TYPE=memory go run ./cmd/collector --sampling.strategies-file sampling.json
$ curl 'http://localhost:14268/api/sampling?service=ServiceA' | jq
{
"strategyType": "PROBABILISTIC",
"probabilisticSampling": {
"samplingRate": 1
},
"operationSampling": {
"defaultSamplingProbability": 0.2,
"defaultLowerBoundTracesPerSecond": 0,
"perOperationStrategies": [
{
"operation": "/health",
"probabilisticSampling": {
"samplingRate": 0
}
}
]
}
}
$ curl 'http://localhost:14268/api/sampling?service=ServiceB' | jq
{
"strategyType": "PROBABILISTIC",
"probabilisticSampling": {
"samplingRate": 0.2
},
"operationSampling": {
"defaultSamplingProbability": 0.2,
"defaultLowerBoundTracesPerSecond": 0,
"perOperationStrategies": [
{
"operation": "/health",
"probabilisticSampling": {
"samplingRate": 0
}
}
]
}
} While the returned values do reflect the difference between ServiceA and ServiceB, the overall format seems to be incorrect, because the presence of I think there are two issues here:
|
cc people who recently worked on this, in case someone wants to pick this up: @defool @rutgerbrf |
I can reproduce the problem(or feature). In order to provide the ability to define the |
Almost agree, however, if |
As @defool noted, when service strategy is defined, it by default inherits its
As you can see here:
operationSampling should be used.
In the case that user has defined the service strategy, I think its sampling rate should take precedence over the default strategy, because being able to have a custom sampling rate for a single service is one of the reasons that someone would want to define a service strategy. I'm not familiar with the Thrift transport, but it does look like Perhaps it would be best to simply set the fields ( |
There are two types of precedence:
2 is the current's logic. |
What about 3) With 1), as soon as you define a |
This is okay, |
Apply different probability per service
This issue may be related with Issue #696
Giving this strategy configuration:
The client correctly receives this configuration:
However, the traces for ServiceA have this tag:
The same happens if I change the strategy of serviceA to ratelimit. I don't know if it's just the tag that it's wrong or if it's using the default strategy instead of the correct one.
I'm using this docker image: jaegertracing/all-in-one:1.17.1
The text was updated successfully, but these errors were encountered: