-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
feat(release health): Update snuba metrics to know about session unhandled state #96707
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: master
Are you sure you want to change the base?
Conversation
❌ 8 Tests Failed:
View the top 3 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
b3eca2e
to
c492a3e
Compare
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.
Bug: Missing Enum Member Causes Runtime Error
The SessionStatus
enum is missing the UNHANDLED
member. Code attempts to reference SessionStatus.UNHANDLED
in _get_required_fields
and the status_to_metric_field
mappings for SumSessionField
and CountUniqueSessionField
, which will cause an AttributeError
at runtime.
src/sentry/release_health/metrics_sessions_v2.py#L69-L77
sentry/src/sentry/release_health/metrics_sessions_v2.py
Lines 69 to 77 in a0d95ea
class SessionStatus(Enum): | |
ABNORMAL = "abnormal" | |
CRASHED = "crashed" | |
ERRORED = "errored" | |
HEALTHY = "healthy" | |
src/sentry/release_health/metrics_sessions_v2.py#L268-L269
sentry/src/sentry/release_health/metrics_sessions_v2.py
Lines 268 to 269 in a0d95ea
SessionStatus.ERRORED: MetricField(None, SessionMRI.ERRORED.value), | |
SessionStatus.UNHANDLED: MetricField(None, SessionMRI.UNHANDLED.value), |
src/sentry/release_health/metrics_sessions_v2.py#L244-L245
sentry/src/sentry/release_health/metrics_sessions_v2.py
Lines 244 to 245 in a0d95ea
self.status_to_metric_field[SessionStatus.ERRORED], | |
self.status_to_metric_field[SessionStatus.UNHANDLED], |
In support of https://www.notion.so/sentry/RFC-Session-Status-unhandled-2308b10e4b5d801d9805fece61533ac5#2308b10e4b5d80e9b312ecbea27a4af3 this change adds support for reading back sessions data with the
unhandled
status type.Some of the places in the ui that read this value will be asking for it directly. In this PR we need to make the backend aware of the new type, and update the TypedDicts that will return it. Also we do some special handling to create some fields like
unhandled_sessions
andunhandled_users
that will appear in the main section of the Release Details page.All the existing tests in
test_sessions.py
andtest_sessions_v2.py
were updated to account for the new fields to be returned. I added some extra tests to make use of the new fields directly as well.Related to REPLAY-580