We've had x-ray running in production for a couple of months now. We started before AWS introduced the ability to set sampling rules via the AWS console.
Just wanted to check what the expected behaviour is now with this new feature (Centralised Sampling Rules) added.
We've configured the sampling rules via the setSamplingRules method. We use a local json file to configure our sampling rates. For example, here we have this file which sets the sampling rate to 1%.
{
"version": 1,
....
"default": {
"fixed_target": 1,
"rate": 0.01
}
}
The docs suggest that, with introduction of centralised sampling routes, by default the remote config will be picked up. And one has to explicitly indicate to the client for local config to be picked up via disableCentralizedSampling method.
If I understand that correctly, by not doing anything, our sampling rate would have gone up to whatever the default centralised sampling rules are. Which I believe is 5%.
So, two questions:
Hi zya,
The docs suggest that, with introduction of centralized sampling routes, by default the remote config will be picked up.
The mechanism to retrieve centralized sampling rules is in the new 3.0.0 major version of the daemon. To enable centralized sampling, you must update both the SDK to the new major version and update the daemon to the new major version. If this is done, the new default behavior is to use the centralized sampling rule.
If you wish to upgrade both the SDK and daemon but not use centralized sampling, you can opt out with the disableCentralizedSampling function you noted.
If, for whatever reason, the daemon cannot refresh the centralized sampling rule within a specific timeframe (right now it's coded to 60 minutes), the SDK will fallback to a local sampling strategy (a user defined one if configured, otherwise the default sampling file in the SDK defined here)
There's a note on the forums accouncement and the daemon release notes but we'll have this added into the developer docs for clarification.
Let me know if you have any additional questions.
Thanks,
Sandra
Closing since it has been a month for this issue being answered. Please feel free to open new ones if there are further questions regarding the new sampling feature.
Most helpful comment
Hi zya,
The mechanism to retrieve centralized sampling rules is in the new 3.0.0 major version of the daemon. To enable centralized sampling, you must update both the SDK to the new major version and update the daemon to the new major version. If this is done, the new default behavior is to use the centralized sampling rule.
If you wish to upgrade both the SDK and daemon but not use centralized sampling, you can opt out with the disableCentralizedSampling function you noted.
If, for whatever reason, the daemon cannot refresh the centralized sampling rule within a specific timeframe (right now it's coded to 60 minutes), the SDK will fallback to a local sampling strategy (a user defined one if configured, otherwise the default sampling file in the SDK defined here)
There's a note on the forums accouncement and the daemon release notes but we'll have this added into the developer docs for clarification.
Let me know if you have any additional questions.
Thanks,
Sandra