6868 "jvm.cpu.count" ,
6969 "jvm.cpu.recent_utilization" ,
7070 "jvm.cpu.time" ,
71- "jvm.file_descriptor.count" ,
72- "jvm.file_descriptor.limit" ,
7371 "jvm.memory.committed" ,
7472 "jvm.memory.init" ,
7573 "jvm.memory.limit" ,
7674 "jvm.memory.used" ,
7775 "jvm.memory.used_after_last_gc" ,
78- "jvm.system.cpu.utilization" ,
7976 "jvm.thread.count" ,
8077 ],
8178}
@@ -106,10 +103,10 @@ def get_runtime_metric_names():
106103class Test_OtlpRuntimeMetrics :
107104 """Verify runtime metrics are sent via OTLP with OTel names, not DD-proprietary names."""
108105
109- def setup_main (self ):
106+ def setup_otel_metrics_are_present (self ):
110107 self .req = weblog .get ("/" )
111108
112- def test_main (self ):
109+ def test_otel_metrics_are_present (self ):
113110 assert self .req .status_code == 200
114111
115112 library = context .library .name
@@ -118,18 +115,27 @@ def test_main(self):
118115
119116 metric_names = get_runtime_metric_names ()
120117
121- # All expected OTel-named metrics must be present
122118 expected = EXPECTED_METRICS [library ]
123119 for expected_name in expected :
124120 assert expected_name in metric_names , (
125121 f"Expected OTel runtime metric '{ expected_name } ' not found for { library } . "
126122 f"Got metrics: { sorted (metric_names )} "
127123 )
128124
129- # DD-proprietary names must NOT be present
125+ def setup_dd_metrics_are_absent (self ):
126+ self .req = weblog .get ("/" )
127+
128+ def test_dd_metrics_are_absent (self ):
129+ assert self .req .status_code == 200
130+
131+ library = context .library .name
130132 dd_prefix = DD_PROPRIETARY_PREFIXES .get (library )
131- if dd_prefix :
132- dd_named_metrics = [n for n in metric_names if n .startswith (dd_prefix )]
133- assert len (dd_named_metrics ) == 0 , (
134- f"Found DD-proprietary metric names for { library } : { dd_named_metrics } . Expected OTel-native names only."
135- )
133+ if not dd_prefix :
134+ return
135+
136+ metric_names = get_runtime_metric_names ()
137+
138+ dd_named_metrics = [n for n in metric_names if n .startswith (dd_prefix )]
139+ assert len (dd_named_metrics ) == 0 , (
140+ f"Found DD-proprietary metric names for { library } : { dd_named_metrics } . Expected OTel-native names only."
141+ )
0 commit comments