@@ -569,12 +569,21 @@ def setup_main(self):
569
569
def test_main (self ):
570
570
assert self .req .status_code == 200
571
571
572
- runtime_metrics = [
572
+ runtime_metrics_gauges = [
573
573
metric
574
574
for _ , metric in interfaces .agent .get_metrics ()
575
575
if metric ["metric" ].startswith ("runtime." ) or metric ["metric" ].startswith ("jvm." )
576
576
]
577
- assert len (runtime_metrics ) > 0
577
+
578
+ runtime_metrics_sketches = [
579
+ metric
580
+ for _ , metric in interfaces .agent .get_sketches ()
581
+ if metric ["metric" ].startswith ("runtime." ) or metric ["metric" ].startswith ("jvm." )
582
+ ]
583
+
584
+ assert len (runtime_metrics_gauges ) > 0 or len (runtime_metrics_sketches ) > 0
585
+
586
+ runtime_metrics = runtime_metrics_gauges if len (runtime_metrics_gauges ) > 0 else runtime_metrics_sketches
578
587
579
588
for metric in runtime_metrics :
580
589
tags = {tag .split (":" )[0 ]: tag .split (":" )[1 ] for tag in metric ["tags" ]}
@@ -605,12 +614,21 @@ def setup_main(self):
605
614
def test_main (self ):
606
615
assert self .req .status_code == 200
607
616
608
- runtime_metrics = [
617
+ runtime_metrics_gauges = [
609
618
metric
610
619
for _ , metric in interfaces .agent .get_metrics ()
611
620
if metric ["metric" ].startswith ("runtime." ) or metric ["metric" ].startswith ("jvm." )
612
621
]
613
- assert len (runtime_metrics ) > 0
622
+
623
+ runtime_metrics_sketches = [
624
+ metric
625
+ for _ , metric in interfaces .agent .get_sketches ()
626
+ if metric ["metric" ].startswith ("runtime." ) or metric ["metric" ].startswith ("jvm." )
627
+ ]
628
+
629
+ assert len (runtime_metrics_gauges ) > 0 or len (runtime_metrics_sketches ) > 0
630
+
631
+ runtime_metrics = runtime_metrics_gauges if len (runtime_metrics_gauges ) > 0 else runtime_metrics_sketches
614
632
615
633
for metric in runtime_metrics :
616
634
tags = {tag .split (":" )[0 ]: tag .split (":" )[1 ] for tag in metric ["tags" ]}
@@ -633,12 +651,19 @@ def setup_main(self):
633
651
def test_main (self ):
634
652
assert self .req .status_code == 200
635
653
636
- runtime_metrics = [
654
+ runtime_metrics_gauges = [
637
655
metric
638
656
for _ , metric in interfaces .agent .get_metrics ()
639
657
if metric ["metric" ].startswith ("runtime." ) or metric ["metric" ].startswith ("jvm." )
640
658
]
641
- assert len (runtime_metrics ) == 0
659
+
660
+ runtime_metrics_sketches = [
661
+ metric
662
+ for _ , metric in interfaces .agent .get_sketches ()
663
+ if metric ["metric" ].startswith ("runtime." ) or metric ["metric" ].startswith ("jvm." )
664
+ ]
665
+
666
+ assert len (runtime_metrics_gauges ) == 0 and len (runtime_metrics_sketches ) == 0
642
667
643
668
644
669
# Parse the JSON-formatted log message from stdout and return the 'dd' object
0 commit comments