@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()
@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()