fix(fastapi): utilize PROMETHEUS_MULTIPROC_DIR in our own /metrics

Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
Kevin Morris 2021-11-01 13:17:24 -07:00
parent 1be4ac2fde
commit dc397f6bd8
No known key found for this signature in database
GPG key ID: F7E46DED420788F3
3 changed files with 34 additions and 3 deletions

View file

@ -117,3 +117,10 @@ def test_get_successes():
"""
successes = get_successes(html)
assert successes[0].text.strip() == "Test"
def test_metrics(client: TestClient):
with client as request:
resp = request.get("/metrics")
assert resp.status_code == int(HTTPStatus.OK)
assert resp.headers.get("Content-Type").startswith("text/plain")