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

Longhorn 모니터링 메트릭

원문 보기 위키 갱신

Longhorn이 노출하는 Prometheus 메트릭 전체 목록이에요. 볼륨·노드·replica·engine·디스크·instance manager 등 구성 요소별로 메트릭 이름, 설명, 예시를 정리했어요.

출처: 문서

본문

볼륨 (Volume)

이름 설명 예시
longhorn_volume_actual_size_bytes 해당 노드에서 볼륨의 각 replica가 실제 사용 중인 공간 longhorn_volume_actual_size_bytes{pvc_namespace="default",node="worker-2",pvc="testvol",volume="testvol"} 1.1917312e+08
longhorn_volume_capacity_bytes 이 볼륨에 구성된 크기(바이트) longhorn_volume_capacity_bytes{pvc_namespace="default",node="worker-2",pvc="testvol",volume="testvol"} 6.442450944e+09
longhorn_volume_encrypted 암호화된 볼륨 longhorn_volume_encrypted{pvc_namespace="default",node="worker-2",pvc="testvol",volume="testvol"} 1
longhorn_volume_state 볼륨 상태. state 레이블로 현재 볼륨 상태를 나타내고, 현재 상태는 1, 나머지는 0. 상태: creating, attached, detached, attaching, detaching, deleting longhorn_volume_state{pvc_namespace="default",node="worker-2",pvc="testvol",volume="testvol",state="attached"} 1
longhorn_volume_robustness 볼륨 견고성. state 레이블로 현재 견고성을 나타내고, 현재 상태는 1, 나머지는 0. 상태: unknown, healthy, degraded, faulted longhorn_volume_robustness{pvc_namespace="default",node="worker-2",pvc="testvol",volume="testvol",state="healthy"} 1
longhorn_volume_read_throughput 이 볼륨의 읽기 처리량 (Bytes/s) longhorn_volume_read_throughput{pvc_namespace="default",node="worker-2",pvc="testvol",volume="testvol"} 5120000
longhorn_volume_write_throughput 이 볼륨의 쓰기 처리량 (Bytes/s) longhorn_volume_write_throughput{pvc_namespace="default",node="worker-2",pvc="testvol",volume="testvol"} 512000
longhorn_volume_read_iops 이 볼륨의 읽기 IOPS longhorn_volume_read_iops{pvc_namespace="default",node="worker-2",pvc="testvol",volume="testvol"} 100
longhorn_volume_write_iops 이 볼륨의 쓰기 IOPS longhorn_volume_write_iops{pvc_namespace="default",node="worker-2",pvc="testvol",volume="testvol"} 100
longhorn_volume_read_latency 이 볼륨의 읽기 레이턴시 (ns) longhorn_volume_read_latency{pvc_namespace="default",node="worker-2",pvc="testvol",volume="testvol"} 100000
longhorn_volume_write_latency 이 볼륨의 쓰기 레이턴시 (ns) longhorn_volume_write_latency{pvc_namespace="default",node="worker-2",pvc="testvol",volume="testvol"} 100000
longhorn_volume_file_system_read_only 볼륨이 읽기 전용 모드에 들어갔음을 나타냄. 볼륨별로 1 또는 레코드 없음 longhorn_volume_file_system_read_only{node="worker-2",pvc="testvol",pvc_namespace="default",volume="testvol"} 1
longhorn_volume_last_backup_at 이 볼륨의 마지막 성공 백업 Unix 타임스탬프(없으면 0) longhorn_volume_last_backup_at{pvc_namespace="default",node="worker-2",pvc="testvol",volume="testvol"} 1.766365578e+09

노드 (Node)

이름 설명 예시
longhorn_node_status 이 노드의 상태: 1=true, 0=false longhorn_node_status{condition="ready",condition_reason="",node="worker-2"} 1
longhorn_node_count_total Longhorn 시스템의 총 노드 수 longhorn_node_count_total 4
longhorn_node_cpu_capacity_millicpu 이 노드에서 할당 가능한 최대 CPU longhorn_node_cpu_capacity_millicpu{node="worker-2"} 2000
longhorn_node_cpu_usage_millicpu 이 노드의 CPU 사용량 longhorn_node_cpu_usage_millicpu{node="pworker-2"} 186
longhorn_node_memory_capacity_bytes 이 노드에서 할당 가능한 최대 메모리 longhorn_node_memory_capacity_bytes{node="worker-2"} 4.031229952e+09
longhorn_node_memory_usage_bytes 이 노드의 메모리 사용량 longhorn_node_memory_usage_bytes{node="worker-2"} 1.833582592e+09
longhorn_node_storage_capacity_bytes 이 노드의 스토리지 용량 longhorn_node_storage_capacity_bytes{node="worker-3"} 8.3987283968e+10
longhorn_node_storage_usage_bytes 이 노드의 사용 스토리지 longhorn_node_storage_usage_bytes{node="worker-3"} 9.060941824e+09
longhorn_node_storage_reservation_bytes 이 노드에서 다른 애플리케이션·시스템을 위해 예약된 스토리지 longhorn_node_storage_reservation_bytes{node="worker-3"} 2.519618519e+10

Replica (Replica)

이름 설명 예시
longhorn_replica_info 각 Replica CR의 정적 메타데이터 longhorn_replica_info{replica="testvol-r-abc",volume="testvol",node="node-1",disk_path="/dev/xda",data_engine="v2"} 1
longhorn_replica_state replica의 현재 런타임 상태: running, stopped, error, starting, stopping, unknown longhorn_replica_state{replica="testvol-r-abc",volume="testvol",node="node-1",state="running"} 1

엔진 (Engine)

이름 설명 예시
longhorn_engine_info 각 Engine CR의 정적 메타데이터 longhorn_engine_info{engine="testvol-e-0",volume="testvol",node="node-1",data_engine="v2",frontend="blockdev",image="longhorn-instance-manager:latest"} 1
longhorn_engine_state 엔진의 런타임 상태: running, stopped, error, starting, stopping, unknown longhorn_engine_state{engine="testvol-e-0",volume="testvol",node="node-1",state="running"} 1
longhorn_engine_replica_mode 엔진이 각 replica에 보고한 모드: RW, WO, ERR longhorn_engine_replica_mode{volume="testvol",engine="testvol-e-0",replica="testvol-r-abc",mode="RW"} 1
longhorn_engine_rebuild_progress 엔진 리빌드 진행률(0–100%). replica 리빌딩 중에만 노출돼요. longhorn_engine_rebuild_progress{pvc_namespace="default",pvc="testvol",engine="testvol-e-0",rebuild_src="10.42.1.215:20036",rebuild_dst="10.42.0.131:20922"} 42

디스크 (Disk)

이름 설명 예시
longhorn_disk_capacity_bytes 이 디스크의 스토리지 용량 longhorn_disk_capacity_bytes{disk="default-disk-8b28ee3134628183",node="worker-3"} 8.3987283968e+10
longhorn_disk_usage_bytes 이 디스크의 사용 스토리지 longhorn_disk_usage_bytes{disk="default-disk-8b28ee3134628183",node="worker-3"} 9.060941824e+09
longhorn_disk_reservation_bytes 이 디스크에서 다른 애플리케이션·시스템을 위해 예약된 스토리지 longhorn_disk_reservation_bytes{disk="default-disk-8b28ee3134628183",node="worker-3"} 2.519618519e+10
longhorn_disk_status 이 디스크의 상태 longhorn_disk_status{condition="ready",condition_reason="",disk="default-disk-ca0300000000",node="worker-3"}
longhorn_disk_read_throughput 이 디스크의 읽기 처리량 (Bytes/s) longhorn_disk_read_throughput{disk="default-disk-8b28ee3134628183",node="worker-3",disk_path="/dev/sda"} 10485760
longhorn_disk_write_throughput 이 디스크의 쓰기 처리량 (Bytes/s) longhorn_disk_write_throughput{disk="default-disk-8b28ee3134628183",node="worker-3",disk_path="/dev/sda"} 2097152
longhorn_disk_read_iops 이 디스크의 읽기 IOPS longhorn_disk_read_iops{disk="default-disk-8b28ee3134628183",node="worker-3",disk_path="/dev/sda"} 200
longhorn_disk_write_iops 이 디스크의 쓰기 IOPS longhorn_disk_write_iops{disk="default-disk-8b28ee3134628183",node="worker-3",disk_path="/dev/sda"} 150
longhorn_disk_read_latency 이 디스크의 읽기 레이턴시 (나노초) longhorn_disk_read_latency{disk="default-disk-8b28ee3134628183",node="worker-3",disk_path="/dev/sda"} 85000
longhorn_disk_write_latency 이 디스크의 쓰기 레이턴시 (나노초) longhorn_disk_write_latency{disk="default-disk-8b28ee3134628183",node="worker-3",disk_path="/dev/sda"} 95000
longhorn_disk_health 디스크 상태(1=healthy, 0=unhealthy). 자세한 내용은 Disk Health Monitoring 참고 longhorn_disk_health{disk="default-disk-8b28ee3134628183",node="worker-3"} 1
longhorn_disk_health_attribute_raw 디스크의 raw SMART 건강 속성값. SMART 데이터가 지원될 때만 사용 가능. 자세한 내용은 Disk Health Monitoring 참고 longhorn_disk_health_attribute_raw{attribute="Temperature Celsius",attribute_id="",disk="default-disk-db0dcb3d43bdcd05",node="longhorn-worker"} 37

인스턴스 매니저 (Instance Manager)

이름 설명 예시
longhorn_instance_manager_cpu_usage_millicpu 이 Longhorn instance manager의 CPU 사용량 longhorn_instance_manager_cpu_usage_millicpu{instance_manager="instance-manager-e-2189ed13",instance_manager_type="engine",node="worker-2"} 80
longhorn_instance_manager_cpu_requests_millicpu Kubernetes에서 이 Longhorn instance manager가 요청한 CPU 자원 longhorn_instance_manager_cpu_requests_millicpu{instance_manager="instance-manager-e-2189ed13",instance_manager_type="engine",node="worker-2"} 250
longhorn_instance_manager_memory_usage_bytes 이 Longhorn instance manager의 메모리 사용량 longhorn_instance_manager_memory_usage_bytes{instance_manager="instance-manager-e-2189ed13",instance_manager_type="engine",node="worker-2"} 2.4072192e+07
longhorn_instance_manager_memory_requests_bytes Kubernetes에서 이 Longhorn instance manager가 요청한 메모리 longhorn_instance_manager_memory_requests_bytes{instance_manager="instance-manager-e-2189ed13",instance_manager_type="engine",node="worker-2"} 0
longhorn_instance_manager_proxy_grpc_connection 이 Longhorn instance manager의 proxy gRPC 연결 수 longhorn_instance_manager_proxy_grpc_connection{instance_manager="instance-manager-e-814dfd05",instance_manager_type="engine",node="worker-2"} 0

매니저 (Manager)

이름 설명 예시
longhorn_manager_cpu_usage_millicpu 이 Longhorn Manager의 CPU 사용량 longhorn_manager_cpu_usage_millicpu{manager="longhorn-manager-5rx2n",node="worker-2"} 27
longhorn_manager_memory_usage_bytes 이 Longhorn Manager의 메모리 사용량 longhorn_manager_memory_usage_bytes{manager="longhorn-manager-5rx2n",node="worker-2"} 2.6144768e+07

워크큐 (Workqueue)

Longhorn Manager는 감시 중인 Longhorn·Kubernetes 자원의 업데이트를 처리하기 위해 workqueue를 사용해요. 각 Longhorn Manager는 자신의 workqueue 메트릭을 노출하고, 이는 Longhorn Manager 수행 상태를 판단하는 중요한 지표예요. name 레이블은 workqueue 이름으로 대응하는 controller와 일치해요(예: longhorn-volume, longhorn-engine, longhorn-replica).

이름 설명 예시
longhorn_workqueue_depth workqueue의 현재 깊이 longhorn_workqueue_depth{name="longhorn-volume"} 0
longhorn_workqueue_adds_total workqueue가 처리한 add 총 횟수 longhorn_workqueue_adds_total{name="longhorn-volume"} 1024
longhorn_workqueue_queue_duration_seconds 항목이 workqueue에서 요청되기까지 머문 시간(초)의 히스토그램 longhorn_workqueue_queue_duration_seconds_bucket{name="longhorn-volume",le="0.001"} 1000
longhorn_workqueue_work_duration_seconds workqueue에서 항목 하나를 처리하는 데 걸리는 시간(초)의 히스토그램 longhorn_workqueue_work_duration_seconds_bucket{name="longhorn-volume",le="0.1"} 1010
longhorn_workqueue_unfinished_work_seconds 진행 중이지만 work_duration으로 관측되지 않은 작업의 초 수. 값이 크면 멈춘(stuck) 스레드를 뜻해요. 이 값의 증가율을 관찰해 멈춘 스레드 수를 추정할 수 있어요 longhorn_workqueue_unfinished_work_seconds{name="longhorn-volume"} 0
longhorn_workqueue_longest_running_processor_seconds workqueue의 가장 오래 실행 중인 프로세서가 실행된 초 수 longhorn_workqueue_longest_running_processor_seconds{name="longhorn-volume"} 0
longhorn_workqueue_retries_total workqueue가 처리한 재시도 총 횟수 longhorn_workqueue_retries_total{name="longhorn-volume"} 12

Kubernetes 클라이언트 (Kubernetes Client)

각 Longhorn Manager는 자신의 Kubernetes 클라이언트(client-go)가 Kubernetes API 서버로 보낸 요청 메트릭을 노출해요. 이 메트릭은 Longhorn Manager가 발행한 요청의 레이턴시, rate limiting, 결과를 이해하는 데 도움이 돼요.

이름 설명 예시
longhorn_rest_client_request_latency_seconds verb와 URL로 구분된 요청 레이턴시(초) 히스토그램 longhorn_rest_client_request_latency_seconds_bucket{url="https://10.43.0.1:443/apis/longhorn.io/v1beta2/namespaces/%7Bnamespace%7D/volumes/%7Bname%7D",verb="PUT",le="0.016"} 250
longhorn_rest_client_rate_limiter_latency_seconds verb와 URL로 구분된 클라이언트 측 rate limiter 레이턴시(초) 히스토그램 longhorn_rest_client_rate_limiter_latency_seconds_bucket{url="https://10.43.0.1:443/apis/longhorn.io/v1beta2/namespaces/%7Bnamespace%7D/volumes/%7Bname%7D",verb="PUT",le="0.001"} 250
longhorn_rest_client_requests_total 상태 코드·메서드·호스트로 구분된 HTTP 요청 수 longhorn_rest_client_requests_total{code="200",host="10.43.0.1:443",method="GET"} 12345

히스토그램 메트릭은 _bucket, _sum, _count 시계열로 노출돼요. 예를 들어 다음 PromQL 쿼리로 각 workqueue의 항목 처리 시간 99퍼센타일을 계산할 수 있어요:

histogram_quantile(0.99, sum by (name, le) (rate(longhorn_workqueue_work_duration_seconds_bucket[5m])))

백업 (Backup)

이름 설명 예시
longhorn_backup_actual_size_bytes 이 백업의 실제 크기 longhorn_backup_actual_size_bytes{backup="backup-4ab66eca0d60473e",volume="testvol",recurring_job="backup"} 6.291456e+07
longhorn_backup_state 이 백업의 상태: 0=New, 1=Pending, 2=InProgress, 3=Completed, 4=Error, 5=Unknown longhorn_backup_state{backup="backup-4ab66eca0d60473e",volume="testvol",recurring_job=""} 3
longhorn_backup_uploaded_data_size_bytes 이 백업의 업로드된 데이터 크기 longhorn_backup_uploaded_data_size_bytes{backup="backup-4ab66eca0d60473e",volume="testvol",recurring_job=""} 2.012112434e+09

백업 타깃 (Backup Target)

이름 설명 예시
longhorn_backup_target_backup_volume_count 이 백업 타깃의 백업 볼륨 수 longhorn_backup_target_backup_volume_count{backup_target="default"} 1

백업 볼륨 (Backup Volume)

이름 설명 예시
longhorn_backup_volume_backups_count 이 백업 볼륨에 속한 백업 수 longhorn_backup_volume_backups_count{backup_volume="testvol"} 1

스냅샷 (Snapshot)

이름 설명 예시
longhorn_snapshot_actual_size_bytes 이 스냅샷의 실제 크기 longhorn_snapshot_actual_size_bytes{snapshot="f4468111-2efa-45f5-aef6-63109e30d92c",user_created="false",volume="testvol"} 1.048576e+07

BackingImage

이름 설명 예시
longhorn_backing_image_actual_size_bytes 이 backing image의 실제 크기 longhorn_backing_image_actual_size_bytes{backing_image="parrot",disk="ca203ce8-2cad-4cd1-92a7-542851f50518",node="kworker1"} 3.3554432e+07
longhorn_backing_image_state 이 backing image의 상태: 0=Pending, 1=Starting, 2=InProgress, 3=ReadyForTransfer, 4=Ready, 5=Failed, 6=FailedAndCleanUp, 7=Unknown longhorn_backing_image_state{backing_image="parrot",disk="ca203ce8-2cad-4cd1-92a7-542851f50518",node="kworker1"} 4

BackupBackingImage

이름 설명 예시
longhorn_backup_backing_image_actual_size_bytes 이 백업 backing image의 실제 크기 longhorn_backup_backing_image_actual_size_bytes{backup_backing_image="parrot"} 3.3554432e+07
longhorn_backup_backing_image_state 이 백업 backing image의 상태: 0=New, 1=Pending, 2=InProgress, 3=Completed, 4=Error, 5=Unknown longhorn_backup_backing_image_state{backup_backing_image="parrot"} 3

CSI

CSI sidecar 컴포넌트는 CSI 작업의 총 개수, 오류 개수, 호출 레이턴시를 다루는 내장 메트릭을 갖고 있어서 사용자가 CSI 작업을 파악할 수 있어요. Longhorn은 각 CSI sidecar 컴포넌트에 --http-endpoint 플래그를 추가해 메트릭을 활성화하고, Prometheus의 PodMonitor로 수집할 수 있어요.

이름 포트
longhorn-csi-attacher 8000
longhorn-csi-provisioner 8000
longhorn-csi-resizer 8000
longhorn-csi-snapshotter 8000

CSI sidecar 컴포넌트가 제공하는 메트릭은 히스토그램 형식이에요. 예를 들어 PVC에 Longhorn Volume 생성이 걸리는 시간을 관찰하는 메트릭을 얻을 수 있어요.

csi_sidecar_operations_seconds_bucket{driver_name="driver.longhorn.io",grpc_status_code="OK",method_name="/csi.v1.Controller/ControllerPublishVolume",le="0.1"} 0
csi_sidecar_operations_seconds_bucket{driver_name="driver.longhorn.io",grpc_status_code="OK",method_name="/csi.v1.Controller/ControllerPublishVolume",le="0.25"} 0
csi_sidecar_operations_seconds_bucket{driver_name="driver.longhorn.io",grpc_status_code="OK",method_name="/csi.v1.Controller/ControllerPublishVolume",le="0.5"} 0
csi_sidecar_operations_seconds_bucket{driver_name="driver.longhorn.io",grpc_status_code="OK",method_name="/csi.v1.Controller/ControllerPublishVolume",le="1"} 0
csi_sidecar_operations_seconds_bucket{driver_name="driver.longhorn.io",grpc_status_code="OK",method_name="/csi.v1.Controller/ControllerPublishVolume",le="2.5"} 3
csi_sidecar_operations_seconds_bucket{driver_name="driver.longhorn.io",grpc_status_code="OK",method_name="/csi.v1.Controller/ControllerPublishVolume",le="5"} 3
csi_sidecar_operations_seconds_bucket{driver_name="driver.longhorn.io",grpc_status_code="OK",method_name="/csi.v1.Controller/ControllerPublishVolume",le="10"} 3
csi_sidecar_operations_seconds_bucket{driver_name="driver.longhorn.io",grpc_status_code="OK",method_name="/csi.v1.Controller/ControllerPublishVolume",le="15"} 9
csi_sidecar_operations_seconds_bucket{driver_name="driver.longhorn.io",grpc_status_code="OK",method_name="/csi.v1.Controller/ControllerPublishVolume",le="25"} 9
csi_sidecar_operations_seconds_bucket{driver_name="driver.longhorn.io",grpc_status_code="OK",method_name="/csi.v1.Controller/ControllerPublishVolume",le="50"} 9
csi_sidecar_operations_seconds_bucket{driver_name="driver.longhorn.io",grpc_status_code="OK",method_name="/csi.v1.Controller/ControllerPublishVolume",le="120"} 9
csi_sidecar_operations_seconds_bucket{driver_name="driver.longhorn.io",grpc_status_code="OK",method_name="/csi.v1.Controller/ControllerPublishVolume",le="300"} 9
csi_sidecar_operations_seconds_bucket{driver_name="driver.longhorn.io",grpc_status_code="OK",method_name="/csi.v1.Controller/ControllerPublishVolume",le="600"} 9
csi_sidecar_operations_seconds_bucket{driver_name="driver.longhorn.io",grpc_status_code="OK",method_name="/csi.v1.Controller/ControllerPublishVolume",le="+Inf"} 9
csi_sidecar_operations_seconds_sum{driver_name="driver.longhorn.io",grpc_status_code="OK",method_name="/csi.v1.Controller/ControllerPublishVolume"} 66.816478825
csi_sidecar_operations_seconds_count{driver_name="driver.longhorn.io",grpc_status_code="OK",method_name="/csi.v1.Controller/ControllerPublishVolume"} 9

더 알아보기 (Learn more)