@@ -342,7 +342,8 @@ def test_sends_expected_data_to_seer(self, mock_get_similarity_data: MagicMock)
342
342
"k" : 1 ,
343
343
"referrer" : "ingest" ,
344
344
"use_reranking" : True ,
345
- }
345
+ },
346
+ {"hybrid_fingerprint" : False },
346
347
)
347
348
348
349
def test_parent_group_found_simple (self ) -> None :
@@ -376,7 +377,10 @@ def test_parent_group_found_simple(self) -> None:
376
377
existing_grouphash ,
377
378
)
378
379
379
- def test_parent_group_found_hybrid_fingerprint_match (self ) -> None :
380
+ @patch ("sentry.grouping.ingest.seer.metrics.incr" )
381
+ def test_parent_group_found_hybrid_fingerprint_match (
382
+ self , mock_metrics_incr : MagicMock
383
+ ) -> None :
380
384
existing_event = save_new_event (
381
385
{"message" : "Dogs are great!" , "fingerprint" : ["{{ default }}" , "maisey" ]},
382
386
self .project ,
@@ -411,8 +415,16 @@ def test_parent_group_found_hybrid_fingerprint_match(self) -> None:
411
415
expected_metadata ,
412
416
existing_grouphash ,
413
417
)
418
+ mock_metrics_incr .assert_called_with (
419
+ "grouping.similarity.hybrid_fingerprint_seer_result_check" ,
420
+ sample_rate = options .get ("seer.similarity.metrics_sample_rate" ),
421
+ tags = {"platform" : "python" , "result" : "fingerprint_match" },
422
+ )
414
423
415
- def test_parent_group_found_hybrid_fingerprint_mismatch (self ) -> None :
424
+ @patch ("sentry.grouping.ingest.seer.metrics.incr" )
425
+ def test_parent_group_found_hybrid_fingerprint_mismatch (
426
+ self , mock_metrics_incr : MagicMock
427
+ ) -> None :
416
428
existing_event = save_new_event (
417
429
{"message" : "Dogs are great!" , "fingerprint" : ["{{ default }}" , "maisey" ]},
418
430
self .project ,
@@ -443,8 +455,16 @@ def test_parent_group_found_hybrid_fingerprint_mismatch(self) -> None:
443
455
expected_metadata ,
444
456
None ,
445
457
)
458
+ mock_metrics_incr .assert_called_with (
459
+ "grouping.similarity.hybrid_fingerprint_seer_result_check" ,
460
+ sample_rate = options .get ("seer.similarity.metrics_sample_rate" ),
461
+ tags = {"platform" : "python" , "result" : "no_fingerprint_match" },
462
+ )
446
463
447
- def test_parent_group_found_hybrid_fingerprint_on_new_event_only (self ) -> None :
464
+ @patch ("sentry.grouping.ingest.seer.metrics.incr" )
465
+ def test_parent_group_found_hybrid_fingerprint_on_new_event_only (
466
+ self , mock_metrics_incr : MagicMock
467
+ ) -> None :
448
468
existing_event = save_new_event (
449
469
{"message" : "Dogs are great!" },
450
470
self .project ,
@@ -475,8 +495,16 @@ def test_parent_group_found_hybrid_fingerprint_on_new_event_only(self) -> None:
475
495
expected_metadata ,
476
496
None ,
477
497
)
498
+ mock_metrics_incr .assert_called_with (
499
+ "grouping.similarity.hybrid_fingerprint_seer_result_check" ,
500
+ sample_rate = options .get ("seer.similarity.metrics_sample_rate" ),
501
+ tags = {"platform" : "python" , "result" : "only_event_hybrid" },
502
+ )
478
503
479
- def test_parent_group_found_hybrid_fingerprint_on_existing_event_only (self ) -> None :
504
+ @patch ("sentry.grouping.ingest.seer.metrics.incr" )
505
+ def test_parent_group_found_hybrid_fingerprint_on_existing_event_only (
506
+ self , mock_metrics_incr : MagicMock
507
+ ) -> None :
480
508
existing_event = save_new_event (
481
509
{"message" : "Dogs are great!" , "fingerprint" : ["{{ default }}" , "maisey" ]},
482
510
self .project ,
@@ -505,8 +533,16 @@ def test_parent_group_found_hybrid_fingerprint_on_existing_event_only(self) -> N
505
533
expected_metadata ,
506
534
None ,
507
535
)
536
+ mock_metrics_incr .assert_called_with (
537
+ "grouping.similarity.hybrid_fingerprint_seer_result_check" ,
538
+ sample_rate = options .get ("seer.similarity.metrics_sample_rate" ),
539
+ tags = {"platform" : "python" , "result" : "only_parent_hybrid" },
540
+ )
508
541
509
- def test_parent_group_found_hybrid_fingerprint_no_metadata (self ) -> None :
542
+ @patch ("sentry.grouping.ingest.seer.metrics.incr" )
543
+ def test_parent_group_found_hybrid_fingerprint_no_metadata (
544
+ self , mock_metrics_incr : MagicMock
545
+ ) -> None :
510
546
"""
511
547
Test that even when there's a match, no result will be returned if the matched hash has
512
548
no metadata.
@@ -550,6 +586,11 @@ def test_parent_group_found_hybrid_fingerprint_no_metadata(self) -> None:
550
586
expected_metadata ,
551
587
None ,
552
588
)
589
+ mock_metrics_incr .assert_called_with (
590
+ "grouping.similarity.hybrid_fingerprint_seer_result_check" ,
591
+ sample_rate = options .get ("seer.similarity.metrics_sample_rate" ),
592
+ tags = {"platform" : "python" , "result" : "no_parent_metadata" },
593
+ )
553
594
554
595
def test_no_parent_group_found (self ) -> None :
555
596
new_event , new_variants , new_grouphash , _ = self .create_new_event ()
@@ -621,7 +662,8 @@ def test_simple(self, mock_get_similarity_data: MagicMock) -> None:
621
662
"k" : 1 ,
622
663
"referrer" : "ingest" ,
623
664
"use_reranking" : True ,
624
- }
665
+ },
666
+ {"hybrid_fingerprint" : False },
625
667
)
626
668
627
669
@patch ("sentry.grouping.ingest.seer.record_did_call_seer_metric" )
@@ -742,7 +784,8 @@ def test_too_many_frames_bypassed_platform(self, mock_get_similarity_data: Magic
742
784
"k" : 1 ,
743
785
"referrer" : "ingest" ,
744
786
"use_reranking" : True ,
745
- }
787
+ },
788
+ {"hybrid_fingerprint" : False },
746
789
)
747
790
748
791
0 commit comments