services are checked

This commit is contained in:
2024-11-08 17:14:02 +03:00
parent a5b1e0b2f4
commit c5b771e5cb
82 changed files with 1720 additions and 869 deletions

View File

@@ -12,6 +12,7 @@ from handlers_exception import (
from prometheus_fastapi_instrumentator import Instrumentator
from prometheus_client import Counter, Histogram
from service_app.app_runner_init import create_endpoints_from_api_functions
app = create_app()
Instrumentator().instrument(app=app).expose(app=app)
@@ -23,12 +24,13 @@ app.add_middleware(
"allow_credentials": True,
"allow_methods": ["*"],
"allow_headers": ["*"],
}
},
)
app.add_middleware(AuthHeaderMiddleware)
app.add_exception_handler(HTTPException, exception_handler_http)
app.add_exception_handler(Exception, exception_handler_exception)
create_endpoints_from_api_functions(api_app=app)
# # Define a counter metric
# REQUESTS_COUNT = Counter(