💡 핵심 요약 (Executive Summary)
본 가이드는 grafana 핵심 가이드 및 실전 아키텍처의 핵심 개념, 실전 구성 명령어 및 아키텍처 베스트 프랙티스를 다룹니다. 클라우드 네이티브 및 인프라 엔지니어링 실무에 즉시 활용 가능하도록 체계적으로 정리했습니다.
📑 Table of Contents
Alert
Create Alert Rule
graphql
# A : prometheus Query: 10분동안 restart된 횟수
sum by(container,namespace,pod) (changes(kube_pod_container_status_restarts_total[10m]))
# B : Expression: Reduce A
# C : Expression: Math $B > 0 -- 조건식으로 사용
Create Teplate
go
//[{{.Status}}] {{ range .Alerts }}{{ .Labels.alertname }} / {{ .Labels.team }}{{ end }}
[{{.Status}}] {{ .CommonLabels.alertname }} / {{ .CommonLabels.team }}
go
{{ len .Alerts.Firing }} firing. {{ len .Alerts.Resolved }} resolved.
----------------- list -----------------
{{ range .Alerts }}
namespace: {{ .Labels.namespace }}
pod: {{ .Labels.pod }}
container: {{ .Labels.container }}
status: {{ .Status }}
----------------------------------------
{{ end }}
Create Contact Point
기존 정의한 템플릿 사용
Leave a Reply