From: David Galloway Date: Fri, 27 Mar 2026 15:32:08 +0000 (-0400) Subject: mgr/rook: fix prometheus federation selector to avoid unencoded '!' X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2487e7e746d9119e1c0b6109d270eab975e0387f;p=ceph.git mgr/rook: fix prometheus federation selector to avoid unencoded '!' The Python requests library leaves '!' unencoded in URLs, causing prometheus to return a parse error instead of metrics when using the != operator in the federation match selector. Use =~ instead. Signed-off-by: David Galloway --- diff --git a/src/pybind/mgr/rook/ci/tests/features/steps/implementation.py b/src/pybind/mgr/rook/ci/tests/features/steps/implementation.py index 59cb117c8b1e..5a5b3a77174a 100644 --- a/src/pybind/mgr/rook/ci/tests/features/steps/implementation.py +++ b/src/pybind/mgr/rook/ci/tests/features/steps/implementation.py @@ -53,7 +53,7 @@ def step_get_prometheus_server_ip(context): @given('the prometheus server is serving metrics') def step_given_server_running(context): try: - params = {'match[]': '{__name__!=""}'} + params = {'match[]': '{__name__=~".+"}'} response = requests.get(f"{PROMETHEUS_SERVER_URL}/federate", params) # Check if the response status code is successful (2xx) response.raise_for_status() @@ -66,7 +66,7 @@ def step_given_server_running(context): @when('I query the Prometheus metrics endpoint') def step_when_query_metrics_endpoint(context): - params = {'match[]': '{__name__!=""}'} + params = {'match[]': '{__name__=~".+"}'} context.response = requests.get(f"{PROMETHEUS_SERVER_URL}/federate", params) context.response.raise_for_status()