snow · 2026.5.15 11:04 · 조회 2

Grafana 알림(Alert) 설정

Grafana Alerting이란?

Grafana의 알림 기능은 메트릭이 특정 조건을 충족할 때 자동으로 알림을 전송합니다. Slack, 이메일, PagerDuty, Webhook 등 다양한 채널로 알림을 보낼 수 있습니다.


알림 구성 요소

구성 요소설명
Alert Rule알림 조건을 정의하는 규칙
Contact Point알림을 받을 채널 (Slack, 이메일 등)
Notification Policy어떤 알림을 어떤 채널로 보낼지 라우팅
Silences특정 기간 동안 알림 무음 처리

Contact Point 설정

Alerting → Contact points → Add contact point

Slack 연동

  1. Name: Slack-ops
  2. Integration: Slack 선택
  3. Webhook URL: Slack Incoming Webhook URL 입력
https://hooks.slack.com/services/...
  1. Optional settings에서 메시지 템플릿 커스터마이징
  2. Test 클릭으로 테스트 알림 전송

이메일 연동

  1. Integration: Email 선택
  2. Addresses: 수신자 이메일 주소 입력 (여러 개는 ;로 구분)

이메일 발송을 위해 관리자가 SMTP 서버를 먼저 설정해야 합니다.


Alert Rule 생성

Alerting → Alert rules → New alert rule

1단계: 쿼리 및 조건 설정

1# 쿼리 A: CPU 사용률2100 - (avg(rate(node_cpu_seconds_total{mode="idle"}[5m])) * 100)

Threshold 조건:

  • Condition: IS ABOVE 80 (80% 초과 시 알림)

2단계: 평가 설정

항목예시설명
Evaluate every1m1분마다 조건 평가
For5m5분 이상 지속 시 알림 발송 (노이즈 방지)

3단계: 레이블 설정

알림에 레이블을 붙여 라우팅에 활용합니다.

severity = critical team = infra

4단계: Notification Policy 연결

Alerting → Notification policies에서 레이블 기반으로 알림을 라우팅합니다.

matchers: - severity = critical - team = infra contact point: Slack-ops

알림 상태

상태의미
Normal조건 미충족, 정상
Pending조건 충족, 대기 중 (For 기간)
Firing알림 발송 중
Resolved조건 해소, 복구 알림 전송
NoData데이터 없음

알림 메시지 템플릿

{{ define "custom_alert" }} 🚨 *{{ .Labels.alertname }}* - 상태: {{ .Status }} - 심각도: {{ .Labels.severity }} - 요약: {{ .Annotations.summary }} {{ end }}

Silences (알림 무음)

점검 시간 또는 배포 중 불필요한 알림을 일시적으로 차단합니다.

Alerting → Silences → Add silence

  • 기간 설정 (시작/종료 시간)
  • 레이블 매처 설정 (무음 처리할 알림 조건)
  • 작성자 및 사유 입력

댓글

아직 댓글이 없습니다.

댓글을 작성하려면 로그인이 필요합니다.