"""Prometheus metrics endpoint."""

from __future__ import annotations


def test_metrics_endpoint_exposes_counters(client):
    client.get("/health")
    resp = client.get("/metrics")
    assert resp.status_code == 200
    body = resp.text
    assert "legate_http_requests_total" in body
    assert "legate_runs_started_total" in body
    # The /health request we just made is recorded by route template.
    assert 'path="/health"' in body
