Создала .yaml-файлы infra\grafana\provisioning\alerting

This commit is contained in:
vasyukova
2026-10-30 18:22:19 +03:00
parent dc6a7210e4
commit b6a7a85ed3
7 changed files with 149 additions and 8 deletions
+3
View File
@@ -200,6 +200,9 @@ async def db_unavailable_handler(request: Request, exc: psycopg.OperationalError
async def runtime_error_handler(request: Request, exc: RuntimeError):
request_id = getattr(request.state, "request_id", uuid.uuid4().hex)
text = str(exc)
if "db_unavailable" in text:
logger.error("event=db_unavailable request_id=%s", request_id)
return _error_response(503, "Зависимость недоступна", request_id, request.url.path)
if "redis_unavailable" in text:
logger.error("event=redis_unavailable request_id=%s", request_id)
return _error_response(503, "Зависимость недоступна", request_id, request.url.path)