getsentry / sentry-rust

Official Sentry SDK for Rust
https://sentry.io/
Apache License 2.0
609 stars 148 forks source link

Add support for Sampling function (`traces_sampler`) #657

Open gdubicki opened 3 months ago

gdubicki commented 3 months ago

Hi,

The performance metrics of our apps are skewed by a lot of super-fast queries from our load balancer to the healthcheck endpoints.

We would appreciate implementing the Sampling function (traces_sampler), as documented here, with a mention:

Sampling functions (traces_sampler) are currently not supported by this platform.

This way we could implement checking the transaction path/URL and set the sample rate 0 for the ones that are to the healthcheck endpoints.

Please let us know if you are open to PRs with such a feature!

loewenheim commented 3 months ago

Hi, we would definitely be open to such a PR!

Ten0 commented 1 month ago

Isn't that already implemented here? https://github.com/getsentry/sentry-rust/blob/e828ca28a53994a64ef91e72f1f6fe7e10c6ea3c/sentry-core/src/clientoptions.rs#L82