diff --git a/apps/authentication/requirements.txt b/apps/authentication/requirements.txt index 1105c5e..77456b6 100644 --- a/apps/authentication/requirements.txt +++ b/apps/authentication/requirements.txt @@ -12,4 +12,5 @@ aio-pika httpx pydantic-settings python-jose -passlib[bcrypt] \ No newline at end of file +passlib[bcrypt] +prometheus_fastapi_instrumentator==7.0.2 diff --git a/apps/authentication/webapi/bootstrap/application.py b/apps/authentication/webapi/bootstrap/application.py index e060fbf..1f9568f 100644 --- a/apps/authentication/webapi/bootstrap/application.py +++ b/apps/authentication/webapi/bootstrap/application.py @@ -11,6 +11,7 @@ from webapi.providers import database from webapi.providers import exception_handler from .freeleaps_app import FreeleapsApp +from prometheus_fastapi_instrumentator import Instrumentator def create_app() -> FastAPI: logging.info("App initializing") @@ -26,6 +27,8 @@ def create_app() -> FastAPI: # Call the custom_openapi function to change the OpenAPI version customize_openapi_security(app) + # expose prometheus metrics + Instrumentator().instrument(app).expose(app) return app diff --git a/apps/central_storage/requirements.txt b/apps/central_storage/requirements.txt index 2b9f8cc..a157f90 100644 --- a/apps/central_storage/requirements.txt +++ b/apps/central_storage/requirements.txt @@ -12,4 +12,5 @@ python-multipart python-jose azure-storage-blob==12.22.0 azure-identity -azure-core[aio] \ No newline at end of file +azure-core[aio] +prometheus_fastapi_instrumentator==7.0.2 diff --git a/apps/central_storage/webapi/bootstrap/application.py b/apps/central_storage/webapi/bootstrap/application.py index 8d0844d..4520aad 100644 --- a/apps/central_storage/webapi/bootstrap/application.py +++ b/apps/central_storage/webapi/bootstrap/application.py @@ -10,6 +10,8 @@ from webapi.providers import scheduler from webapi.providers import exception_handler from .freeleaps_app import FreeleapsApp +from prometheus_fastapi_instrumentator import Instrumentator + def create_app() -> FastAPI: logging.info("App initializing") @@ -25,6 +27,8 @@ def create_app() -> FastAPI: # Call the custom_openapi function to change the OpenAPI version customize_openapi_security(app) + # expose prometheus metrics + Instrumentator().instrument(app).expose(app) return app diff --git a/apps/content/requirements.txt b/apps/content/requirements.txt index 1d1525f..80dd460 100644 --- a/apps/content/requirements.txt +++ b/apps/content/requirements.txt @@ -30,4 +30,5 @@ azure-storage-blob[aio] azure-identity azure-core[aio] sendgrid -httpx \ No newline at end of file +httpx +prometheus_fastapi_instrumentator==7.0.2 diff --git a/apps/content/webapi/bootstrap/application.py b/apps/content/webapi/bootstrap/application.py index 7d0b26d..418d081 100644 --- a/apps/content/webapi/bootstrap/application.py +++ b/apps/content/webapi/bootstrap/application.py @@ -11,6 +11,7 @@ from webapi.providers import scheduler from webapi.providers import exception_handler from .freeleaps_app import FreeleapsApp +from prometheus_fastapi_instrumentator import Instrumentator def create_app() -> FastAPI: logging.info("App initializing") @@ -26,6 +27,8 @@ def create_app() -> FastAPI: # Call the custom_openapi function to change the OpenAPI version customize_openapi_security(app) + # expose prometheus metrics + Instrumentator().instrument(app).expose(app) return app diff --git a/apps/notification/requirements.txt b/apps/notification/requirements.txt index 36afe9a..46541c2 100644 --- a/apps/notification/requirements.txt +++ b/apps/notification/requirements.txt @@ -11,4 +11,5 @@ aio-pika twilio pydantic-settings python-multipart -python-jose \ No newline at end of file +python-jose +prometheus_fastapi_instrumentator==7.0.2 diff --git a/apps/notification/webapi/bootstrap/application.py b/apps/notification/webapi/bootstrap/application.py index 718c166..bdd788d 100644 --- a/apps/notification/webapi/bootstrap/application.py +++ b/apps/notification/webapi/bootstrap/application.py @@ -11,6 +11,7 @@ from webapi.providers import message_queue from webapi.providers import exception_handler from .freeleaps_app import FreeleapsApp +from prometheus_fastapi_instrumentator import Instrumentator def create_app() -> FastAPI: logging.info("App initializing") @@ -27,6 +28,8 @@ def create_app() -> FastAPI: # Call the custom_openapi function to change the OpenAPI version customize_openapi_security(app) + # expose prometheus metrics + Instrumentator().instrument(app).expose(app) return app