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(seer grouping): Add metrics for feature flag and eligible content #76639

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions src/sentry/grouping/ingest/seer.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,14 @@ def should_call_seer_for_grouping(event: Event, primary_hashes: CalculatedHashes

project = event.project

if not _project_has_similarity_grouping_enabled(project):
return False
# Check both of these before returning based on either so we can gather metrics on their results
content_is_eligible = event_content_is_seer_eligible(event)
seer_enabled_for_project = _project_has_similarity_grouping_enabled(project)

if _has_customized_fingerprint(event, primary_hashes):
if not (content_is_eligible and seer_enabled_for_project):
return False

if not event_content_is_seer_eligible(event):
if _has_customized_fingerprint(event, primary_hashes):
return False

# **Do not add any new checks after this.** The rate limit check MUST remain the last of all the
Expand Down Expand Up @@ -70,6 +71,12 @@ def _project_has_similarity_grouping_enabled(project: Project) -> bool:
# projects have been backfilled, the option (and this check) can go away.
has_been_backfilled = project.get_option("sentry:similarity_backfill_completed")

metrics.incr(
"grouping.similarity.event_from_backfilled_project",
sample_rate=options.get("seer.similarity.metrics_sample_rate"),
tags={"backfilled": has_seer_grouping_flag_on or has_been_backfilled},
)

return has_seer_grouping_flag_on or has_been_backfilled


Expand Down
15 changes: 15 additions & 0 deletions src/sentry/seer/similarity/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,26 @@ def event_content_is_seer_eligible(event: Event) -> bool:
"""
# TODO: Determine if we want to filter out non-sourcemapped events
if not event_content_has_stacktrace(event):
metrics.incr(
"grouping.similarity.event_content_seer_eligible",
sample_rate=options.get("seer.similarity.metrics_sample_rate"),
tags={"eligible": False, "blocker": "no-stacktrace"},
)
return False

if event.platform not in SEER_ELIGIBLE_PLATFORMS:
metrics.incr(
"grouping.similarity.event_content_seer_eligible",
sample_rate=options.get("seer.similarity.metrics_sample_rate"),
tags={"eligible": False, "blocker": "unsupported-platform"},
)
return False

metrics.incr(
"grouping.similarity.event_content_seer_eligible",
sample_rate=options.get("seer.similarity.metrics_sample_rate"),
tags={"eligible": True, "blocker": "none"},
)
return True


Expand Down
Loading