@@ -128,7 +128,7 @@ def test_histogram_to_prometheus(self):
128
128
def test_monotonic_sum_to_prometheus (self ):
129
129
labels = {"environment@" : "staging" , "os" : "Windows" }
130
130
metric = _generate_sum (
131
- "test@sum " ,
131
+ "test@sum_monotonic " ,
132
132
123 ,
133
133
attributes = labels ,
134
134
description = "testdesc" ,
@@ -156,7 +156,9 @@ def test_monotonic_sum_to_prometheus(self):
156
156
157
157
for prometheus_metric in collector .collect ():
158
158
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
+ )
160
162
self .assertEqual (prometheus_metric .documentation , "testdesc" )
161
163
self .assertTrue (len (prometheus_metric .samples ) == 1 )
162
164
self .assertEqual (prometheus_metric .samples [0 ].value , 123 )
@@ -171,7 +173,7 @@ def test_monotonic_sum_to_prometheus(self):
171
173
def test_non_monotonic_sum_to_prometheus (self ):
172
174
labels = {"environment@" : "staging" , "os" : "Windows" }
173
175
metric = _generate_sum (
174
- "test@sum " ,
176
+ "test@sum_nonmonotonic " ,
175
177
123 ,
176
178
attributes = labels ,
177
179
description = "testdesc" ,
@@ -195,12 +197,14 @@ def test_non_monotonic_sum_to_prometheus(self):
195
197
]
196
198
)
197
199
198
- collector = _CustomCollector ()
200
+ collector = _CustomCollector (disable_target_info = True )
199
201
collector .add_metrics_data (metrics_data )
200
202
201
203
for prometheus_metric in collector .collect ():
202
204
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
+ )
204
208
self .assertEqual (prometheus_metric .documentation , "testdesc" )
205
209
self .assertTrue (len (prometheus_metric .samples ) == 1 )
206
210
self .assertEqual (prometheus_metric .samples [0 ].value , 123 )
0 commit comments