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

컨트롤러 메트릭 (Controller Metrics)

원문 보기 위키 갱신

Argo Rollouts 컨트롤러는 이미 8090 포트의 /metrics에서 사용할 수 있는 Prometheus 메트릭으로 계측되어 있어요. 이 메트릭들을 사용해 대시보드나 다른 Prometheus 연동을 통해 컨트롤러의 상태를 확인할 수 있어요.

출처: 문서

본문

Argo Rollouts 컨트롤러는 이미 8090 포트의 /metrics에서 사용할 수 있는 Prometheus 메트릭으로 계측되어 있어요. 이 메트릭들을 사용해 대시보드나 다른 Prometheus 연동을 통해 컨트롤러의 상태를 확인할 수 있어요.

Prometheus 설치와 구성

메트릭을 활용하려면 Kubernetes 클러스터에 Prometheus가 설치되어 있어야 해요. 기존 Prometheus 설치가 없다면, 클러스터에 설치하는 일반적인 방법 중 아무거나 사용할 수 있어요. 대표적인 옵션으로는 Prometheus Helm 차트나 Prometheus Operator가 있어요.

클러스터에서 Prometheus가 실행되면, 그것이 Argo Rollouts 엔드포인트를 스크랩하도록 해야 해요. Prometheus는 이미 Kubernetes용 서비스 디스커버리 메커니즘을 갖고 있지만, 먼저 구성해야 해요. 설치 방법에 따라 Argo Rollouts 엔드포인트를 스크랩하려면 추가 조치가 필요할 수 있어요.

예를 들어 Prometheus의 Helm 차트를 사용했다면, Argo Rollouts Controller에 다음과 같이 주석을 달아야 해요.

spec:
  template:
    metadata:
      annotations:
        prometheus.io/scrape: "true"
        prometheus.io/path: /metrics
        prometheus.io/port: "8090"

Prometheus의 "Targets" 화면에서 컨트롤러에 성공적으로 도달하는지 항상 확인할 수 있어요.

컨트롤러 메트릭이 Prometheus 인스턴스에서 읽히면, 다른 Prometheus 데이터 소스처럼 사용할 수 있어요.

Grafana 대시보드 만들기

Grafana 대시보드를 사용하면 컨트롤러의 메트릭을 쉽게 시각화할 수 있어요. 클러스터에 Grafana를 설치하고 Prometheus 인스턴스에 연결하세요. 그런 다음 사용 가능한 메트릭(다음 섹션에서 자세히 설명)으로 아무 대시보드나 만들 수 있어요.

시작점으로 https://github.com/argoproj/argo-rollouts/blob/master/examples/dashboard.json 에 기존 대시보드가 있어요.

이 대시보드를 JSON 파일로 Grafana 설치에 가져올 수 있어요.

Rollout 객체용 메트릭

Argo Rollouts 컨트롤러는 Argo Rollout 객체에 대해 다음과 같은 Prometheus 메트릭을 게시해요.

Name Description
rollout_info Information about rollout.
rollout_info_replicas_available The number of available replicas per rollout.
rollout_info_replicas_unavailable The number of unavailable replicas per rollout.
rollout_info_replicas_desired The number of desired replicas per rollout.
rollout_info_replicas_updated The number of updated replicas per rollout.
rollout_phase [DEPRECATED - use rollout_info] Information on the state of the rollout.
rollout_reconcile Rollout reconciliation performance.
rollout_reconcile_error Error occurring during the rollout.
experiment_info Information about Experiment.
experiment_phase Information on the state of the experiment.
experiment_reconcile Experiments reconciliation performance.
experiment_reconcile_error Error occurring during the experiment.
analysis_run_info Information about analysis run.
analysis_run_metric_phase Information on the duration of a specific metric in the Analysis Run.
analysis_run_metric_type Information on the type of a specific metric in the Analysis Runs.
analysis_run_phase Information on the state of the Analysis Run.
analysis_run_reconcile Analysis Run reconciliation performance.
analysis_run_reconcile_error Error occurring during the analysis run.

컨트롤러 자체용 메트릭

컨트롤러는 또한 컨트롤러 상태를 설명하는 다음 Prometheus 메트릭을 게시해요.

Name Description
controller_clientset_k8s_request_total Number of kubernetes requests executed during application reconciliation.
workqueue_adds_total Total number of adds handled by workqueue
workqueue_depth Current depth of workqueue
workqueue_queue_duration_seconds How long in seconds an item stays in workqueue before being requested.
workqueue_work_duration_seconds How long in seconds processing an item from workqueue takes.
workqueue_unfinished_work_seconds How many seconds of work has done that is in progress and hasn't been observed by work_duration. Large values indicate stuck threads. One can deduce the number of stuck threads by observing the rate at which this increases.
workqueue_longest_running_processor_seconds How many seconds has the longest running processor for workqueue been running
workqueue_retries_total Total number of retries handled by workqueue

추가로 Argo-rollouts는 CPU, 메모리, 파일 디스크립터 사용량과 현재 Go 프로세스의 시작 시간, 메모리 통계에 대한 메트릭도 제공해요.

더 알아보기 (Learn more)