ADR-001 규칙 엔진 = Grafana Alerting (Alertmanager 미도입)

Status

Accepted (2026-07-03) — PRD Open Q1 해소

Context

P95 레이턴시 임계 위반을 평가해 webhook을 발신할 규칙 엔진이 필요하다. ⑤ 옵저버빌리티 스택이 Prometheus·Loki·Tempo·Grafana를 이미 배포한다. 단일 호스트·개인 프로젝트·8GB 제약.

Decision

Grafana Alerting을 규칙 엔진으로 사용한다. Grafana에 alert rule + webhook contact point를 정의해 규칙 위반 시 POST /internal/alerts/grafana로 발신한다.

Alternatives

  • Prometheus Alertmanager — 별도 컨테이너 + routing config + PromQL 전용(Loki 로그 규칙 불가). 단일 호스트에 SPOF·운영 부담만 추가.
  • 앱 인프로세스 규칙 평가(@Scheduled PromQL 폴링) — 규칙 평가·억제·resolved를 직접 구현 = 바퀴 재발명.

Rationale

  • ⑤ Grafana 재사용 → 신규 컨테이너 0(단순함·리소스 제약).
  • Prometheus 메트릭 + Loki 로그 기반 규칙을 한 엔진에서 평가.
  • env 라벨·대시보드와 통합 UI. contact point webhook은 표준 기능.
  • “대시보드와 알림이 같은 컴포넌트라 HA 결합”이라는 단점은 단일 호스트에 무관.

Consequences

  • Grafana alerting 규칙/contact point 프로비저닝(INFRA-02)이 필요.
  • webhook 페이로드는 Grafana 표준 포맷(alerts[].labels/annotations) — 수신 DTO가 이를 매핑.
  • 롤백: contact point 비활성 또는 alerting.enabled=false.