Expose prometheus metrics for all apps
This commit is contained in:
parent
e13a05cb43
commit
0f02181e33
@ -13,3 +13,4 @@ httpx
|
|||||||
pydantic-settings
|
pydantic-settings
|
||||||
python-jose
|
python-jose
|
||||||
passlib[bcrypt]
|
passlib[bcrypt]
|
||||||
|
prometheus_fastapi_instrumentator==7.0.2
|
||||||
|
|||||||
@ -11,6 +11,7 @@ from webapi.providers import database
|
|||||||
from webapi.providers import exception_handler
|
from webapi.providers import exception_handler
|
||||||
from .freeleaps_app import FreeleapsApp
|
from .freeleaps_app import FreeleapsApp
|
||||||
|
|
||||||
|
from prometheus_fastapi_instrumentator import Instrumentator
|
||||||
|
|
||||||
def create_app() -> FastAPI:
|
def create_app() -> FastAPI:
|
||||||
logging.info("App initializing")
|
logging.info("App initializing")
|
||||||
@ -26,6 +27,8 @@ def create_app() -> FastAPI:
|
|||||||
|
|
||||||
# Call the custom_openapi function to change the OpenAPI version
|
# Call the custom_openapi function to change the OpenAPI version
|
||||||
customize_openapi_security(app)
|
customize_openapi_security(app)
|
||||||
|
# expose prometheus metrics
|
||||||
|
Instrumentator().instrument(app).expose(app)
|
||||||
return app
|
return app
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -13,3 +13,4 @@ python-jose
|
|||||||
azure-storage-blob==12.22.0
|
azure-storage-blob==12.22.0
|
||||||
azure-identity
|
azure-identity
|
||||||
azure-core[aio]
|
azure-core[aio]
|
||||||
|
prometheus_fastapi_instrumentator==7.0.2
|
||||||
|
|||||||
@ -10,6 +10,8 @@ from webapi.providers import scheduler
|
|||||||
from webapi.providers import exception_handler
|
from webapi.providers import exception_handler
|
||||||
from .freeleaps_app import FreeleapsApp
|
from .freeleaps_app import FreeleapsApp
|
||||||
|
|
||||||
|
from prometheus_fastapi_instrumentator import Instrumentator
|
||||||
|
|
||||||
|
|
||||||
def create_app() -> FastAPI:
|
def create_app() -> FastAPI:
|
||||||
logging.info("App initializing")
|
logging.info("App initializing")
|
||||||
@ -25,6 +27,8 @@ def create_app() -> FastAPI:
|
|||||||
|
|
||||||
# Call the custom_openapi function to change the OpenAPI version
|
# Call the custom_openapi function to change the OpenAPI version
|
||||||
customize_openapi_security(app)
|
customize_openapi_security(app)
|
||||||
|
# expose prometheus metrics
|
||||||
|
Instrumentator().instrument(app).expose(app)
|
||||||
return app
|
return app
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -31,3 +31,4 @@ azure-identity
|
|||||||
azure-core[aio]
|
azure-core[aio]
|
||||||
sendgrid
|
sendgrid
|
||||||
httpx
|
httpx
|
||||||
|
prometheus_fastapi_instrumentator==7.0.2
|
||||||
|
|||||||
@ -11,6 +11,7 @@ from webapi.providers import scheduler
|
|||||||
from webapi.providers import exception_handler
|
from webapi.providers import exception_handler
|
||||||
from .freeleaps_app import FreeleapsApp
|
from .freeleaps_app import FreeleapsApp
|
||||||
|
|
||||||
|
from prometheus_fastapi_instrumentator import Instrumentator
|
||||||
|
|
||||||
def create_app() -> FastAPI:
|
def create_app() -> FastAPI:
|
||||||
logging.info("App initializing")
|
logging.info("App initializing")
|
||||||
@ -26,6 +27,8 @@ def create_app() -> FastAPI:
|
|||||||
|
|
||||||
# Call the custom_openapi function to change the OpenAPI version
|
# Call the custom_openapi function to change the OpenAPI version
|
||||||
customize_openapi_security(app)
|
customize_openapi_security(app)
|
||||||
|
# expose prometheus metrics
|
||||||
|
Instrumentator().instrument(app).expose(app)
|
||||||
return app
|
return app
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -12,3 +12,4 @@ twilio
|
|||||||
pydantic-settings
|
pydantic-settings
|
||||||
python-multipart
|
python-multipart
|
||||||
python-jose
|
python-jose
|
||||||
|
prometheus_fastapi_instrumentator==7.0.2
|
||||||
|
|||||||
@ -11,6 +11,7 @@ from webapi.providers import message_queue
|
|||||||
from webapi.providers import exception_handler
|
from webapi.providers import exception_handler
|
||||||
from .freeleaps_app import FreeleapsApp
|
from .freeleaps_app import FreeleapsApp
|
||||||
|
|
||||||
|
from prometheus_fastapi_instrumentator import Instrumentator
|
||||||
|
|
||||||
def create_app() -> FastAPI:
|
def create_app() -> FastAPI:
|
||||||
logging.info("App initializing")
|
logging.info("App initializing")
|
||||||
@ -27,6 +28,8 @@ def create_app() -> FastAPI:
|
|||||||
|
|
||||||
# Call the custom_openapi function to change the OpenAPI version
|
# Call the custom_openapi function to change the OpenAPI version
|
||||||
customize_openapi_security(app)
|
customize_openapi_security(app)
|
||||||
|
# expose prometheus metrics
|
||||||
|
Instrumentator().instrument(app).expose(app)
|
||||||
return app
|
return app
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user