본문 바로가기
WIKI 기술 지식 베이스

모니터 집계자

원문 보기 위키 갱신

모니터 집계자 (Monitor aggregators)

평균(average), 최대(maximum), 최소(minimum), 합계(sum)라는 네 가지 집계 방법 중 하나로 데이터가 집계되는 방식에 따라 경보를 보내도록 모니터 쿼리를 구성할 수 있어요. 이 가이드에서는 같은 예시 메트릭 값을 10분 평가 창에 적용하고, 각 집계자를 적용해 각 모니터가 어떻게 반응하는지 살펴볼게요.

출처: 문서

본문

개요 (Overview)

{% image source="https://docs.dd-static.net/images/monitors/guide/monitor_aggregators/aggregator_dropdown.67c366ee0675309094319375ddbd8aff.png?auto=format&fit=max&w=850 1x, https://docs.dd-static.net/images/monitors/guide/monitor_aggregators/aggregator_dropdown.67c366ee0675309094319375ddbd8aff.png?auto=format&fit=max&w=850&dpr=2 2x" alt="Dropdown under Monitor Configuration showing the four aggregators" /%}

평균, 최대, 최소, 합계라는 네 가지 집계 방법 중 하나로 데이터가 집계되는 방식에 따라 경보를 보내도록 모니터 쿼리를 구성할 수 있어요. 이 가이드에서는 같은 예시 메트릭 값을 10분 평가 창에 적용하고, 각 집계자를 적용해 각 모니터가 어떻게 반응하는지 살펴볼게요.

{% image source="https://docs.dd-static.net/images/monitors/guide/monitor_aggregators/metric_values_example.6afd8f227193b49343de20dbaab6bdca.png?auto=format&fit=max&w=850 1x, https://docs.dd-static.net/images/monitors/guide/monitor_aggregators/metric_values_example.6afd8f227193b49343de20dbaab6bdca.png?auto=format&fit=max&w=850&dpr=2 2x" alt="Example metric values over a 10 minute evaluation window [10, 15, 12, 8, 11, 14, 13, 25, 37, 45, 50]" /%}

모든 예시는 다음을 가정해요:

  • 쿼리는 classic_eval_path로 계산돼요.
  • 모니터는 값이 특정 임계값 이상일 때 경보를 발생시켜요.

평균 (Average)

모니터는 평가 창의 값을 가져와 모든 데이터 포인트의 평균을 계산해요. 이 평균값이 정의된 임계값과 비교돼요. 이 집계자의 일반적인 사용 사례는 메트릭 데이터가 너무 높거나 너무 낮은지 확인하는 거예요.

예시 (Example)

지난 10분 동안의 평균이 30을 넘으면 모니터가 알림을 보내도록 하고 싶다고 해볼게요. 3:10 시점에 모니터는 어떤 상태인가요?

$$(\10+15+12+8+11+14+13+25+37+45+50)/11 = 22$$

답 (Answer)

OK 상태예요, 이 모니터는 경보를 발생시키지 않아요.

최대 및 이상 (Maximum and above)

모니터는 평가 창의 값을 가져와 각 값을 정의된 임계값과 비교해요. 평가 창에서 단일 데이터 포인트라도 임계값 이상이면 모니터가 경보를 발생시켜요.

임계값 미만일 때 경보를 발생시키도록 구성된 모니터는 동작이 반대예요.

예시 (Example)
  1. 지난 10분 동안 어느 시점에서든 메트릭 값이 40보다 높으면 알림을 보내도록 하고 싶다고 해볼게요. 3:10 시점에 모니터는 어떤 상태인가요?

  2. 지난 10분 동안 어느 시점에서든 메트릭 값이 50보다 높으면 알림을 보내도록 하고 싶다고 해볼게요. 3:10 시점에 모니터는 어떤 상태인가요?

답 (Answer)
  1. ALERT 상태예요, 지난 10분 동안의 마지막 두 값은 45와 50이에요. 이 모니터는 경보를 발생시켜요.

  2. OK 상태예요, 임계값은 50이고 마지막 값은 50보다 높지 않아요. 이 모니터는 경보를 발생시키지 않아요.

최소 및 이상 (Minimum and above)

모니터는 평가 창의 값을 가져와 각 값을 정의된 임계값과 비교해요. 창의 모든 값은 임계값 이상이어야 해요. 최소값이 임계값 이상이면, 창의 모든 포인트도 임계값 이상이라는 뜻이에요.

임계값 미만일 때 경보를 발생시키도록 구성된 모니터는 동작이 반대예요.

예시 (Example)

지난 10분 동안 어느 시점에서든 최소 메트릭 값이 10보다 높으면 모니터가 경보를 발생시키도록 하고 싶다고 해볼게요. 3:10 시점에 모니터는 어떤 상태인가요?

답 (Answer)

OK 상태예요, 3:00(10)과 3:03(8)의 값은 10보다 높지 않아요.

합계 (Sum)

모니터는 평가 창의 값을 가져와 합계 값을 정의된 임계값과 비교해요. 이 집계자는 데이터 포인트의 수가 아니라 각 데이터 포인트의 값을 더해요. 오류(errors)나 재시작(restarts) 발생 횟수를 세는 메트릭이 사용 사례예요. 그래서 as_count() 메트릭은 sum 집계자를 사용해야 해요. 자세한 내용은 모니터 평가에서의 as_count() 가이드를 참고해요.

예시 (Example)

지난 10분 동안의 값 합계가 250을 넘으면 모니터가 알림을 보내도록 하고 싶다고 해볼게요. 3:10 시점에 이 모니터는 어떤 상태인가요?

$$10+15+12+8+11+14+13+25+37+45+50 = 240$$

답 (Answer)

OK 상태예요, 이 모니터는 경보를 발생시키지 않아요.

집계자 시각화하기 (Visualizing aggregators)

쿼리에서 사용하는 집계 방법과 평가 집계에 따라 서로 다른 결과를 볼 수 있어요. 아래 집계 방법들은 같은 메트릭을 사용해요. 각 방법이 시계열에서 메트릭이 집계되는 방식을 어떻게 바꾸는지 볼 수 있어요.

집계 (Aggregation) 결과 그래프 (Resulting graph)
Average (avg by): 메트릭의 평균값 {% image
source="https://docs.dd-static.net/images/monitors/guide/monitor_aggregators/AVG_aggregation.828f375d7a3980c16fb4ac932866490e.png?auto=format&fit=max&w=850 1x, https://docs.dd-static.net/images/monitors/guide/monitor_aggregators/AVG_aggregation.828f375d7a3980c16fb4ac932866490e.png?auto=format&fit=max&w=850&dpr=2 2x"
alt="Graph visualization of the metric aggregated by the average" /%} |

| Maximum (max by): 메트릭의 최대값 | {% image source="https://docs.dd-static.net/images/monitors/guide/monitor_aggregators/MAX_aggregation.f7d6b6fdd1452e2125c0d389c2790c88.png?auto=format&fit=max&w=850 1x, https://docs.dd-static.net/images/monitors/guide/monitor_aggregators/MAX_aggregation.f7d6b6fdd1452e2125c0d389c2790c88.png?auto=format&fit=max&w=850&dpr=2 2x" alt="Graph visualization of the metric aggregated by the maximum value, visually shows higher values than the average graph" /%} | | Minimum (min by): 메트릭의 최소값 | {% image source="https://docs.dd-static.net/images/monitors/guide/monitor_aggregators/MIN_aggregation.2987629a430657f9b9717e15eb61ea6d.png?auto=format&fit=max&w=850 1x, https://docs.dd-static.net/images/monitors/guide/monitor_aggregators/MIN_aggregation.2987629a430657f9b9717e15eb61ea6d.png?auto=format&fit=max&w=850&dpr=2 2x" alt="Graph visualization of the metric aggregated by the minimum, visually shows lower values than the average and maximum graphs" /%} | | Sum (sum by): 모든 메트릭 값을 더한 총합 | {% image source="https://docs.dd-static.net/images/monitors/guide/monitor_aggregators/SUM_aggregation.5bcdba510a953b922be9eb95262a890d.png?auto=format&fit=max&w=850 1x, https://docs.dd-static.net/images/monitors/guide/monitor_aggregators/SUM_aggregation.5bcdba510a953b922be9eb95262a890d.png?auto=format&fit=max&w=850&dpr=2 2x" alt="Graph visualization of the metric aggregated by the sum, visually shows higher values than the average and maximum graphs" /%} |

더 알아보기 (Learn more)