Add metrics and healthcheck refactor

This commit is contained in:
2022-02-12 14:11:11 +03:00
parent 861b197981
commit 5a1ff6474f
5 changed files with 39 additions and 10 deletions

View File

@@ -67,9 +67,7 @@ async def delete_file(file_id: int):
return uploaded_file
healthcheck_router = APIRouter(
prefix="/api/v1", dependencies=[Depends(check_token)], tags=["healthcheck"]
)
healthcheck_router = APIRouter(tags=["healthcheck"])
@healthcheck_router.get("/healthcheck")

View File

@@ -1,5 +1,7 @@
from fastapi import FastAPI
from prometheus_fastapi_instrumentator import Instrumentator
from app.on_start import on_start
from app.views import router, healthcheck_router
from core.db import database
@@ -27,4 +29,6 @@ def start_app() -> FastAPI:
if database_.is_connected:
await database_.disconnect()
Instrumentator().instrument(app).expose(app, include_in_schema=True)
return app