mirror of
https://github.com/flibusta-apps/users_settings_server.git
synced 2025-12-06 06:35:39 +01:00
Add metrics and refactor healthcheck
This commit is contained in:
@@ -74,9 +74,7 @@ async def create_language(data: CreateLanguage):
|
||||
return await Language.objects.create(**data.dict())
|
||||
|
||||
|
||||
healthcheck_router = APIRouter(
|
||||
tags=["healthcheck"], dependencies=[Depends(check_token)]
|
||||
)
|
||||
healthcheck_router = APIRouter(tags=["healthcheck"])
|
||||
|
||||
|
||||
@healthcheck_router.get("/healthcheck")
|
||||
|
||||
@@ -2,6 +2,7 @@ from fastapi import FastAPI
|
||||
|
||||
import aioredis
|
||||
from fastapi_pagination import add_pagination
|
||||
from prometheus_fastapi_instrumentator import Instrumentator
|
||||
|
||||
from app.views import users_router, languages_router, healthcheck_router
|
||||
from core.config import env_config
|
||||
@@ -38,4 +39,6 @@ def start_app() -> FastAPI:
|
||||
if database_.is_connected:
|
||||
await database_.disconnect()
|
||||
|
||||
Instrumentator().instrument(app).expose(app, include_in_schema=True)
|
||||
|
||||
return app
|
||||
|
||||
Reference in New Issue
Block a user