Skip to content
This repository has been archived by the owner on Jul 11, 2022. It is now read-only.

Commit

Permalink
Update prometheus_client to 0.11.0 (#327)
Browse files Browse the repository at this point in the history
The tests must be adapeted due prometheus/client_python#300

Signed-off-by: Kai Mueller <[email protected]>
  • Loading branch information
kasium authored Sep 7, 2021
1 parent a03ea5e commit f3b51b9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
'codecov',
'tchannel==2.1.0',
'opentracing_instrumentation>=3,<4',
'prometheus_client==0.3.1',
'prometheus_client==0.11.0',
'mypy',
]
},
Expand Down
10 changes: 6 additions & 4 deletions tests/test_prometheus.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def test_prometheus_metrics_counter():
counter2 = metrics.create_counter(name='jaeger:test_counter',
tags={'result': 'ok'})
counter2(1)
after = REGISTRY.get_sample_value('test_jaeger:test_counter',
after = REGISTRY.get_sample_value('test_jaeger:test_counter_total',
{'result': 'ok'})
assert 2 == after

Expand All @@ -34,7 +34,7 @@ def test_prometheus_metrics_counter_without_tags():
metrics = PrometheusMetricsFactory()
counter = metrics.create_counter(name='jaeger:test_counter_no_tags')
counter(1)
after = REGISTRY.get_sample_value('jaeger:test_counter_no_tags')
after = REGISTRY.get_sample_value('jaeger:test_counter_no_tags_total')
assert 1 == after


Expand Down Expand Up @@ -65,7 +65,7 @@ def test_prometheus_metrics_metric_with_service_name_label():
counter = metrics.create_counter(name='jaeger:test_counter_with_service_name_label',
tags={'x': 'y'})
counter(1)
counter_after = REGISTRY.get_sample_value('jaeger:test_counter_with_service_name_label',
counter_after = REGISTRY.get_sample_value('jaeger:test_counter_with_service_name_label_total',
{'service': 'test', 'x': 'y'})
assert 1 == counter_after
assert 1 == gauge_after
Expand All @@ -78,6 +78,8 @@ def test_prometheus_metrics_metric_without_service_name_label():
gauge_after = REGISTRY.get_sample_value('jaeger:test_gauge_without_service_name_label')
counter = metrics.create_counter(name='jaeger:test_counter_without_service_name_label')
counter(1)
counter_after = REGISTRY.get_sample_value('jaeger:test_counter_without_service_name_label')
counter_after = REGISTRY.get_sample_value(
'jaeger:test_counter_without_service_name_label_total'
)
assert 1 == counter_after
assert 1 == gauge_after

0 comments on commit f3b51b9

Please sign in to comment.