16 lines
501 B
Python
16 lines
501 B
Python
import logging
|
|
from prometheus_fastapi_instrumentator import Instrumentator
|
|
from common.config.app_settings import app_settings
|
|
|
|
def register(app):
|
|
instrumentator = (
|
|
Instrumentator().instrument(
|
|
app,
|
|
metric_namespace="freeleaps-auth",
|
|
metric_subsystem=app_settings.APP_NAME)
|
|
)
|
|
|
|
@app.on_event("startup")
|
|
async def startup():
|
|
instrumentator.expose(app, endpoint="/api/_/metrics", should_gzip=True)
|
|
logging.info("Metrics endpoint exposed at /api/_/metrics") |