Files
blog/content/posts/commits/2026-07-21-commit-3217f0b.md
grafana-watcher a3a7490342
Some checks failed
Hugo Build & Deploy / build-deploy (push) Failing after 1m6s
post: commit 3217f0b in bojemoi
2026-07-21 20:23:47 +02:00

1.7 KiB

title, date, draft, tags, categories, summary, author
title date draft tags categories summary author
[bojemoi] feat(alert-agent): intégration Claude API (Haiku) comme backend LLM principal 2026-07-21T20:23:41+02:00 false
commit
bojemoi
main
Git Activity
Commit 3217f0b par grafana-watcher dans bojemoi grafana-watcher

Commit 3217f0b

Repository bojemoi
Branch main
Author grafana-watcher
Hash 3217f0b22abb1c42444282a068e544257b0dc725

Description

Remplace Ollama (trop lent) par Claude API (Anthropic). Le backend est sélectionnable via LLM_BACKEND: claude/kimi/ollama. Le LLM évalue désormais la sévérité réelle de l'alerte (critical/high/medium/low/info) indépendamment du label Prometheus.

  • llm.py: ajout _call_claude + _extract_json pour parser la réponse
  • config.py: claude_api_key (secret), claude_model, llm_backend=claude
  • requirements.txt: anthropic>=0.40
  • alerter.py: emoji selon sévérité LLM (🔴🟠🟡🔵)
  • webhook.py: sévérité Telegram = decision["severity"] (LLM) > label Prometheus
  • stack: LLM_BACKEND=claude, secret claude_api_key monté

Co-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com

Files Changed

M	alert-agent/alert_agent/__main__.py
M	alert-agent/alert_agent/config.py
M	alert-agent/alert_agent/llm.py
M	alert-agent/requirements.txt
M	stack/48-service-alert-agent.yml

Diff Summary

 alert-agent/alert_agent/__main__.py |  2 +-
 alert-agent/alert_agent/config.py   | 11 +++++++--
 alert-agent/alert_agent/llm.py      | 48 +++++++++++++++++++++++++++++++++----
 alert-agent/requirements.txt        |  1 +
 stack/48-service-alert-agent.yml    |  6 ++++-
 5 files changed, 59 insertions(+), 9 deletions(-)