Files
wbsong111 9676fec2f3 docs: correct VictoriaLogs tenant header to AccountID/ProjectID across docs
otelcol 헤더 수정(aef6439)에 맞춰 아키텍처 문서·vlogs/otelcol CUSTOM-README·
vlogs custom-values 주석의 VictoriaLogs-AccountID 참조를 AccountID/ProjectID 로 정정.
VictoriaLogs-* 접두 헤더 무시(전량 acct0) 경고 추가.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-01 15:45:10 +09:00

2.2 KiB

OpenTelemetry Collector 배포 (로그 + 이벤트 수집)

두 가지 모드로 배포한다.

  • DaemonSet (otelcol) — 모든 노드의 파드 로그 수집 → custom-values.yaml
  • Deployment (otelcol-events) — K8s 이벤트 수집 (단일 인스턴스) → custom-values-events.yaml

1. 배포 방법

# 파드 로그 (DaemonSet)
helm upgrade otelcol open-telemetry/opentelemetry-collector \
  -f custom-values.yaml --install -n monitoring

# K8s 이벤트 (Deployment) — 동일 차트, 다른 values
helm upgrade otelcol-events open-telemetry/opentelemetry-collector \
  -f custom-values-events.yaml --install -n monitoring

이미지는 otel/opentelemetry-collector-contrib를 사용한다(filelog/k8sobjects 등 contrib 컴포넌트 필요).

2. custom-values.yaml (DaemonSet) 설정 설명

파이프라인

파이프라인 흐름 대상
logs/demo01 filelog → filter(namespace=demo01-*) vlinsert AccountID 1
logs/demo02 filelog → filter(namespace=demo02-*) vlinsert AccountID 2
logs/platform filelog → filter(나머지) vlinsert AccountID 0
  • 로그 테넌시: AccountID/ProjectID 헤더로 vlinsert에 격리 전송. namespace는 filelog regex가 log record attribute에 추출하므로 OTTL attributes["namespace"]로 필터한다. ⚠️ VictoriaLogs가 인식하는 테넌트 헤더는 AccountID/ProjectID이며, VictoriaLogs-AccountID 같은 접두 헤더는 무시되어 전량 account 0으로 적재된다(dev 검증에서 확인).
  • 호스트 로그 마운트: /var/log/pods, /var/lib/docker/containers (readOnly).
  • RBAC: k8sattributes 프로세서용 pods/namespaces/nodes/replicasets 권한.

3. custom-values-events.yaml (Deployment) 설정 설명

k8sobjects receiver로 K8s 이벤트를 watch하여 vlinsert(AccountID 0)로 전송한다. 이벤트 중복 방지를 위해 단일 replica로 운영한다.

4. 의존 관계

  • 로그 전송 대상: vlogs vlinsert:9481

5. 검증

kubectl get pods -n monitoring -l app.kubernetes.io/instance=otelcol
kubectl logs -n monitoring ds/otelcol-opentelemetry-collector | grep -i 'started\|error' | head