Skip to content

chore(sentry): adjust trace sampling - #830

Merged
mfocko merged 1 commit into
packit:mainfrom
mfocko:chore/adjust-sentry-sampling
Sep 15, 2026
Merged

mfocko merged 1 commit into
packit:mainfrom
mfocko:chore/adjust-sentry-sampling

Conversation

@mfocko

@mfocko mfocko commented Sep 15, 2026

Copy link
Copy Markdown
Member

Lower down the sampling of transaction to save some quota. Especially since a lot of the caught events come from failed tool calls.

By default sample 50% of the transactions, also allow for customization via environment variable, if needed.

For more info see: https://docs.sentry.io/platforms/python/sampling/#sampling-transaction-events

Fixes PACKIT-5116

@mfocko mfocko self-assigned this Sep 15, 2026
Comment thread ymir/common/utils.py
if rate := os.getenv("SENTRY_TRACES_SAMPLE_RATE"):
return float(rate)
# TODO: Take sampling_context into account
return 0.5

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For Packit we do 25% for staging and 10% for production. I guess we can start with 50% here and adjust on the go.

@majamassarini majamassarini left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's try, thanks.

Lower down the sampling of transaction to save some quota. Especially
since a lot of the caught events come from failed tool calls.

By default sample 50% of the transactions, also allow for customization
via environment variable, if needed.

For more info see: https://docs.sentry.io/platforms/python/sampling/#sampling-transaction-events

Fixes PACKIT-5116

Signed-off-by: Matej Focko <mfocko@packit.dev>
@mfocko
mfocko force-pushed the chore/adjust-sentry-sampling branch from 4a4e371 to 12175cb Compare September 15, 2026 11:05
@mfocko
mfocko merged commit e77d3b0 into packit:main Sep 15, 2026
14 checks passed
@mfocko
mfocko deleted the chore/adjust-sentry-sampling branch September 15, 2026 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants