diff --git a/tests/plugins/test_prometheus.py b/tests/plugins/test_prometheus.py index a460980e8..438728370 100644 --- a/tests/plugins/test_prometheus.py +++ b/tests/plugins/test_prometheus.py @@ -141,3 +141,19 @@ def test_count_with_legacy_string_basic_group(self): resp = self.app.get("/__metrics__") self.assertIn('kintoprod_mushrooms_total{species="boletus"} 1.0', resp.text) + + +@skip_if_no_prometheus +class PrometheusNoPrefixTest(PrometheusWebTest): + @classmethod + def get_app_settings(cls, extras=None): + settings = super().get_app_settings(extras) + settings["project_name"] = "Some Project" + settings["prometheus_prefix"] = "" + return settings + + def test_metrics_have_no_prefix(self): + self.app.app.registry.metrics.observe("price", 111) + + resp = self.app.get("/__metrics__") + self.assertIn("TYPE price summary", resp.text)