alertmanager:
config:
global:
resolve_timeout: 5m
route:
group_by: ['job']
group_wait: 30s
group_interval: 2m # 초기 알림이 이미 전송된 알림 그룹에 추가된 새 알림에 대한 알림을 보내기 전에 대기하는 시간(보통 최대 5m 이상)입니다. / s, m, h
repeat_interval: 6h #6h # 알림이 이미 성공적으로 전송된 경우 알림을 다시 보내기 전에 대기하는 시간(보통 최대 3시간 이상).
receiver: 'gcp-monitoring'
# All alerts that do not match the following child routes
# will remain at the root node and be dispatched to 'default-receiver'.
routes:
- receiver: 'gcp-monitoring'
group_wait: 10s
receivers:
- name: 'gcp-monitoring'
slack_configs:
- channel: 'gke-prometheus' ## The channel or user to send notifications to / 의미가 없어보임 내가 확인하기 위해 작성
api_url: "<https://hooks.slack.com/services/T01P8GA78P8##중략>
send_resolved: true
icon_url: <https://avatars3.githubusercontent.com/u/3380462>
title: "{{ range .Alerts }}{{ .Annotations.title }}\\n{{ end }}"
text: "{{ range .Alerts }}{{ .Annotations.message }}\\n{{ end }}"
api_url
위에서 확인한 webhook url을 입력한다.
Slack에서 Alert 확인하기
임계치가 넘었을때 위 slack_config에 작성한 title, text에 해당하는 메세지를 받을 수 있는지 확인한다.