Reviewed-on: #9 - Added pulling notifications from new backend service backend-pull-notifications - Added Ruff Linting Co-authored-by: Florian <flo@meergans.org>
11 lines
430 B
Python
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)
|