@@ -700,8 +700,8 @@ def should_summarize_metric(key, tags):
700700 with start_transaction (
701701 op = "stuff" , name = "/foo" , source = TRANSACTION_SOURCE_ROUTE
702702 ) as transaction :
703- metrics .timing ("foo" , value = 1 .0 , tags = {"a" : "b" }, timestamp = ts )
704- metrics .timing ("foo" , value = 1 .0 , tags = {"b" : "c" }, timestamp = ts )
703+ metrics .timing ("foo" , value = 3 .0 , tags = {"a" : "b" }, timestamp = ts )
704+ metrics .timing ("foo" , value = 2 .0 , tags = {"b" : "c" }, timestamp = ts )
705705 metrics .timing ("bar" , value = 1.0 , tags = {"a" : "b" }, timestamp = ts )
706706
707707 Hub .current .flush ()
@@ -719,34 +719,31 @@ def should_summarize_metric(key, tags):
719719
720720 # Measurement Attachment
721721 t = transaction .items [0 ].get_transaction_event ()["_metrics_summary" ]
722- assert t == {
723- "d:foo@second" : [
724- {
725- "tags" : {
726- "a" : "b" ,
727- "environment" : "not-fun-env" ,
728- "release" : "fun-release@1.0.0" ,
729- "transaction" : "/foo" ,
730- },
731- "min" : 1.0 ,
732- "max" : 1.0 ,
733- "count" : 1 ,
734- "sum" : 1.0 ,
735- },
736- {
737- "tags" : {
738- "b" : "c" ,
739- "environment" : "not-fun-env" ,
740- "release" : "fun-release@1.0.0" ,
741- "transaction" : "/foo" ,
742- },
743- "min" : 1.0 ,
744- "max" : 1.0 ,
745- "count" : 1 ,
746- "sum" : 1.0 ,
747- },
748- ]
749- }
722+ assert len (t ["d:foo@second" ]) == 2
723+ assert {
724+ "tags" : {
725+ "a" : "b" ,
726+ "environment" : "not-fun-env" ,
727+ "release" : "fun-release@1.0.0" ,
728+ "transaction" : "/foo" ,
729+ },
730+ "min" : 3.0 ,
731+ "max" : 3.0 ,
732+ "count" : 1 ,
733+ "sum" : 3.0 ,
734+ } in t ["d:foo@second" ]
735+ assert {
736+ "tags" : {
737+ "b" : "c" ,
738+ "environment" : "not-fun-env" ,
739+ "release" : "fun-release@1.0.0" ,
740+ "transaction" : "/foo" ,
741+ },
742+ "min" : 2.0 ,
743+ "max" : 2.0 ,
744+ "count" : 1 ,
745+ "sum" : 2.0 ,
746+ } in t ["d:foo@second" ]
750747
751748
752749def test_tag_normalization (sentry_init , capture_envelopes ):
0 commit comments