OpsGenie
알람 및 온콜 관리 서비스
알람 및 온콜 관리 서비스
OpsGenie는 Atlassian이 인수한 인시던트 관리 및 온콜(On-call) 관리 플랫폼입니다. 모니터링 도구에서 발생한 알림을 중앙에서 관리하고, 적절한 담당자에게 라우팅하며, 에스컬레이션 정책에 따라 알림을 전파합니다. SRE와 DevOps 팀의 장애 대응 워크플로우를 체계화합니다.
OpsGenie의 핵심 기능은 Alert 관리, 온콜 스케줄링, 에스컬레이션 정책입니다. Prometheus, Datadog, CloudWatch 등 200개 이상의 도구와 통합되어 알림을 수신하고, 중복 알림을 그룹화하며, 온콜 담당자에게 SMS, 전화, 앱 푸시로 알립니다.
온콜 스케줄은 팀원이 돌아가며 장애 대응을 담당하는 일정을 정의합니다. 주간/야간, 평일/주말을 구분하고, 휴가나 오버라이드도 관리합니다. 1차 담당자가 응답하지 않으면 자동으로 2차 담당자에게 에스컬레이션되어 알림 누락을 방지합니다.
OpsGenie는 Jira Service Management와 통합되어 알림에서 인시던트 티켓을 자동 생성하고, 타임라인 기록, 포스트모템 작성을 지원합니다. 비슷한 도구로 PagerDuty, Incident.io, Rootly가 있으며, OpsGenie는 Atlassian 생태계(Jira, Confluence, Statuspage)와의 연동이 강점입니다.
# Prometheus Alertmanager -> OpsGenie 연동
# alertmanager.yml
global:
resolve_timeout: 5m
route:
receiver: 'opsgenie-critical'
group_by: ['alertname', 'service']
group_wait: 30s
group_interval: 5m
repeat_interval: 4h
routes:
# Critical 알림은 즉시 전송
- match:
severity: critical
receiver: 'opsgenie-critical'
continue: true
# Warning은 업무시간에만
- match:
severity: warning
receiver: 'opsgenie-warning'
active_time_intervals:
- business_hours
receivers:
- name: 'opsgenie-critical'
opsgenie_configs:
- api_key: ''
message: '{{ .GroupLabels.alertname }}: {{ .CommonAnnotations.summary }}'
description: '{{ .CommonAnnotations.description }}'
priority: 'P1'
tags: 'prometheus,{{ .GroupLabels.service }}'
# 알림 라우팅
responders:
- type: team
name: 'platform-oncall'
# 추가 상세 정보
details:
environment: '{{ .GroupLabels.environment }}'
runbook: '{{ .CommonAnnotations.runbook_url }}'
- name: 'opsgenie-warning'
opsgenie_configs:
- api_key: ''
priority: 'P3'
responders:
- type: team
name: 'platform-team'
# OpsGenie API를 통한 알림 생성 및 관리
import requests
OPSGENIE_API_KEY = "your-api-key"
BASE_URL = "https://api.opsgenie.com/v2"
headers = {
"Authorization": f"GenieKey {OPSGENIE_API_KEY}",
"Content-Type": "application/json"
}
# 알림 생성
def create_alert(message: str, priority: str = "P3", **kwargs):
payload = {
"message": message,
"priority": priority,
"tags": kwargs.get("tags", []),
"details": kwargs.get("details", {}),
"responders": [
{"type": "team", "name": "platform-oncall"}
]
}
response = requests.post(
f"{BASE_URL}/alerts",
headers=headers,
json=payload
)
return response.json()
# 알림 닫기
def close_alert(alert_id: str, note: str = "Issue resolved"):
payload = {"note": note}
response = requests.post(
f"{BASE_URL}/alerts/{alert_id}/close",
headers=headers,
json=payload
)
return response.json()
# 온콜 담당자 조회
def get_on_call(schedule_name: str):
response = requests.get(
f"{BASE_URL}/schedules/{schedule_name}/on-calls",
headers=headers
)
on_calls = response.json().get("data", {}).get("onCallParticipants", [])
return [p["name"] for p in on_calls]
# 사용 예시
create_alert(
message="Database connection pool exhausted",
priority="P1",
tags=["database", "production"],
details={
"service": "order-api",
"pod": "order-api-abc123",
"runbook": "https://wiki/runbooks/db-pool-exhausted"
}
)
SRE: "지난 장애 때 30분 동안 아무도 응답 안 했어요. 온콜 담당자가 휴대폰을 무음으로 해놨다고..."
주니어: "에스컬레이션 정책을 더 빠르게 설정하면 어떨까요?"
시니어: "P1은 5분 후 에스컬레이션, 10분 후 전체 팀 알림으로 바꿉시다. 그리고 OpsGenie 앱 알림 못 받으면 전화까지 가도록 설정하고요."
면접관: "온콜 경험과 인시던트 관리 프로세스에 대해 말씀해주세요."
지원자: "2주에 한 번 온콜을 섰고, OpsGenie로 알림을 받았습니다. P1 알림은 앱 푸시와 전화로 동시에 오고, 5분 내 ACK 안 하면 백업 담당자에게 에스컬레이션됐어요. 알림마다 Runbook 링크가 있어서 대응 절차를 따라할 수 있었고, 장애 후에는 Jira 티켓이 자동 생성되어 포스트모템을 작성했습니다."
리뷰어: "이 알림 설정에 runbook URL 추가해주세요. OpsGenie details에 runbook 필드가 있으면 담당자가 바로 대응 문서를 볼 수 있어요."
작성자: "알림 템플릿에 annotation으로 runbook_url 추가하고, OpsGenie details 매핑하겠습니다."