13 lines
555 B
Python
13 lines
555 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",
|
|
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") |