-
Notifications
You must be signed in to change notification settings - Fork 277
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
[OPIK-695] sdk sentry integration #1045
base: main
Are you sure you want to change the base?
Conversation
… invalid workspace value was passed once
|
||
|
||
class FilterByCount(event_filter.EventFilter): | ||
def __init__(self, max_count: int, level: str): |
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.
I guess there are only a few specific level
values. Maybe we could we use Literal instead of str here?
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.
Good idea, will do!
|
||
@functools.lru_cache | ||
def randomized_should_enable_reporting() -> bool: | ||
return random.random() <= SESSION_REPORTING_PROBABILITY |
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.
It seems that this func always returns True?
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.
Yes, in case we need to randomly sample user sessions which will have reporting enabled, we'll reduce the session reporting probability constant value.
Details
Added errors reporting to Sentry.
Unhandled errors inherited from
opik.rest_api.core.ApiError
andopik.exceptions.OpikException
are reported to Sentry together with all Opik log messages with levels "error" and "warning".Client-side configured event limits per python session - 50 warnings and 50 errors.
Testing
Unit tests are added for some sentry setup logic (logger setup + filters chain setup).
Some manual tests are performed.