-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Add sentry sample rate #10283
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add sentry sample rate #10283
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Vinnie seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add this here: https://docs.litellm.ai/docs/observability/sentry and here: https://docs.litellm.ai/docs/proxy/logging#sentry
@ishaan-jaff I have updated both of those files per your instructions. I also included information on the already existing trace rate which was not in those docs originally. |
…ntry-sample-rate
Add SENTRY_API_SAMPLE_RATE configuration option for Sentry SDK
Relevant issues
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
tests/litellm/
directory, Adding at least 1 test is a hard requirement - see detailsmake test-unit
)[https://docs.litellm.ai/docs/extras/contributing_code]Type
🆕 New Feature
Changes
This PR adds support for configuring the Sentry SDK sample rate in LiteLLM through the
SENTRY_API_SAMPLE_RATE
environment variable. The sample rate controls what percentage of errors are sent to Sentry, allowing users to limit the volume of error reports while still getting valuable insights.Implementation details:
sample_rate
parameter when initializing Sentry SDKSENTRY_API_SAMPLE_RATE
environment variableAccording to Sentry's documentation, the sample rate is a static rate between 0 and 1 that applies equally to all errors:
This is particularly useful for high-volume applications where sending every error to Sentry might not be necessary or could become cost-prohibitive.