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

chore(anomaly detection): Add logging and metrics when agg value is none #86853

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ceorourke
Copy link
Member

Add logging when the aggregation value is none as we attempt to debug why we're missing sending data to Seer sometimes. Add a metric so we can keep track of how often this happens.

@ceorourke ceorourke requested review from ram-senth and mifu67 March 11, 2025 22:35
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Mar 11, 2025
@@ -53,6 +53,8 @@ def get_anomaly_data_from_seer(
or not snuba_query.time_window
or not aggregation_value
):
metrics.incr("anomaly_detection.aggregation_value.none")
logger.warning("Aggregation value is none", extra=extra_data)
Copy link
Member

Choose a reason for hiding this comment

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

Should we add threshold_type, alert_rule.sensitivity, alert_rule.seasonality, snuba_query.time_window and aggregation_value to extra data? Also, should we check for None explicitly? With this check, we will have a warning if aggregation_value is 0?

Copy link
Member Author

Choose a reason for hiding this comment

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

updated 👍

Copy link

codecov bot commented Mar 11, 2025

Codecov Report

Attention: Patch coverage is 22.22222% with 7 lines in your changes missing coverage. Please review.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
.../sentry/seer/anomaly_detection/get_anomaly_data.py 22.22% 7 Missing ⚠️

❌ Your patch check has failed because the patch coverage (22.22%) is below the target coverage (50.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@             Coverage Diff             @@
##           master   #86853       +/-   ##
===========================================
+ Coverage   33.16%   87.78%   +54.62%     
===========================================
  Files        8288     9796     +1508     
  Lines      462060   554983    +92923     
  Branches    21798    21798               
===========================================
+ Hits       153223   487217   +333994     
+ Misses     308441    67370   -241071     
  Partials      396      396               

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.

3 participants