콘텐츠로 이동

rsdatakit


rsdatakit은 Linux 호스트와 Kubernetes 노드용 경량 수집기로, Rust로 작성되었으며 DataKit/Guance Point v2 형식으로 Dataway에 데이터를 전송합니다.

기능 개요

모듈 기본 상태 수집 내용
호스트 활성화 cpu, mem, disk, diskio, net, system 메트릭 및 HOST 객체.
로그 비활성화 파일 로그, systemd journal, 이어 읽기, 여러 줄 병합 및 파일 로테이션.
OpenTelemetry 비활성화 OTLP/HTTP 또는 OTLP/gRPC를 통해 Trace 수신.
Kubernetes 비활성화 로컬 노드 Pod/컨테이너 메트릭, 객체, 컨테이너 로그 및 Kubernetes 메타데이터 보강.
Prometheus 비활성화 노드 로컬 대상 검색 및 Prometheus/OpenMetrics 스크래핑.

현재 Linux amd64arm64를 지원합니다. Windows, macOS, OTLP Metrics, OTLP Logs, eBPF, 합성 모니터링, 원격 구성 및 DataKit 플러그인 시스템은 지원하지 않습니다.

DataKit 호환성

rsdatakit은 구현된 데이터에 DataKit 호환 메트릭 집합, 객체 분류 및 핵심 필드 이름을 사용하므로 해당 필드에 의존하는 뷰를 재사용할 수 있습니다. 이 문서에 없는 DataKit 전용 필드는 생성하지 않으므로 해당 차트는 비어 있을 수 있습니다.

실행 요구 사항

  • Linux 호스트에서 /proc/sys에 접근할 수 있어야 합니다. journald 수집에는 systemd journal 런타임도 필요합니다.
  • 설치 스크립트로 rsdatakit 서비스를 관리하려면 systemd와 systemctl이 필요합니다.
  • Kubernetes 수집기는 대상 노드에서 DaemonSet으로 실행되어야 하며 Pod 메타데이터, Kubelet Summary 및 호스트 컨테이너 로그 디렉터리를 읽을 수 있어야 합니다.
  • 유효한 Dataway 주소와 token이 필요합니다. 구성 파일과 상태 디렉터리는 실행 사용자만 접근할 수 있어야 합니다.

설치

설치 스크립트는 Linux amd64arm64를 지원하며 root 또는 sudo 권한이 필요하고 systemd로 서비스를 관리합니다. 최신 버전 설치:

RSDATAKIT_DATAWAY_URL="https://openway.guance.com" \
RSDATAKIT_DATAWAY_TOKEN="<DATAWAY_TOKEN>" \
  sh -c "$(curl -fsSL https://static.guance.com/rsdatakit/install.sh)"

특정 버전을 설치하려면 <VERSION>을 전체 버전 번호로 바꾸세요:

RSDATAKIT_DATAWAY_URL="https://openway.guance.com" \
RSDATAKIT_DATAWAY_TOKEN="<DATAWAY_TOKEN>" \
  sh -c "$(curl -fsSL https://static.guance.com/rsdatakit/install-<VERSION>.sh)"

스크립트가 아키텍처 선택, 패키지 검증, 바이너리와 systemd unit 설치를 수행하고 rsdatakit.service를 시작합니다. 기본 구성 파일은 /etc/rsdatakit/rsdatakit.toml입니다.

최신 버전으로 업그레이드하려면 RSDATAKIT_UPGRADE=1을 설정합니다:

RSDATAKIT_UPGRADE=1 \
  sh -c "$(curl -fsSL https://static.guance.com/rsdatakit/install.sh)"

업그레이드 시 바이너리를 교체하고 서비스를 다시 시작하며 /etc/rsdatakit/rsdatakit.toml/var/lib/rsdatakit의 WAL과 수집 상태를 보존합니다. Dataway도 변경하려면 업그레이드 명령에 새 RSDATAKIT_DATAWAY_URLRSDATAKIT_DATAWAY_TOKEN을 전달합니다. 특정 버전으로 업그레이드하려면 install-<VERSION>.sh를 사용합니다.

RSDATAKIT_INSTALL_ONLY=1로 설정하면 서비스를 시작하지 않고 설치 또는 업그레이드합니다. 완료 후 확인:

systemctl is-active rsdatakit
systemctl status rsdatakit --no-pager
journalctl -u rsdatakit -n 30 --no-pager

RustDataKit은 DaemonSet으로 배포되며 Linux 노드마다 수집 인스턴스 하나를 실행합니다. 매니페스트는 linux/amd64linux/arm64를 지원하는 다중 아키텍처 이미지를 참조합니다.

먼저 최신 rsdatakit.yaml을 다운로드합니다:

wget https://static.guance.com/rsdatakit/rsdatakit.yaml

특정 버전을 설치하려면 <VERSION>을 전체 버전 번호로 바꾸세요:

wget -O rsdatakit.yaml https://static.guance.com/rsdatakit/rsdatakit-<VERSION>.yaml

매니페스트의 Dataway URL, 워크스페이스 token 및 OTLP token은 Kubernetes Secret으로 제공합니다. 네임스페이스를 만들고 실제 구성을 입력합니다:

kubectl create namespace rsdatakit-system --dry-run=client -o yaml | kubectl apply -f -
kubectl -n rsdatakit-system create secret generic rsdatakit-secrets \
  --from-literal=dataway-url='https://openway.guance.com' \
  --from-literal=dataway-token='<DATAWAY_TOKEN>' \
  --from-literal=otlp-token='<OTLP_TOKEN>' \
  --dry-run=client -o yaml | kubectl apply -f -

다른 Dataway 노드를 사용하면 dataway-url을 실제 주소로 바꿉니다. OTLP 수신 기능을 사용하지 않으면 otlp-token을 빈 문자열로 설정할 수 있습니다.

YAML 적용:

kubectl apply -f rsdatakit.yaml

설치 후 DaemonSet과 Pod 상태 확인:

kubectl -n rsdatakit-system rollout status daemonset/rsdatakit
kubectl -n rsdatakit-system get pods -l app.kubernetes.io/name=rsdatakit

실행 로그 확인:

kubectl -n rsdatakit-system logs daemonset/rsdatakit --tail=100

구성

기본 구성 경로는 /etc/rsdatakit/rsdatakit.toml입니다. --config <path> 또는 RSDATAKIT_CONFIG로 다른 파일을 지정할 수 있습니다. 구성은 프로세스 시작 시에만 읽으므로 변경 후 다시 시작해야 합니다.

최소 구성:

[agent]
# Local state directory for the WAL and file-log read positions. Must be absolute.
state_dir = "/var/lib/rsdatakit"
# Optional standalone health-listener address. Leave empty to disable it.
health_addr = ""

[dataway]
# Workspace Dataway endpoint.
url = "https://openway.example.com"
# Workspace token.
token = "<DATAWAY_TOKEN>"
# Per-request Dataway timeout in seconds. Valid range: 1–60.
timeout_secs = 15
# Tags added to all reported data.
global_tags = { env = "prod" }
# Target index. Uses the workspace default index when empty.
storage_index = ""

[metrics]
# Host metrics collection interval in seconds. Valid range: 5–300.
interval_secs = 15
# Mount points whose capacity is collected. Maximum: 32. Each must be absolute.
mounts = ["/"]
# Also collect virtual interfaces such as veth, docker0, and cni.
enable_virtual_interfaces = false

[hostobject]
# HOST object reporting interval in seconds. Valid range: 60–3600.
interval_secs = 300

[wal]
# Local write-ahead log directory. Must be absolute.
dir = "/var/lib/rsdatakit/wal"
# Total WAL capacity in bytes. Valid range: 4 MiB–256 MiB; the oldest unsent data is evicted when full.
max_bytes = 268435456

agent.state_dir, logs.state_dir, wal.dir은 절대 경로여야 합니다. 기본 WAL 용량은 256 MiB입니다. 허용 가능한 Dataway 중단 시간과 로그/Trace 쓰기량에 맞게 wal.max_bytes를 조정하세요. 시작 시 RSDATAKIT_DATAWAY_URLRSDATAKIT_DATAWAY_TOKEN으로 구성의 주소와 token을 재정의할 수 있습니다. RSDATAKIT_HEALTH_ADDR은 별도 상태 검사 주소를 재정의합니다.

호스트 수집

호스트 메트릭과 HOST 객체는 기본 활성화되며 별도 enabled 스위치가 필요 없습니다.

데이터 measurement / object 기본 주기 설명
CPU cpu 15초 전체 CPU 사용률.
메모리 mem 15초 용량, 캐시, 사용량 및 백분율.
디스크 용량 disk 15초 [metrics].mounts에 지정한 마운트만 수집하며 기본값은 /입니다.
디스크 I/O diskio 15초 블록 장치 누적값, 읽기/쓰기 속도 및 await.
네트워크 net 15초 기본적으로 UP 상태의 비가상 네트워크 인터페이스만 수집합니다.
시스템 system 15초 부하, CPU/메모리 사용률, 프로세스 수 및 가동 시간.
호스트 객체 HOST 300초 호스트 식별 정보, 운영 체제 및 기본 리소스 정보.

호스트 메트릭 주기는 5~300초, HOST 객체 주기는 60~3600초입니다. CPU, 네트워크, 디스크 I/O 속도는 두 번의 연속 샘플이 필요하므로 시작 직후 첫 수집에는 속도 필드가 없을 수 있습니다.

메트릭

아래 표에는 rsdatakit이 현재 보고하는 필드만 나열합니다. 필드 이름은 DataKit의 동일 메트릭 집합과 호환되지만, DataKit 수집기의 모든 확장 필드를 구현하지는 않습니다.

cpu

Tags & Fields Description
host
(tag)
호스트 이름.
cpu
(tag)
CPU 식별자. 현재 전체 CPU 합계를 뜻하는 cpu-total로 고정됩니다.
usage_user CPU 시간 중 사용자 모드 비율.
Type: float | (gauge)
Unit: percent
usage_nice CPU 시간 중 낮은 우선순위 사용자 모드 비율.
Type: float | (gauge)
Unit: percent
usage_system CPU 시간 중 커널 모드 비율.
Type: float | (gauge)
Unit: percent
usage_idle CPU 시간 중 유휴 비율.
Type: float | (gauge)
Unit: percent
usage_iowait CPU 시간 중 I/O 대기 비율.
Type: float | (gauge)
Unit: percent
usage_irq CPU 시간 중 하드웨어 인터럽트 처리 비율.
Type: float | (gauge)
Unit: percent
usage_softirq CPU 시간 중 소프트웨어 인터럽트 처리 비율.
Type: float | (gauge)
Unit: percent
usage_steal CPU 시간 중 가상화 환경에서 다른 시스템이 점유한 시간 비율.
Type: float | (gauge)
Unit: percent
usage_guest CPU 시간 중 게스트 가상 CPU 실행 비율.
Type: float | (gauge)
Unit: percent
usage_guest_nice CPU 시간 중 낮은 우선순위 게스트 가상 CPU 실행 비율.
Type: float | (gauge)
Unit: percent
usage_total 전체 CPU 사용률.
Type: float | (gauge)
Unit: percent

mem

Tags & Fields Description
host
(tag)
호스트 이름.
total 물리 메모리 총 바이트 수.
Type: int | (gauge)
Unit: digital,B
available 커널이 추정한 현재 가용 메모리 바이트 수.
Type: int | (gauge)
Unit: digital,B
used 사용 메모리. total - free - buffered - cached로 계산합니다.
Type: int | (gauge)
Unit: digital,B
free 미사용 메모리 바이트 수.
Type: int | (gauge)
Unit: digital,B
buffered 커널 buffer 사용 바이트 수.
Type: int | (gauge)
Unit: digital,B
cached page cache 및 회수 가능한 slab 사용 바이트 수.
Type: int | (gauge)
Unit: digital,B
used_percent 전체 메모리 대비 사용 메모리 백분율.
Type: float | (gauge)
Unit: percent
available_percent 전체 메모리 대비 가용 메모리 백분율.
Type: float | (gauge)
Unit: percent

disk

[metrics].mounts의 마운트마다 Point 하나를 생성합니다.

Tags & Fields Description
host
(tag)
호스트 이름.
device
(tag)
마운트 장치 이름. 식별할 수 없으면 unknown입니다.
fstype
(tag)
파일 시스템 유형. 식별할 수 없으면 unknown입니다.
mount_point
(tag)
마운트 경로.
total 파일 시스템 총 용량.
Type: int | (gauge)
Unit: digital,B
free 파일 시스템 가용 용량.
Type: int | (gauge)
Unit: digital,B
used 파일 시스템 사용 용량.
Type: int | (gauge)
Unit: digital,B
used_percent 파일 시스템 사용 용량 백분율.
Type: float | (gauge)
Unit: percent
inodes_total inode 총수. 파일 시스템이 정보를 제공하지 않으면 생성하지 않습니다.
Type: int | (gauge)
Unit: count
inodes_free 여유 inode 수.
Type: int | (gauge)
Unit: count
inodes_used 사용 중인 inode 수.
Type: int | (gauge)
Unit: count
inodes_total_mb inodes_total / 1,000,000의 호환 필드.
Type: int | (gauge)
inodes_free_mb inodes_free / 1,000,000의 호환 필드.
Type: int | (gauge)
inodes_used_mb inodes_used / 1,000,000의 호환 필드.
Type: int | (gauge)
inodes_used_percent inode 사용 백분율.
Type: float | (gauge)
Unit: percent

diskio

I/O 카운터가 있는 Linux 블록 장치마다 Point 하나를 생성합니다.

Tags & Fields Description
host
(tag)
호스트 이름.
name
(tag)
블록 장치 경로. 예: /dev/vda.
serial
(tag)
udev의 장치 일련번호. 식별할 수 없으면 unknown입니다.
reads 시작 이후 완료한 읽기 요청 수.
Type: int | (count)
Unit: count
writes 시작 이후 완료한 쓰기 요청 수.
Type: int | (count)
Unit: count
merged_reads 병합된 읽기 요청 누적 수.
Type: int | (count)
Unit: count
merged_writes 병합된 쓰기 요청 누적 수.
Type: int | (count)
Unit: count
read_bytes 누적 읽기 바이트 수.
Type: int | (count)
Unit: digital,B
write_bytes 누적 쓰기 바이트 수.
Type: int | (count)
Unit: digital,B
read_time 누적 읽기 시간.
Type: int | (count)
Unit: ms
write_time 누적 쓰기 시간.
Type: int | (count)
Unit: ms
io_time 장치의 누적 I/O 실행 시간.
Type: int | (count)
Unit: ms
weighted_io_time 가중 누적 I/O 시간.
Type: int | (count)
Unit: ms
iops_in_progress 현재 처리 중인 I/O 요청 수.
Type: int | (gauge)
Unit: count
read_bytes/sec 수집 주기 내 평균 읽기 속도. 첫 수집에는 생성하지 않습니다.
Type: int | (gauge)
Unit: traffic,B/s
write_bytes/sec 수집 주기 내 평균 쓰기 속도. 첫 수집에는 생성하지 않습니다.
Type: int | (gauge)
Unit: traffic,B/s
await 수집 주기 내 읽기/쓰기 요청당 평균 대기 시간. 첫 수집에는 생성하지 않습니다.
Type: float | (gauge)
Unit: ms

net

필터 조건을 충족하고 이전 샘플이 있는 네트워크 인터페이스마다 Point 하나를 생성합니다.

Tags & Fields Description
host
(tag)
호스트 이름.
interface
(tag)
네트워크 인터페이스 이름.
bytes_sent 인터페이스 누적 송신 바이트 수.
Type: int | (count)
Unit: digital,B
bytes_recv 인터페이스 누적 수신 바이트 수.
Type: int | (count)
Unit: digital,B
packets_sent 인터페이스 누적 송신 패킷 수.
Type: int | (count)
Unit: count
packets_recv 인터페이스 누적 수신 패킷 수.
Type: int | (count)
Unit: count
err_in 인터페이스 누적 수신 오류 수.
Type: int | (count)
Unit: count
err_out 인터페이스 누적 송신 오류 수.
Type: int | (count)
Unit: count
drop_in 인터페이스 누적 수신 드롭 패킷 수.
Type: int | (count)
Unit: count
drop_out 인터페이스 누적 송신 드롭 패킷 수.
Type: int | (count)
Unit: count
bytes_sent/sec 수집 주기 내 초당 송신 바이트 수.
Type: int | (gauge)
Unit: traffic,B/s
bytes_recv/sec 수집 주기 내 초당 수신 바이트 수.
Type: int | (gauge)
Unit: traffic,B/s
packets_sent/sec 수집 주기 내 초당 송신 패킷 수.
Type: int | (gauge)
Unit: count/s
packets_recv/sec 수집 주기 내 초당 수신 패킷 수.
Type: int | (gauge)
Unit: count/s

system

Tags & Fields Description
host
(tag)
호스트 이름.
load1 최근 1분간 시스템 부하.
Type: float | (gauge)
load1_per_core 최근 1분간 부하를 논리 CPU 수로 나눈 값.
Type: float | (gauge)
load5 최근 5분간 시스템 부하.
Type: float | (gauge)
load5_per_core 최근 5분간 부하를 논리 CPU 수로 나눈 값.
Type: float | (gauge)
load15 최근 15분간 시스템 부하.
Type: float | (gauge)
load15_per_core 최근 15분간 부하를 논리 CPU 수로 나눈 값.
Type: float | (gauge)
n_cpus 프로세스에서 보이는 논리 CPU 수.
Type: int | (gauge)
Unit: count
uptime 호스트 부팅 후 가동 시간.
Type: int | (gauge)
Unit: s
cpu_total_usage 이번 cpu.usage_total과 같은 호스트 전체 CPU 사용률. CPU 샘플이 유효하지 않으면 생성하지 않습니다.
Type: float | (gauge)
Unit: percent
memory_usage 이번 mem.used_percent와 같은 메모리 사용률. 메모리 샘플이 유효하지 않으면 생성하지 않습니다.
Type: float | (gauge)
Unit: percent
process_count /proc의 현재 프로세스 디렉터리 수.
Type: int | (gauge)
Unit: count

객체

HOST

Tags & Fields Description
host
(tag)
호스트 이름.
name
(tag)
객체 이름. 현재 host와 같습니다.
os
(tag)
운영 체제. 현재 linux입니다.
arch
(tag)
CPU 아키텍처. 예: x86_64 또는 aarch64.
unicast_ip
(tag)
호스트 유니캐스트 IP. 식별할 수 없으면 생성하지 않습니다.
message 호스트 CPU, 메모리, 네트워크, 디스크 및 시스템 메타데이터를 포함하는 JSON.
Type: string
rs_datakit_ver rsdatakit 버전.
Type: string
cpu_usage 객체 수집 주기 내 CPU 사용률.
Type: float
Unit: percent
num_cpu 논리 CPU 수.
Type: int
Unit: count
mem_used_percent 메모리 사용률.
Type: float
Unit: percent
load 최근 5분간 시스템 부하.
Type: float
disk_total 구성된 마운트의 총 용량.
Type: int
Unit: digital,B
disk_used_percent 구성된 마운트의 전체 사용률.
Type: float
Unit: percent
diskio_read_bytes_per_sec 객체 수집 주기 내 디스크 읽기 속도.
Type: int
Unit: traffic,B/s
diskio_write_bytes_per_sec 객체 수집 주기 내 디스크 쓰기 속도.
Type: int
Unit: traffic,B/s
net_recv_bytes_per_sec 객체 수집 주기 내 네트워크 수신 속도.
Type: int
Unit: traffic,B/s
net_send_bytes_per_sec 객체 수집 주기 내 네트워크 송신 속도.
Type: int
Unit: traffic,B/s
logging_level 현재 RUST_LOG 값. 설정하지 않으면 info입니다.
Type: string
is_docker 컨테이너 내 프로세스 실행 여부. 1은 예, 0은 아니요.
Type: int
start_time 호스트 부팅 시간(Unix 밀리초). 식별할 수 없으면 생성하지 않습니다.
Type: int
Unit: ms

로그 수집

로그는 기본 비활성화됩니다. paths가 비어 있으면 파일을 수집하지 않습니다. 필요한 경로만 지정하고 지나치게 넓은 전역 glob은 피하세요.

[logs]
# Enables file-log collection.
enabled = true
# Absolute path globs for log files to collect.
paths = ["/var/log/my-service/*.log"]
# Log data source name.
source = "my-service"
# service tag added to logs.
service = "my-service"
# Reports first-level members of a top-level JSON object as log fields.
json_as_fields = false
# Maximum number of active files read simultaneously.
max_files = 32
# Interval for rediscovering matching files in seconds.
discovery_secs = 5
# copytruncate log-rotation detection strategy.
copytruncate_mode = "auto"
# Local directory that stores file read positions. Must be absolute.
state_dir = "/var/lib/rsdatakit"

# Effective only when built with the journald feature and libsystemd is available.
journald_enabled = false
# Collects only this systemd unit. Leave empty for all accessible journal entries.
journald_unit = "my-service.service"

[logs.multiline]
# Continuation pattern. Leave empty to report one log point per line.
continuation_regex = "^\\s+"
# Maximum wait time for continuation lines in milliseconds.
flush_timeout_ms = 1000
# Maximum bytes in a merged log entry.
max_bytes = 262144

로그 위치, journald cursor 및 WAL은 상태 디렉터리에 저장됩니다. 다시 시작하면 확인된 위치부터 파일을 이어 읽으며, WAL에 기록되거나 Dataway가 수신한 후에만 위치를 갱신합니다. 연속 행 패턴에 맞는 여러 줄은 하나의 로그로 병합됩니다.

json_as_fields는 기본 비활성화됩니다. 활성화하면 최상위가 객체인 JSON 로그의 첫 계층 멤버를 필드로 보고합니다: 문자열, 불리언, int64, 유한한 float64는 유형을 유지하며, 객체와 배열은 압축된 JSON 문자열로 인코딩됩니다. null과 지원 범위를 벗어난 숫자는 무시합니다. 파싱 실패, 최상위가 객체가 아님, 사용 가능한 필드가 없음 중 하나에 해당하면 원본 message를 유지합니다. JSON 필드는 같은 이름의 수집기 필드를 덮어씁니다. 필드 이름은 Point 규칙으로 정규화하고 256바이트로 제한합니다. Point 하나당 최대 1024개 필드를 유지합니다. time, source, date, storage_index는 각각 json_* 필드로 이름을 바꾸며 Point 시간, 로그 source 또는 저장 인덱스는 바꾸지 않습니다. 다음 설정으로도 활성화할 수 있습니다: RSDATAKIT_LOG_JSON_AS_FIELDS=true. 기존 json_extractRSDATAKIT_LOG_JSON_EXTRACT는 호환 별칭으로 유지됩니다.

journald_enabled = true는 systemd journal 읽기를 추가하며 파일 로그 수집 여부에는 영향을 주지 않습니다. 릴리스 패키지는 journald를 활성화합니다. 소스에서 직접 빌드할 때는 다음을 사용합니다:

cargo build --release --locked --features journald

로그 데이터

로그 measurement는 [logs].source입니다. Kubernetes 컨테이너 로그의 초기 source는 보통 kubernetes로 설정하며, 메타데이터가 일치하면 measurement를 컨테이너 이름으로 바꿉니다.

Tags & Fields Description
host
(tag)
수집 노드의 호스트 이름.
service
(tag)
[logs].service. journald는 _SYSTEMD_UNIT을 우선 사용합니다.
filepath
(tag)
로그 파일 전체 경로. journald는 journald로 고정됩니다.
status
(tag)
현재 info로 고정됩니다. 로그 본문의 수준은 자동 파싱하지 않습니다.
stream
(tag)
CRI/Docker 컨테이너 로그의 stdout 또는 stderr. 일반 파일 로그와 journald에서는 생성하지 않습니다.
message json_as_fields가 비활성화되거나 JSON 변환이 실패하면 원본 단일 행 또는 병합된 여러 행 본문을 유지합니다.
Type: string
<json_key> json_as_fields가 활성화되고 변환이 성공할 때 생성하는 첫 계층 JSON 필드.
Type: string, bool, int, float

메타데이터를 사용할 수 있으면 Kubernetes 컨테이너 로그에 다음 tag도 추가합니다:

Tags & Fields Description
cluster_name_k8s
(tag)
Kubernetes 클러스터 이름.
node_name
(tag)
Pod가 있는 노드.
namespace
(tag)
Pod 네임스페이스.
pod_namespace
(tag)
Pod 네임스페이스 호환 필드.
pod_name
(tag)
Pod 이름.
pod_uid
(tag)
Pod UID。
pod_ip
(tag)
Pod IP. 존재할 때 생성합니다.
container_name
(tag)
컨테이너 이름.
container_id
(tag)
런타임 접두사를 제외한 컨테이너 ID. 식별 가능할 때 생성합니다.
image
(tag)
컨테이너 이미지. 식별 가능할 때 생성합니다.
deployment
(tag)
Deployment 이름. 존재할 때 생성합니다.
daemonset
(tag)
DaemonSet 이름. 존재할 때 생성합니다.
statefulset
(tag)
StatefulSet 이름. 존재할 때 생성합니다.
replica_set
(tag)
ReplicaSet 이름. 존재할 때 생성합니다.
job
(tag)
Job 이름. 존재할 때 생성합니다.
<label_key>
(tag)
[kubernetes].label_tags 허용 목록에 있는 Pod label의 정규화된 key(._로 변환, /는 유지).

OpenTelemetry Trace

OTLP는 기본 비활성화됩니다. 활성화하면 OTLP Trace를 받아 tracing 분류로 전달합니다:

[otlp]
# Starts OTLP HTTP and gRPC receivers.
enabled = true
# OTLP/HTTP listen address.
http_addr = "127.0.0.1:4318"
# OTLP/gRPC listen address. Must differ from http_addr.
grpc_addr = "127.0.0.1:4317"
# Bearer token required for non-local listen addresses. It may be empty for local listening.
bearer_token = ""
# Maximum bytes per OTLP request.
max_request_bytes = 4194304
# Maximum number of concurrent OTLP requests.
max_concurrent_requests = 8
# Total memory budget in bytes for admitted OTLP requests.
max_inflight_bytes = 16777216
프로토콜 주소 / 경로
OTLP/HTTP http://<host>:4318/otel/v1/traces
OTLP/gRPC <host>:4317, 서비스는 opentelemetry.proto.collector.trace.v1.TraceService/Export
상태 검사 http://<health-host>:<health-port>/health. OTLP 활성화 시 http://<host>:4318/health도 사용 가능

HTTP 또는 gRPC를 loopback이 아닌 주소에 바인딩하면 bearer_token을 설정해야 하며 클라이언트는 Authorization: Bearer <token>을 사용합니다. 현재 Trace만 수신하며 OTLP Metrics와 OTLP Logs 요청은 지원하지 않습니다. /healthagent.health_addr로 별도 제공할 수 있습니다. OTLP가 비활성화되면 4317/4318에 바인딩하지 않습니다. 연결 유휴 제한은 30초입니다. HTTP header/body, gRPC 연결 시작, 요청 본문 수신/디코딩에는 각각 65초의 절대 기한이 적용됩니다. gRPC 메시지와 trailers 디코딩이 완료되면 본문 기한을 종료합니다. 이후 매핑, 큐 삽입 및 Dataway/WAL receipt 대기에는 전체 handler 시간 제한이 없으며 활성 요청은 연결 유휴 기한으로 중단되지 않습니다. gRPC 요청 본문이 수신 기한을 넘으면 DeadlineExceeded를 반환하고 전역 수용 예산을 해제합니다.

Trace 데이터

OTLP Span은 tracing 분류로 출력하며 measurement는 opentelemetry로 고정됩니다. 시간 필드 startduration은 마이크로초를 사용하며 Point 타임스탬프는 Span 시작 시간(나노초)을 사용합니다.

Tags & Fields Description
service
(tag)
서비스 이름. Span의 DB, RPC 또는 메시징 시스템 이름을 우선하고 없으면 Resource의 service.name을 사용합니다.
source
(tag)
opentelemetry로 고정됩니다.
span_type
(tag)
현재 요청의 Trace 트리에서 Span 구조 유형: entry, local 또는 exit.
span_kind
(tag)
internal, server, client, producer, consumer 또는 unspecified.
source_type
(tag)
db, message_queue, web 또는 custom.
status
(tag)
ok, error 또는 info.
dk_fingerprint
(tag)
DataKit/Guance Trace 집계 호환용 핑거프린트.
host
(tag)
Trace를 받은 rsdatakit 호스트 이름. Kubernetes 노드 식별 정보는 node_name에 별도 저장합니다.
base_service
(tag)
DB/RPC/메시징 시스템이 service를 덮어쓸 때의 원래 서비스 이름.
collector_source_ip
(tag)
OTLP 클라이언트 원본 IP. 가져올 수 있을 때만 생성합니다.
trace_id 32자리 16진수 Trace ID.
Type: string
span_id 16자리 16진수 Span ID.
Type: string
parent_id 부모 Span ID. 루트 Span은 문자열 0입니다.
Type: string
resource Span 이름.
Type: string
start Span 시작 시간(Unix 마이크로초).
Type: int
Unit: us
duration Span 지속 시간.
Type: int
Unit: us
runtime_id Runtime ID. 존재할 때 생성합니다.
Type: string
message 핵심 ID/시간 필드를 제외한 Span JSON. 최상위 필드로 매핑되지 않은 속성과 이벤트를 포함합니다.
Type: string
error_type exception.type에서 추출한 예외 유형. exception 이벤트가 있을 때만 생성합니다.
Type: string
error_message exception.message에서 추출한 예외 메시지. exception 이벤트가 있을 때만 생성합니다.
Type: string
error_stack exception.stacktrace에서 추출한 예외 스택. exception 이벤트가 있을 때만 생성합니다.
Type: string

일반적인 OTel Resource/Span 속성은 평면 필드로 변환됩니다. 예: db.systemdb_system, db.operation.namedb_operationhttp.request.methodhttp_methodhttp.response.status_codehttp_status_coderpc.systemrpc_systemmessaging.systemmessaging_system. 문자열, 불리언, 정수, 부동소수점은 유형을 유지하고 배열과 객체는 JSON으로 인코딩합니다. 속성 소스당 최대 256개 속성을 처리합니다. 의미 매핑 허용 목록 밖의 속성은 최상위 필드가 되지 않지만 message JSON에 유지됩니다.

의미 속성 필드

아래는 현재 허용 목록의 OTel 속성 매핑입니다. http_status_code를 제외한 필드는 입력 속성의 string, bool, int 또는 float 유형을 유지합니다. 배열과 key/value 객체는 JSON 문자열로 인코딩합니다.

Tags & Fields Description
db_system 입력 db.system 또는 db.system.name.
Type: string | bool | int | float
db_operation 입력 db.operation 또는 db.operation.name.
Type: string | bool | int | float
db_operation_batch_size 입력 db.operation.batch.size.
Type: string | bool | int | float
db_name 입력 db.name 또는 db.namespace.
Type: string | bool | int | float
db_statement 입력 db.statement 또는 db.query.text.
Type: string | bool | int | float
db_collection 입력 db.collection.name.
Type: string | bool | int | float
db_host
(tag)
DB 호출 Span이면 server.address를 우선하고 다음으로 net.peer.name을 사용합니다.
server_address 입력 server.address.
Type: string | bool | int | float
server_port 입력 server.port.
Type: string | bool | int | float
net_host_name 입력 net.host.name.
Type: string | bool | int | float
net_host_port 입력 net.host.port.
Type: string | bool | int | float
network_peer_address 입력 network.peer.address.
Type: string | bool | int | float
network_peer_port 입력 network.peer.port.
Type: string | bool | int | float
network_transport 입력 network.transport.
Type: string | bool | int | float
net_protocol_name 입력 network.protocol.name.
Type: string | bool | int | float
net_protocol_version 입력 network.protocol.version.
Type: string | bool | int | float
network_type 입력 network.type.
Type: string | bool | int | float
network_local_address 입력 network.local.address.
Type: string | bool | int | float
network_local_port 입력 network.local.port.
Type: string | bool | int | float
http_method 입력 http.request.method 또는 호환 속성 http.method.
Type: string | bool | int | float
http_status_code
(tag)
입력 http.response.status_code 또는 호환 속성 http.status_code. 문자열 tag로 통일합니다.
http_route 입력 http.route.
Type: string | bool | int | float
http_target 입력 http.target.
Type: string | bool | int | float
http_scheme 입력 http.scheme.
Type: string | bool | int | float
http_url 입력 http.url.
Type: string | bool | int | float
url_full 입력 url.full.
Type: string | bool | int | float
url_scheme 입력 url.scheme.
Type: string | bool | int | float
url_path 입력 url.path.
Type: string | bool | int | float
url_query 입력 url.query.
Type: string | bool | int | float
client_address 입력 client.address.
Type: string | bool | int | float
client_port 입력 client.port.
Type: string | bool | int | float
user_agent_original 입력 user_agent.original.
Type: string | bool | int | float
error_type 입력 error.type. exception 이벤트에서도 이 필드를 제공할 수 있습니다.
Type: string | bool | int | float
messaging_system 입력 messaging.system.
Type: string | bool | int | float
messaging_operation 입력 messaging.operation 또는 messaging.operation.name.
Type: string | bool | int | float
messaging_operation_type 입력 messaging.operation.type.
Type: string | bool | int | float
messaging_destination_name 입력 messaging.destination.name.
Type: string | bool | int | float
messaging_message_id 입력 messaging.message.id.
Type: string | bool | int | float
rpc_service 입력 rpc.service.
Type: string | bool | int | float
rpc_system 입력 rpc.system 또는 rpc.system.name.
Type: string | bool | int | float
rpc_method 입력 rpc.method.
Type: string | bool | int | float
rpc_grpc_status_code 입력 rpc.grpc.status_code.
Type: string | bool | int | float
exception 입력 exception.
Type: string | bool | int | float
exception_type 입력 exception.type.
Type: string | bool | int | float
exception_message 입력 exception.message.
Type: string | bool | int | float
exception_stacktrace 입력 exception.stacktrace.
Type: string | bool | int | float
container_name container.name 속성에서 입력. Kubernetes 모드에서는 같은 이름의 tag로도 정규화합니다.
Type: string | bool | int | float
container_id container.id 속성에서 입력. Kubernetes 모드에서는 같은 이름의 tag로도 정규화합니다.
Type: string | bool | int | float
image container.image.name 속성에서 입력. Kubernetes 모드에서는 같은 이름의 tag로도 정규화합니다.
Type: string | bool | int | float
k8s_cluster_name 입력 k8s.cluster.name.
Type: string | bool | int | float
k8s_namespace_name 입력 k8s.namespace.name.
Type: string | bool | int | float
k8s_node_name 입력 k8s.node.name.
Type: string | bool | int | float
k8s_pod_name 입력 k8s.pod.name.
Type: string | bool | int | float
k8s_pod_uid 입력 k8s.pod.uid.
Type: string | bool | int | float
k8s_container_name 입력 k8s.container.name.
Type: string | bool | int | float
k8s_deployment_name 입력 k8s.deployment.name.
Type: string | bool | int | float
k8s_replicaset_name 입력 k8s.replicaset.name.
Type: string | bool | int | float
k8s_statefulset_name 입력 k8s.statefulset.name.
Type: string | bool | int | float
k8s_daemonset_name 입력 k8s.daemonset.name.
Type: string | bool | int | float
k8s_job_name 입력 k8s.job.name.
Type: string | bool | int | float
k8s_cronjob_name 입력 k8s.cronjob.name.
Type: string | bool | int | float
process_pid 입력 process.pid.
Type: string | bool | int | float
project 입력 project.
Type: string | bool | int | float
version 입력 version.
Type: string | bool | int | float
env 입력 env.
Type: string | bool | int | float
pod_name pod_name 속성에서 입력. Kubernetes 모드에서는 같은 이름의 tag로도 정규화합니다.
Type: string | bool | int | float
pod_namespace pod_namespace 속성에서 입력. Kubernetes 모드에서는 같은 이름의 tag로도 정규화합니다.
Type: string | bool | int | float
sdk_language 입력 telemetry.sdk.language.
Type: string | bool | int | float
sdk_name 입력 telemetry.sdk.name.
Type: string | bool | int | float
sdk_version 입력 telemetry.sdk.version.
Type: string | bool | int | float

Kubernetes 모드에서 Trace에도 컨테이너 로그와 같은 클러스터, Node, Pod, Container, workload 및 허용된 label tag를 추가할 수 있습니다. OTel Resource 식별 정보를 우선하고 누락된 항목만 로컬 Pod 캐시로 보완합니다.

Kubernetes 수집

[kubernetes].enabled = true로 Kubernetes 모드를 활성화합니다. DaemonSet은 로컬 Pod 메타데이터, Kubelet /stats/summary 및 호스트 /var/log/pods에서 데이터를 수집합니다:

데이터 출력
Pod 메트릭 kube_pod
컨테이너 메트릭 docker_containers
Pod 객체 kubelet_pod
컨테이너 객체 docker_containers
컨테이너 로그 logging. Pod, 컨테이너, 이미지, namespace, workload 등의 컨텍스트를 자동 추가합니다.
[kubernetes]
# Enables Kubernetes collection.
enabled = true
# Reports Pod and container metrics.
metrics_enabled = true
# Reports Pod and container objects.
objects_enabled = true
# Kubernetes cluster name.
cluster_name = "default"
# Local Pod metadata refresh interval in seconds.
refresh_secs = 60
# Pod and container object reporting interval in seconds.
object_interval_secs = 300
# Allowlist of Pod labels added to reported data.
label_tags = ["app.kubernetes.io/name"]

metrics_enabledobjects_enabled는 독립적으로 제어합니다. 메트릭은 기본 60초마다 수집하며 객체는 시작 즉시 보고한 뒤 기본 5분마다 보고합니다. label_tags는 태그 카디널리티를 제어하는 Pod label 허용 목록입니다.

rsdatakit은 HTTPS와 자동 마운트된 ServiceAccount bearer token으로 Kubelet에 접근하며 nodes/stats RBAC 권한으로 인가합니다. 노드 자체 서명 인증서와 Node IP SAN이 없는 클러스터를 지원하기 위해 Kubelet 연결의 서버 인증서는 검증하지 않습니다. Kubernetes API는 별도 클라이언트를 사용하고 ServiceAccount CA로 인증서를 엄격하게 검증합니다.

프로젝트 DaemonSet 예제는 /var/log/pods, /var/lib/docker/containers/var/lib/rsdatakit도 마운트합니다. 컨테이너 로그는 노드 로컬 파일에서 읽으며 로그마다 Kubernetes API를 호출하지 않습니다. Pod 메타데이터는 공유 로컬 노드 캐시로 보완합니다.

메트릭

Kubelet Summary가 제공하지 않는 선택 필드는 생성하지 않습니다. CPU, 메모리, 파일 시스템 및 네트워크 누적값은 로컬 Kubelet /stats/summary에서 가져오며 request, limit, ready, restart 및 workload tag는 Pod API 메타데이터에서 가져옵니다.

kube_pod

로컬 Pod마다 Point 하나를 생성합니다.

Tags & Fields Description
cluster_name_k8s
(tag)
Kubernetes 클러스터 이름.
node_name
(tag)
Pod가 있는 노드.
namespace
(tag)
Pod 네임스페이스.
pod_namespace
(tag)
DataKit 호환 Pod 네임스페이스 필드. Pod API 메타데이터가 있을 때 생성합니다.
pod
(tag)
Kubelet Summary의 Pod 이름.
pod_name
(tag)
Pod 이름.
uid
(tag)
Kubelet Summary의 Pod UID.
pod_uid
(tag)
Pod UID。
pod_ip
(tag)
Pod IP. 메타데이터가 있을 때 생성합니다.
deployment
(tag)
Deployment 이름. ReplicaSet이 Pod를 관리하고 pod-template-hash로 추론할 수 있을 때 생성합니다.
daemonset
(tag)
Pod를 관리하는 DaemonSet 이름. 존재할 때 생성합니다.
statefulset
(tag)
Pod를 관리하는 StatefulSet 이름. 존재할 때 생성합니다.
replica_set
(tag)
Pod를 관리하는 ReplicaSet 이름. 존재할 때 생성합니다.
job
(tag)
Pod를 관리하는 Job 이름. 존재할 때 생성합니다.
<label_key>
(tag)
[kubernetes].label_tags 허용 목록에 있는 Pod label의 정규화된 key(._로 변환, /는 유지).
cpu_usage_millicores 현재 CPU 사용량.
Type: float | (gauge)
Unit: mCPU
cpu_usage 현재 CPU 사용량. 단일 코어는 100%이며 다중 코어에서는 100%를 넘을 수 있습니다.
Type: float | (gauge)
Unit: percent
cpu_usage_base100 현재 CPU 사용량을 Node CPU 용량으로 나눈 값. 용량을 가져올 수 있을 때 생성합니다.
Type: float | (gauge)
Unit: percent
cpu_usage_core_nano_seconds 누적 CPU 사용 시간.
Type: int | (count)
Unit: ns
cpu_limit_millicores Pod 내 일반 컨테이너 CPU limit 합계; 구성하지 않으면 생성하지 않습니다.
Type: float | (gauge)
Unit: mCPU
cpu_request_millicores Pod 내 일반 컨테이너 CPU request 합계; 구성하지 않으면 생성하지 않습니다.
Type: float | (gauge)
Unit: mCPU
cpu_usage_base_limit CPU limit 대비 CPU 사용량 백분율; limit가 설정되고 사용량이 있을 때 생성합니다.
Type: float | (gauge)
Unit: percent
cpu_usage_base_request CPU request 대비 CPU 사용량 백분율; request가 설정되고 사용량이 있을 때 생성합니다.
Type: float | (gauge)
Unit: percent
mem_available 현재 가용 메모리.
Type: int | (gauge)
Unit: digital,B
mem_usage 현재 working set 메모리.
Type: int | (gauge)
Unit: digital,B
mem_working_set 현재 working set 메모리. mem_usage와 같습니다.
Type: int | (gauge)
Unit: digital,B
memory_usage_bytes 현재 working set 메모리 호환 필드. mem_usage와 같습니다.
Type: int | (gauge)
Unit: digital,B
mem_rss 상주 메모리.
Type: int | (gauge)
Unit: digital,B
mem_capacity Node 메모리 용량. Node 용량을 가져올 수 있을 때 생성합니다.
Type: int | (gauge)
Unit: digital,B
memory_capacity Node 메모리 용량 호환 필드. mem_capacity와 같습니다.
Type: int | (gauge)
Unit: digital,B
mem_used_percent Node 메모리 용량 대비 working set 백분율.
Type: float | (gauge)
Unit: percent
memory_used_percent mem_used_percent의 호환 필드.
Type: float | (gauge)
Unit: percent
mem_limit Pod 내 일반 컨테이너 메모리 limit 합계; 구성하지 않으면 생성하지 않습니다.
Type: float | (gauge)
Unit: digital,B
mem_request Pod 내 일반 컨테이너 메모리 request 합계; 구성하지 않으면 생성하지 않습니다.
Type: float | (gauge)
Unit: digital,B
mem_used_percent_base_limit 메모리 limit 대비 메모리 사용량 백분율; limit가 설정되고 사용량이 있을 때 생성합니다.
Type: float | (gauge)
Unit: percent
mem_used_percent_base_request 메모리 request 대비 메모리 사용량 백분율; request가 설정되고 사용량이 있을 때 생성합니다.
Type: float | (gauge)
Unit: percent
network_bytes_rcvd Pod 누적 수신 바이트 수.
Type: int | (count)
Unit: digital,B
network_bytes_sent Pod 누적 송신 바이트 수.
Type: int | (count)
Unit: digital,B
network_errors_rcvd Pod 누적 네트워크 수신 오류 수.
Type: int | (count)
Unit: count
network_errors_sent Pod 누적 네트워크 송신 오류 수.
Type: int | (count)
Unit: count
ephemeral_storage_available_bytes Pod 임시 스토리지 가용 용량.
Type: int | (gauge)
Unit: digital,B
ephemeral_storage_capacity_bytes Pod 임시 스토리지 총 용량.
Type: int | (gauge)
Unit: digital,B
ephemeral_storage_used_bytes Pod 임시 스토리지 사용 용량.
Type: int | (gauge)
Unit: digital,B
ephemeral_storage_inodes Pod 임시 스토리지 inode 총수.
Type: int | (gauge)
Unit: count
ephemeral_storage_inodes_free Pod 임시 스토리지 여유 inode 수.
Type: int | (gauge)
Unit: count
ephemeral_storage_inodes_used Pod 임시 스토리지 사용 inode 수.
Type: int | (gauge)
Unit: count
ready 현재 running 상태의 일반 컨테이너 수.
Type: float | (gauge)
Unit: count
restarts 일반 컨테이너 중 최대 재시작 횟수.
Type: float | (gauge)
Unit: count

docker_containers(Kubernetes 메트릭)

로컬 컨테이너마다 Point 하나를 생성합니다. 컨테이너 네트워크는 Pod 수준의 kube_pod가 보고하므로 여기에 네트워크 필드는 없습니다.

Tags & Fields Description
cluster_name_k8s
(tag)
Kubernetes 클러스터 이름.
host
(tag)
컨테이너가 있는 노드. node_name과 같습니다.
node_name
(tag)
컨테이너가 있는 노드.
namespace
(tag)
Pod 네임스페이스.
pod_namespace
(tag)
Pod 네임스페이스 호환 필드. 메타데이터가 있을 때 생성합니다.
pod_name
(tag)
Pod 이름.
pod_uid
(tag)
Pod UID。
pod_ip
(tag)
Pod IP. 메타데이터가 있을 때 생성합니다.
container_name
(tag)
컨테이너 이름.
container_id
(tag)
runtime 접두사를 제외한 컨테이너 ID. 메타데이터가 있을 때 생성합니다.
container_runtime
(tag)
컨테이너 런타임. 예: containerd.
container_type
(tag)
kubernetes로 고정됩니다.
image
(tag)
컨테이너 이미지.
state
(tag)
Kubelet Summary의 컨테이너는 현재 running으로 고정됩니다.
deployment
(tag)
Deployment 이름. 존재할 때 생성합니다.
daemonset
(tag)
DaemonSet 이름. 존재할 때 생성합니다.
statefulset
(tag)
StatefulSet 이름. 존재할 때 생성합니다.
replica_set
(tag)
ReplicaSet 이름. 존재할 때 생성합니다.
job
(tag)
Job 이름. 존재할 때 생성합니다.
<label_key>
(tag)
[kubernetes].label_tags 허용 목록의 Pod label 정규화 key.
cpu_usage_millicores 현재 컨테이너 CPU 사용량.
Type: float | (gauge)
Unit: mCPU
cpu_usage 현재 컨테이너 CPU 사용량. 단일 코어는 100%입니다.
Type: float | (gauge)
Unit: percent
cpu_usage_base100 컨테이너 CPU 사용량을 Node CPU 용량으로 나눈 값. 용량을 가져올 수 있을 때 생성합니다.
Type: float | (gauge)
Unit: percent
cpu_usage_core_nano_seconds 컨테이너 누적 CPU 사용 시간.
Type: int | (count)
Unit: ns
cpu_limit_millicores 컨테이너 CPU limit; 구성하지 않으면 생성하지 않습니다.
Type: float | (gauge)
Unit: mCPU
cpu_request_millicores 컨테이너 CPU request; 구성하지 않으면 생성하지 않습니다.
Type: float | (gauge)
Unit: mCPU
cpu_usage_base_limit 컨테이너 CPU limit 대비 CPU 사용량 백분율.
Type: float | (gauge)
Unit: percent
cpu_usage_base_request 컨테이너 CPU request 대비 CPU 사용량 백분율.
Type: float | (gauge)
Unit: percent
mem_available 현재 컨테이너 가용 메모리.
Type: int | (gauge)
Unit: digital,B
mem_usage 컨테이너 working set 메모리.
Type: int | (gauge)
Unit: digital,B
mem_working_set 컨테이너 working set 메모리. mem_usage와 같습니다.
Type: int | (gauge)
Unit: digital,B
memory_usage_bytes mem_usage의 호환 필드.
Type: int | (gauge)
Unit: digital,B
mem_rss 컨테이너 상주 메모리.
Type: int | (gauge)
Unit: digital,B
mem_capacity Node 메모리 용량. 가져올 수 있을 때 생성합니다.
Type: int | (gauge)
Unit: digital,B
memory_capacity mem_capacity의 호환 필드.
Type: int | (gauge)
Unit: digital,B
mem_used_percent Node 메모리 용량 대비 컨테이너 working set 백분율.
Type: float | (gauge)
Unit: percent
memory_used_percent mem_used_percent의 호환 필드.
Type: float | (gauge)
Unit: percent
mem_limit 컨테이너 메모리 limit; 구성하지 않으면 생성하지 않습니다.
Type: float | (gauge)
Unit: digital,B
mem_request 컨테이너 메모리 request; 구성하지 않으면 생성하지 않습니다.
Type: float | (gauge)
Unit: digital,B
mem_used_percent_base_limit 컨테이너 메모리 limit 대비 메모리 사용량 백분율.
Type: float | (gauge)
Unit: percent
mem_used_percent_base_request 컨테이너 메모리 request 대비 메모리 사용량 백분율.
Type: float | (gauge)
Unit: percent
ephemeral_storage_available_bytes 컨테이너 rootfs 가용 용량.
Type: int | (gauge)
Unit: digital,B
ephemeral_storage_capacity_bytes 컨테이너 rootfs 총 용량.
Type: int | (gauge)
Unit: digital,B
ephemeral_storage_used_bytes 컨테이너 rootfs 사용 용량.
Type: int | (gauge)
Unit: digital,B
ephemeral_storage_inodes 컨테이너 rootfs inode 총수.
Type: int | (gauge)
Unit: count
ephemeral_storage_inodes_free 컨테이너 rootfs 여유 inode 수.
Type: int | (gauge)
Unit: count
ephemeral_storage_inodes_used 컨테이너 rootfs 사용 inode 수.
Type: int | (gauge)
Unit: count
log_available_bytes 컨테이너 로그 파일 시스템 가용 용량.
Type: int | (gauge)
Unit: digital,B
log_capacity_bytes 컨테이너 로그 파일 시스템 총 용량.
Type: int | (gauge)
Unit: digital,B
log_used_bytes 컨테이너 로그 파일 시스템 사용 용량.
Type: int | (gauge)
Unit: digital,B
log_inodes 컨테이너 로그 파일 시스템 inode 총수.
Type: int | (gauge)
Unit: count
log_inodes_free 컨테이너 로그 파일 시스템 여유 inode 수.
Type: int | (gauge)
Unit: count
log_inodes_used 컨테이너 로그 파일 시스템 사용 inode 수.
Type: int | (gauge)
Unit: count

객체

객체는 DataKit 페이지와 호환되는 분류를 사용합니다. 객체 message는 현재 객체 필드의 JSON 스냅샷입니다. 이번 수집에서 Kubelet Summary를 사용할 수 있으면 동일한 Pod/컨테이너 리소스 필드도 포함합니다. 아래 표에 각 필드를 나열합니다.

kubelet_pod 객체

Tags & Fields Description
name
(tag)
객체 이름. Pod UID로 고정됩니다.
uid
(tag)
Pod UID。
pod_name
(tag)
Pod 이름.
namespace
(tag)
Pod 네임스페이스.
pod_namespace
(tag)
Pod 네임스페이스 호환 필드.
cluster_name_k8s
(tag)
Kubernetes 클러스터 이름.
node_name
(tag)
Pod가 있는 노드. 아직 스케줄되지 않은 Pod에는 생성하지 않습니다.
host
(tag)
Pod가 있는 노드. node_name과 같습니다.
pod
(tag)
Kubelet Summary의 Pod 이름. Summary를 사용할 수 있을 때 생성합니다.
phase
(tag)
Pod phase. 예: Running, Pending.
status
(tag)
현재 Pod 상태. 컨테이너 waiting reason을 우선하고 없으면 Pod phase를 사용합니다.
pod_ip
(tag)
Pod IP. 존재할 때 생성합니다.
qos_class
(tag)
Pod QoS class. 존재할 때 생성합니다.
workload_name
(tag)
정규화된 워크로드 이름. Deployment를 우선하고 없으면 처음 식별한 owner를 사용합니다.
deployment
(tag)
Deployment 이름. 존재할 때 생성합니다.
daemonset
(tag)
DaemonSet 이름. 존재할 때 생성합니다.
statefulset
(tag)
StatefulSet 이름. 존재할 때 생성합니다.
replica_set
(tag)
ReplicaSet 이름. 존재할 때 생성합니다.
job
(tag)
Job 이름. 존재할 때 생성합니다.
<label_key>
(tag)
[kubernetes].label_tags 허용 목록의 Pod label 정규화 key.
available Pod 내 일반 컨테이너 총수.
Type: int
Unit: count
ready 현재 running 상태의 일반 컨테이너 수.
Type: int
Unit: count
restarts 일반 컨테이너 중 최대 재시작 횟수.
Type: int
Unit: count
age Pod 생성 후 경과한 초.
Type: int
Unit: s
cpu_usage_millicores 현재 Pod CPU 사용량. Kubelet Summary를 사용할 수 있을 때 생성합니다.
Type: float
Unit: mCPU
cpu_usage 현재 Pod CPU 사용량. 단일 코어는 100%입니다.
Type: float
Unit: percent
cpu_usage_base100 Pod CPU 사용량을 Node CPU 용량으로 나눈 값.
Type: float
Unit: percent
cpu_usage_core_nano_seconds Pod 누적 CPU 사용 시간.
Type: int
Unit: ns
cpu_limit_millicores Pod 내 일반 컨테이너 CPU limit 합계.
Type: float
Unit: mCPU
cpu_request_millicores Pod 내 일반 컨테이너 CPU request 합계.
Type: float
Unit: mCPU
cpu_usage_base_limit Pod CPU limit 대비 CPU 사용량 백분율.
Type: float
Unit: percent
cpu_usage_base_request Pod CPU request 대비 CPU 사용량 백분율.
Type: float
Unit: percent
mem_available 현재 Pod 가용 메모리.
Type: int
Unit: digital,B
mem_usage Pod working set 메모리.
Type: int
Unit: digital,B
mem_working_set Pod working set 메모리. mem_usage와 같습니다.
Type: int
Unit: digital,B
memory_usage_bytes mem_usage의 호환 필드.
Type: int
Unit: digital,B
mem_rss Pod 상주 메모리.
Type: int
Unit: digital,B
mem_capacity Node 메모리 용량.
Type: int
Unit: digital,B
memory_capacity mem_capacity의 호환 필드.
Type: int
Unit: digital,B
mem_used_percent Node 메모리 용량 대비 Pod working set 백분율.
Type: float
Unit: percent
memory_used_percent mem_used_percent의 호환 필드.
Type: float
Unit: percent
mem_limit Pod 내 일반 컨테이너 메모리 limit 합계.
Type: float
Unit: digital,B
mem_request Pod 내 일반 컨테이너 메모리 request 합계.
Type: float
Unit: digital,B
mem_used_percent_base_limit Pod 메모리 limit 대비 메모리 사용량 백분율.
Type: float
Unit: percent
mem_used_percent_base_request Pod 메모리 request 대비 메모리 사용량 백분율.
Type: float
Unit: percent
network_bytes_rcvd Pod 누적 수신 바이트 수.
Type: int
Unit: digital,B
network_bytes_sent Pod 누적 송신 바이트 수.
Type: int
Unit: digital,B
network_errors_rcvd Pod 누적 네트워크 수신 오류 수.
Type: int
Unit: count
network_errors_sent Pod 누적 네트워크 송신 오류 수.
Type: int
Unit: count
ephemeral_storage_available_bytes Pod 임시 스토리지 가용 용량.
Type: int
Unit: digital,B
ephemeral_storage_capacity_bytes Pod 임시 스토리지 총 용량.
Type: int
Unit: digital,B
ephemeral_storage_used_bytes Pod 임시 스토리지 사용 용량.
Type: int
Unit: digital,B
ephemeral_storage_inodes Pod 임시 스토리지 inode 총수.
Type: int
Unit: count
ephemeral_storage_inodes_free Pod 임시 스토리지 여유 inode 수.
Type: int
Unit: count
ephemeral_storage_inodes_used Pod 임시 스토리지 사용 inode 수.
Type: int
Unit: count
message 객체 JSON 스냅샷.
Type: string

docker_containers 객체

Tags & Fields Description
name
(tag)
객체 이름. 컨테이너 ID로 고정됩니다.
container_id
(tag)
runtime 접두사를 제외한 컨테이너 ID.
container_name
(tag)
컨테이너 이름.
container_runtime
(tag)
컨테이너 런타임. 예: containerd. 가져올 수 있을 때 생성합니다.
image
(tag)
컨테이너 이미지. 가져올 수 있을 때 생성합니다.
container_type
(tag)
kubernetes로 고정됩니다.
state
(tag)
현재 running으로 고정됩니다.
cluster_name_k8s
(tag)
Kubernetes 클러스터 이름.
host
(tag)
컨테이너가 있는 노드.
node_name
(tag)
컨테이너가 있는 노드.
namespace
(tag)
Pod 네임스페이스.
pod_namespace
(tag)
Pod 네임스페이스 호환 필드. 원본 메트릭에 이 tag가 있으면 유지합니다.
pod_name
(tag)
Pod 이름.
pod_uid
(tag)
Pod UID。
pod_ip
(tag)
Pod IP. 원본 메트릭에 이 tag가 있으면 유지합니다.
workload_name
(tag)
정규화된 워크로드 이름. 존재할 때 생성합니다.
deployment
(tag)
Deployment 이름. 존재할 때 생성합니다.
daemonset
(tag)
DaemonSet 이름. 존재할 때 생성합니다.
statefulset
(tag)
StatefulSet 이름. 존재할 때 생성합니다.
replica_set
(tag)
ReplicaSet 이름. 존재할 때 생성합니다.
job
(tag)
Job 이름. 존재할 때 생성합니다.
<label_key>
(tag)
[kubernetes].label_tags 허용 목록의 Pod label 정규화 key.
age 컨테이너 시작 후 경과한 초. 시작 시간을 가져올 수 있을 때 생성합니다.
Type: int
Unit: s
cpu_usage_millicores 현재 컨테이너 CPU 사용량.
Type: float
Unit: mCPU
cpu_usage 현재 컨테이너 CPU 사용량.
Type: float
Unit: percent
cpu_usage_base100 컨테이너 CPU 사용량을 Node CPU 용량으로 나눈 값.
Type: float
Unit: percent
cpu_usage_core_nano_seconds 컨테이너 누적 CPU 사용 시간.
Type: int
Unit: ns
cpu_limit_millicores 컨테이너 CPU limit.
Type: float
Unit: mCPU
cpu_request_millicores 컨테이너 CPU request.
Type: float
Unit: mCPU
cpu_usage_base_limit 컨테이너 CPU limit 대비 CPU 사용량 백분율.
Type: float
Unit: percent
cpu_usage_base_request 컨테이너 CPU request 대비 CPU 사용량 백분율.
Type: float
Unit: percent
mem_available 현재 컨테이너 가용 메모리.
Type: int
Unit: digital,B
mem_usage 컨테이너 working set 메모리.
Type: int
Unit: digital,B
mem_working_set 컨테이너 working set 메모리. mem_usage와 같습니다.
Type: int
Unit: digital,B
memory_usage_bytes mem_usage의 호환 필드.
Type: int
Unit: digital,B
mem_rss 컨테이너 상주 메모리.
Type: int
Unit: digital,B
mem_capacity Node 메모리 용량.
Type: int
Unit: digital,B
memory_capacity mem_capacity의 호환 필드.
Type: int
Unit: digital,B
mem_used_percent Node 메모리 용량 대비 컨테이너 working set 백분율.
Type: float
Unit: percent
memory_used_percent mem_used_percent의 호환 필드.
Type: float
Unit: percent
mem_limit 컨테이너 메모리 limit.
Type: float
Unit: digital,B
mem_request 컨테이너 메모리 request.
Type: float
Unit: digital,B
mem_used_percent_base_limit 컨테이너 메모리 limit 대비 메모리 사용량 백분율.
Type: float
Unit: percent
mem_used_percent_base_request 컨테이너 메모리 request 대비 메모리 사용량 백분율.
Type: float
Unit: percent
ephemeral_storage_available_bytes 컨테이너 rootfs 가용 용량.
Type: int
Unit: digital,B
ephemeral_storage_capacity_bytes 컨테이너 rootfs 총 용량.
Type: int
Unit: digital,B
ephemeral_storage_used_bytes 컨테이너 rootfs 사용 용량.
Type: int
Unit: digital,B
ephemeral_storage_inodes 컨테이너 rootfs inode 총수.
Type: int
Unit: count
ephemeral_storage_inodes_free 컨테이너 rootfs 여유 inode 수.
Type: int
Unit: count
ephemeral_storage_inodes_used 컨테이너 rootfs 사용 inode 수.
Type: int
Unit: count
log_available_bytes 컨테이너 로그 파일 시스템 가용 용량.
Type: int
Unit: digital,B
log_capacity_bytes 컨테이너 로그 파일 시스템 총 용량.
Type: int
Unit: digital,B
log_used_bytes 컨테이너 로그 파일 시스템 사용 용량.
Type: int
Unit: digital,B
log_inodes 컨테이너 로그 파일 시스템 inode 총수.
Type: int
Unit: count
log_inodes_free 컨테이너 로그 파일 시스템 여유 inode 수.
Type: int
Unit: count
log_inodes_used 컨테이너 로그 파일 시스템 사용 inode 수.
Type: int
Unit: count
message 객체 JSON 스냅샷.
Type: string

Prometheus 수집

Prometheus 스크래핑은 Kubernetes 모드의 일부입니다. 독립 바이너리는 기본 비활성화, 프로젝트 DaemonSet 예제는 기본 활성화됩니다:

[kubernetes.prometheus]
# Enables local Prometheus target discovery and scraping.
enabled = true
# Scrape interval per target in seconds.
scrape_interval_secs = 30
# Timeout per scrape in seconds.
scrape_timeout_secs = 10
# Keeps the full exporter metric name as the field name.
keep_exist_metric_name = true
# Discovers Pods annotated with prometheus.io/scrape.
discover_pod_annotations = true
# Discovers Services annotated with prometheus.io/scrape.
discover_service_annotations = true
# Discovers Prometheus Operator PodMonitors.
discover_pod_monitors = true
# Discovers Prometheus Operator ServiceMonitors.
discover_service_monitors = true

자동 검색 외에도 신뢰할 수 있는 대상을 명시적으로 구성할 수 있습니다:

[[kubernetes.prometheus.instances]]
# Target source type.
role = "pod" # node | pod | service | endpoints
# Namespaces containing the targets.
namespaces = ["default"]
# Kubernetes label selector。
selector = "app=nginx"
# Scrape scheme.
scheme = "http"
# Numeric or named port.
port = "metrics"
# HTTP metrics path.
path = "/metrics"
# Measurement name. Derived automatically when empty.
measurement = ""
# Tags added to all metrics from this target.
tags = { team = "platform" }

지원하는 대상 소스:

  • Pod/Service의 prometheus.io/scrape, port, scheme, path 등의 annotations;
  • Prometheus Operator의 PodMonitor 및 ServiceMonitor;
  • 신뢰할 수 있는 정적 구성의 node, pod, service, endpoints 인스턴스.

로컬 노드에 속함을 확인할 수 있는 대상만 스크래핑하여 각 DaemonSet 복제본이 전체 클러스터를 중복 수집하지 않도록 합니다. 수집한 measurement는 exporter 메트릭 이름 또는 정적 measurement 구성으로 결정되며, collector.up은 각 대상의 스크래핑 결과를 나타냅니다.

필요 없는 검색 기능의 discover_* 스위치를 끄세요. Service annotation과 ServiceMonitor가 비활성화되고 service/endpoints 명시적 인스턴스도 없으면 전역 Service 및 EndpointSlice 리소스를 구독하지 않습니다.

메트릭 변환 규칙

Prometheus exporter의 measurement와 field는 메트릭 이름에서 동적으로 생성되므로 고정 호스트 메트릭처럼 모두 나열할 수 없습니다:

구성 / 입력 출력 규칙
measurement 미설정, 메트릭 이름에 _ 포함 _ 앞부분을 measurement로 사용합니다. 예: http_requests_total → measurement http.
keep_exist_metric_name = true field는 전체 메트릭 이름을 유지합니다. requests_total 또는 http_requests_total 등 measurement의 명시적 설정 여부에 따라 달라집니다.
keep_exist_metric_name = false measurement를 명시하지 않으면 첫 _까지의 접두사를 제거합니다. 예: http_requests_total → measurement http, field requests_total.
measurement 명시적 설정 모든 샘플을 해당 measurement에 쓰며 field는 전체 이름 또는 위 유지 규칙을 적용합니다.
Prometheus label tag로 변환합니다. 대상의 Kubernetes 식별 tag가 exporter의 같은 이름 식별 label보다 우선합니다.
Counter 누적 합계로 보고하며 이름에 _total이 없으면 추가합니다.
Histogram / Summary _sum, _count, _bucketle/quantile tag로 확장합니다.
Info / StateSet Info는 값이 1인 gauge로, StateSet은 상태별 0 또는 1로 변환합니다.

스크래핑마다 수집기 상태 메트릭도 생성합니다:

collector

Tags & Fields Description
host
(tag)
대상의 non-loopback IP. 확인할 수 없으면 빈 문자열입니다.
job
(tag)
검색되거나 명시적으로 구성된 Prometheus job.
대상 tags
(tag)
대상 자체의 Pod, Service, Node, namespace, instance 등의 tag.
up 이번 대상 스크래핑과 파싱이 성공하면 1, 실패하면 0.
Type: float | (gauge)

실행 및 검증

포그라운드 실행:

sudo RUST_LOG=rsdatakit=info rsdatakit --config /etc/rsdatakit/rsdatakit.toml

systemd 설치 후 사용:

sudo systemctl restart rsdatakit
sudo systemctl status rsdatakit
sudo journalctl -u rsdatakit -f
kubectl -n rsdatakit-system rollout status daemonset/rsdatakit
kubectl -n rsdatakit-system get pods -l app=rsdatakit
kubectl -n rsdatakit-system logs daemonset/rsdatakit --tail=100

시작 로그에 rsdatakit started가 나타나면 중앙 화면에서 다음 데이터를 확인합니다:

기능 검증 내용
호스트 cpu, mem, disk, diskio, net, system 메트릭 및 HOST 객체.
로그 [logs].source 데이터 소스, 수집기 tag 및 원본 message 또는 json_as_fields의 JSON 필드.
Trace opentelemetry 데이터 소스의 서비스, Span 계층 및 Trace ID.
Kubernetes kube_pod, docker_containers 메트릭 및 Pod/컨테이너 객체.
Prometheus exporter 메트릭 및 collector.up.

별도 상태 주소를 설정하거나 OTLP HTTP를 활성화하면 상태를 확인할 수 있습니다. 예:

curl http://127.0.0.1:4319/health

degraded는 Dataway, WAL 또는 수집 모듈에 현재 장애가 있음을 뜻합니다. HTTP 503은 큐, WAL 또는 백그라운드 작업이 비정상 상태임을 뜻합니다.

참고 사항

  • 로그와 Trace는 네트워크 오류, HTTP 5xx 또는 429에서 WAL에 쓰고 재시도하며 다른 4xx는 재시도하지 않습니다. 메트릭과 객체는 주기적 스냅샷이며 WAL에 쓰지 않습니다.
  • 로그/Trace 쓰기량과 허용 Dataway 중단 시간에 맞게 wal.max_bytes를 조정하세요.
  • Dataway token과 OTLP bearer token은 Secret 또는 접근이 제한된 구성 파일로 주입하고 저장소에 커밋하지 마세요.
  • 높은 카디널리티를 피하려면 kubernetes.label_tags에 필요한 Pod label만 추가하세요.
  • RUST_LOG=rsdatakit=debug는 많은 로그를 생성하므로 짧은 문제 해결 시에만 사용하세요.

문서 평가

이 페이지가 도움이 되었나요?