Initial commit from Martins Github
This commit is contained in:
16
app/routers/actions.py
Normal file
16
app/routers/actions.py
Normal file
@@ -0,0 +1,16 @@
|
||||
from fastapi import APIRouter
|
||||
from app.services import log_analyzer
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
|
||||
@router.get("/actions")
|
||||
async def get_actions():
|
||||
"""Return current action analysis: categorised issues from logs + Prometheus + Alertmanager."""
|
||||
return await log_analyzer.analyze_logs()
|
||||
|
||||
|
||||
@router.get("/actions/history")
|
||||
async def get_actions_history():
|
||||
"""Return the in-memory history ring-buffer for the time-series chart."""
|
||||
return {"history": log_analyzer.get_history()}
|
||||
Reference in New Issue
Block a user