fix: приглушить httpcore/httpx DEBUG в логах; INFO при успешном сохранении алерта
All checks were successful
CI / test (push) Successful in 39s
All checks were successful
CI / test (push) Successful in 39s
- httpcore, httpx, asyncio, uvicorn.access → WARNING (убирает TCP-шум из /ui/logs) - После успешного INSERT irm_alerts: INFO с alert_id, title, sev, team - Теперь в /ui/logs видно: пришёл вебхук → сохранено (id=...) или ERROR Made-with: Cursor
This commit is contained in:
@ -198,6 +198,13 @@ async def _grafana_webhook_impl(
|
|||||||
fp_row,
|
fp_row,
|
||||||
team_id,
|
team_id,
|
||||||
)
|
)
|
||||||
|
logger.info(
|
||||||
|
"grafana webhook saved: alert_id=%s title=%r sev=%s team=%s",
|
||||||
|
raw_id,
|
||||||
|
(title_row or "—")[:80],
|
||||||
|
sev_row,
|
||||||
|
str(team_id) if team_id else "—",
|
||||||
|
)
|
||||||
bus = getattr(request.app.state, "event_bus", None)
|
bus = getattr(request.app.state, "event_bus", None)
|
||||||
if bus and raw_id is not None:
|
if bus and raw_id is not None:
|
||||||
title = str(body.get("title") or body.get("ruleName") or "")[:500]
|
title = str(body.get("title") or body.get("ruleName") or "")[:500]
|
||||||
|
|||||||
@ -18,9 +18,15 @@ from onguard24.status_snapshot import build as build_status
|
|||||||
from onguard24.ui_logs import router as logs_router
|
from onguard24.ui_logs import router as logs_router
|
||||||
|
|
||||||
logging.basicConfig(level=logging.DEBUG)
|
logging.basicConfig(level=logging.DEBUG)
|
||||||
logging.getLogger("httpx").setLevel(logging.WARNING)
|
# Приглушаем шумные низкоуровневые библиотеки
|
||||||
logging.getLogger("asyncio").setLevel(logging.WARNING)
|
for _noisy in (
|
||||||
logging.getLogger("uvicorn.access").setLevel(logging.WARNING)
|
"httpx",
|
||||||
|
"httpcore",
|
||||||
|
"asyncio",
|
||||||
|
"uvicorn.access",
|
||||||
|
"uvicorn.error",
|
||||||
|
):
|
||||||
|
logging.getLogger(_noisy).setLevel(logging.WARNING)
|
||||||
log = logging.getLogger("onguard24")
|
log = logging.getLogger("onguard24")
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user