feat: enable metrics
This commit is contained in:
parent
459e56c7bf
commit
afb90e55e6
@ -1,15 +1,14 @@
|
|||||||
import logging
|
import logging
|
||||||
from prometheus_fastapi_instrumentator import Instrumentator
|
from prometheus_fastapi_instrumentator import Instrumentator
|
||||||
|
|
||||||
from common.config.site_settings import site_settings
|
|
||||||
|
|
||||||
|
|
||||||
def register(app):
|
def register(app):
|
||||||
|
# Prometheus metric prefix is : freeleaps_metrics
|
||||||
instrumentator = (
|
instrumentator = (
|
||||||
Instrumentator().instrument(
|
Instrumentator().instrument(
|
||||||
app,
|
app,
|
||||||
metric_namespace="freeleaps-mertics",
|
metric_namespace="freeleaps",
|
||||||
metric_subsystem=site_settings.NAME)
|
metric_subsystem="metrics", )
|
||||||
)
|
)
|
||||||
|
|
||||||
@app.on_event("startup")
|
@app.on_event("startup")
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user