Sampling rules matching when they shouldn't
- Dominant language
- Ruby
- Stars
- 60
- Forks
- 54
- PR merge metrics
- No merged PRs in 30d
Description
Say I have a sampling rule like this with priority 1:

The only other rule configured is the Default rule.
I'd expect for this sampling rule to apply to a service, which starts it's segment like
`XRay.recorder.begin_segment 'anotherService'` and no others, in order to throttle tracing data originating from `anotherService`.
However, it appears to also match in our case to other documents than originally intended and thus is effectively becoming the new default.
From our document I can see that the rule has been applied (censored some bits):
```
{
"Duration": 0.095,
"Id": "1-5c7e774b-8423ee74fd64ab8c0540f810",
"Segments": [
{
"Document": {
"id": "1799765cda88d70c",
"name": "aDifferentServiceName",
"start_time": 1551791947.8924115,
"end_time": 1551791947.9878953,
"http": {
"request": {
"url": "XXXXX",
"method": "GET",
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.119 Safari/537.36",
"client_ip": "XXXXXX",
"x_forwarded_for": true
},
"response": {
"status": 200,
"content_length": 12345
}
},
"aws": {
"xray": {
"sdk_version": "0.11.1",
"sdk": "X-Ray for Ruby",
"sampling_rule_name": "foo"
}
},
```
I'd have expected for my rule not to match in this case and only the Default rule to match.
Contributor guide
Assessment
This issue has not been assessed yet.