Skip to content

Commit 777c65d

Browse files
committed
add grouping.similarity.hybrid_fingerprint_seer_result_check metric
1 parent dc18720 commit 777c65d

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/sentry/grouping/ingest/seer.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,9 @@ def get_seer_similar_issues(
298298
# new event be, and again the values must match.
299299
parent_fingerprint = parent_grouphash.get_associated_fingerprint()
300300
parent_has_hybrid_fingerprint = get_fingerprint_type(parent_fingerprint) == "hybrid"
301+
parent_has_metadata = bool(
302+
parent_grouphash.metadata and parent_grouphash.metadata.hashing_metadata
303+
)
301304

302305
if event_has_hybrid_fingerprint or parent_has_hybrid_fingerprint:
303306
# This check will catch both fingerprint type match and fingerprint value match
@@ -309,6 +312,23 @@ def get_seer_similar_issues(
309312
parent_grouphash = None
310313
seer_results_json = []
311314

315+
if not parent_has_metadata:
316+
result = "no_parent_metadata"
317+
elif event_has_hybrid_fingerprint and not parent_has_hybrid_fingerprint:
318+
result = "only_event_hybrid"
319+
elif parent_has_hybrid_fingerprint and not event_has_hybrid_fingerprint:
320+
result = "only_parent_hybrid"
321+
elif not fingerprints_match:
322+
result = "no_fingerprint_match"
323+
else:
324+
result = "fingerprint_match"
325+
326+
metrics.incr(
327+
"grouping.similarity.hybrid_fingerprint_seer_result_check",
328+
sample_rate=options.get("seer.similarity.metrics_sample_rate"),
329+
tags={"platform": event.platform, "result": result},
330+
)
331+
312332
similar_issues_metadata = {
313333
"results": seer_results_json,
314334
"similarity_model_version": SEER_SIMILARITY_MODEL_VERSION,

0 commit comments

Comments
 (0)