복합 모니터 사용 사례
복합 모니터 사용 사례 (Composite Monitor Use Cases)
이 가이드는 복합 모니터(composite monitor)의 비완전한 사용 사례 목록을 다뤄요. 아래 예시들은 모니터링 환경의 다양한 사용 사례를 해결하기 위해 복합 모니터를 어떻게 구성할 수 있는지 보여줘요:
- 오류율 (Error rates)
- 빈번한 메트릭 모니터링 (Monitor frequent metrics)
- 단계 모니터 (Step monitor)
- 복구 시 재알림 (Renotifying on recovery)
- 알림 지연 (Delay on notification)
출처: 문서
본문
오류율 (Error rates)
힛(hit)이 특정 수 이상일 때만 오류율이 임계값을 초과하면 경보를 발생시켜요.
두 개의 모니터를 만들어요:
- Monitor A:
trace.requests.request.errors / trace.requests.request.hits > X일 때 경보 - Monitor B:
trace.requests.request.hits > Y일 때 경보
복합 모니터 C: Monitor A와 Monitor B가 모두 alert 상태일 때(A && B) 경보.
| Monitor A | Monitor B | 복합 모니터 C (Composite Monitor C) |
|---|---|---|
| Alert 오류율이 임계값 초과 | Alert 힛이 임계값 초과 | Alert |
| Alert 오류율이 임계값 초과 | OK 힛이 임계값 미만 | OK 조건 1개만 충족, 경보 없음 |
| OK 오류율이 임계값 미만 | Alert 힛이 임계값 초과 | OK 조건 1개만 충족, 경보 없음 |
더 많은 상태 조합은 복합 모니터 문서를 참고해요.
빈번한 메트릭 모니터링 (Monitor frequent metrics)
서비스의 지연 시간(latency)을 모니터링하되, 트래픽이 적어 생기는 일시적인 급증(spike)은 무시해요. 예를 들어 밤 시간대에 서비스가 매우 적은 값을 보고하는 기간 같은 경우요.
두 개의 모니터를 만들어요:
- Monitor A:
latency > X일 때 경보 - Monitor B: 지난 1시간 동안
sum:latency{*}.rollup(count) > Y일 때 경보
복합 모니터 C: 두 조건이 모두 충족될 때 경보.
| Monitor A | Monitor B | 복합 모니터 C (Composite Monitor C) |
|---|---|---|
| Alert 지연 시간이 임계값 초과 | Alert Y보다 많은 메트릭 | Alert |
| Alert 지연 시간이 임계값 초과 | OK Y보다 적은 메트릭 | OK 메트릭이 충분하지 않음 |
| OK 지연 시간이 임계값 미만 | Alert Y보다 많은 메트릭 | OK 지연 시간이 임계값 미만 |
단계 모니터 (Step monitor)
짝을 이루는 메트릭이 없을 때 경보를 발생시켜요. 예를 들어 sent/received, down/up, create/resolve 같은 로그 메트릭이요. 짝을 이루는 메트릭이 N분 간격으로 올 것으로 예상된다면 모니터의 평가 창을 조정할 수 있어요.
- Monitor A:
action:create가 0보다 클 때 경보 - Monitor B:
action:resolve가 0보다 클 때 경보
복합 모니터: a && !b일 때 경보.
| Monitor A | Monitor B | 복합 모니터 C (Composite Monitor C) |
|---|---|---|
| Alert action create가 0 초과 | Alert action resolve가 0 초과 | OK |
| Alert action create가 0 초과 | OK | Alert action resolve가 없음 |
| OK | Alert action resolve가 0 초과 | OK |
복구 시 재알림 (Renotifying on recovery)
timeshift를 사용하는 두 개의 모니터로 복구 시 재알림을 구현해요.
- Monitor A: 현재 메트릭 상태
- Monitor B:
timeshift를 사용한 과거 메트릭 상태
복합 모니터: 로직은 !a && b.
| Monitor A | Monitor B | 복합 모니터 C (Composite Monitor C) |
|---|---|---|
| Alert 실시간 메트릭 | Alert 과거 메트릭 | OK |
| Alert 실시간 메트릭 | OK 메트릭 미트리거 | OK |
| OK 메트릭 미트리거 | Alert 과거 메트릭 | Alert |
알림 지연 (Delay on notification)
오류가 설정된 기간 동안 지속된 후 경보를 발생시켜요. 예를 들어 오류 집합이 최소 15분 동안 트리거된 경우요.
- Monitor A: 실시간 메트릭
- Monitor B (timeshifted): X분만큼 이동된 메트릭
복합 모니터: a && b일 때 경보.
| Monitor A | Monitor B (timeshifted) | 복합 모니터 C (Composite Monitor C) |
|---|---|---|
| Alert 실시간 메트릭 | Alert 과거 메트릭 | Alert |
| Alert 실시간 메트릭 | OK 메트릭 미트리거 | OK |
| OK 메트릭 미트리거 | Alert 과거 메트릭 | OK |