Files
backend-api/src/metrics_server.py
T
florian cda16476a4 Feature/windows notifications (#9)
Reviewed-on: #9
- Added pulling notifications from new backend service backend-pull-notifications
- Added Ruff Linting

Co-authored-by: Florian <flo@meergans.org>
2026-10-13 08:14:52 +00:00

11 lines
430 B
Python

from fastapi import FastAPI, Response
from prometheus_client import CONTENT_TYPE_LATEST, Counter, generate_latest
metrics_api = FastAPI(title="Metrics Server", description="Prometheus metrics endpoint")
REQUEST_COUNTER = Counter("http_requests_total", "Total HTTP Requests", ["method", "endpoint", "status"])
@metrics_api.get("/metrics")
async def metrics():
return Response(generate_latest(), media_type=CONTENT_TYPE_LATEST)