aws / aws/aws-xray-sdk-ruby

Sampling rules matching when they shouldn't

Open
#22 1 comment 0 reactions 0 assignees View on GitHub
bug
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:
![screenshot 2019-03-05 at 13 44 02](https://user-images.githubusercontent.com/609378/53808155-d336de00-3f51-11e9-90b2-cfcc9037790c.png)
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.