Skip to content
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

feat(metric-issues): Add lastChecked to OpenPeriods #83969

Merged
merged 2 commits into from
Jan 24, 2025
Merged

Conversation

snigdhas
Copy link
Member

Metric issues only send a new occurrence when the alert threshold changes. This means an alert can be open at CRITICAL level for 2h and the last_seen on the group would be 2 hours ago. Behind the scenes, the snuba query processor would be checking this value more frequently. This new field, lastChecked is a new field intended to track a closer estimate of when the snuba query was processed. for open periods that are resolved, we can set lastChecked to the resolution time.

@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Jan 23, 2025
snigdhas added a commit that referenced this pull request Jan 23, 2025
Add the new field to the GroupOpenPeriod definition. The backend change
that adds this field is #83969
Copy link

codecov bot commented Jan 24, 2025

Codecov Report

Attention: Patch coverage is 76.47059% with 8 lines in your changes missing coverage. Please review.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/sentry/issues/endpoints/group_details.py 33.33% 8 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #83969      +/-   ##
==========================================
+ Coverage   87.62%   87.66%   +0.03%     
==========================================
  Files        9530     9539       +9     
  Lines      542679   546683    +4004     
  Branches    21259    21259              
==========================================
+ Hits       475508   479234    +3726     
- Misses      66804    67082     +278     
  Partials      367      367              

@snigdhas snigdhas marked this pull request as ready for review January 24, 2025 02:07
@snigdhas snigdhas requested review from a team as code owners January 24, 2025 02:07
@snigdhas snigdhas merged commit c73aa1f into master Jan 24, 2025
49 checks passed
@snigdhas snigdhas deleted the snigdha/last-seen branch January 24, 2025 17:20
snigdhas added a commit that referenced this pull request Jan 24, 2025
Use the lastChecked field added in
#83969 to show a more accurate
value for the last_seen on an issue. This is easier to handle on the
frontend than overloading the last_seen on the backend, which is
generally treated as the timestamp of the latest event/occurrence.

Extra context:
> Metric issues only send a new occurrence when the alert threshold
changes. This means an alert can be open at CRITICAL level for 2h and
the last_seen on the group would be 2 hours ago. Behind the scenes, the
snuba query processor would be checking this value more frequently. This
new field, lastChecked is a new field intended to track a closer
estimate of when the snuba query was processed. for open periods that
are resolved, we can set lastChecked to the resolution time.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Scope: Backend Automatically applied to PRs that change backend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants