Skip to content

Commit 22f98f9

Browse files
brettimusBrett Beutell
authored andcommitted
Fix test_non_monotonic_sum_to_prometheus after changes from #3279
1 parent baa1e61 commit 22f98f9

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

exporter/opentelemetry-exporter-prometheus/tests/test_prometheus_exporter.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ def test_histogram_to_prometheus(self):
128128
def test_monotonic_sum_to_prometheus(self):
129129
labels = {"environment@": "staging", "os": "Windows"}
130130
metric = _generate_sum(
131-
"test@sum",
131+
"test@sum_monotonic",
132132
123,
133133
attributes=labels,
134134
description="testdesc",
@@ -156,7 +156,9 @@ def test_monotonic_sum_to_prometheus(self):
156156

157157
for prometheus_metric in collector.collect():
158158
self.assertEqual(type(prometheus_metric), CounterMetricFamily)
159-
self.assertEqual(prometheus_metric.name, "test_sum_testunit")
159+
self.assertEqual(
160+
prometheus_metric.name, "test_sum_monotonic_testunit"
161+
)
160162
self.assertEqual(prometheus_metric.documentation, "testdesc")
161163
self.assertTrue(len(prometheus_metric.samples) == 1)
162164
self.assertEqual(prometheus_metric.samples[0].value, 123)
@@ -171,7 +173,7 @@ def test_monotonic_sum_to_prometheus(self):
171173
def test_non_monotonic_sum_to_prometheus(self):
172174
labels = {"environment@": "staging", "os": "Windows"}
173175
metric = _generate_sum(
174-
"test@sum",
176+
"test@sum_nonmonotonic",
175177
123,
176178
attributes=labels,
177179
description="testdesc",
@@ -195,12 +197,14 @@ def test_non_monotonic_sum_to_prometheus(self):
195197
]
196198
)
197199

198-
collector = _CustomCollector()
200+
collector = _CustomCollector(disable_target_info=True)
199201
collector.add_metrics_data(metrics_data)
200202

201203
for prometheus_metric in collector.collect():
202204
self.assertEqual(type(prometheus_metric), GaugeMetricFamily)
203-
self.assertEqual(prometheus_metric.name, "test_sum_testunit")
205+
self.assertEqual(
206+
prometheus_metric.name, "test_sum_nonmonotonic_testunit"
207+
)
204208
self.assertEqual(prometheus_metric.documentation, "testdesc")
205209
self.assertTrue(len(prometheus_metric.samples) == 1)
206210
self.assertEqual(prometheus_metric.samples[0].value, 123)

0 commit comments

Comments
 (0)