Loki 로그 수집 구조 (운영 중)

Loki 로그 수집 구조 (운영 중) An architecture diagram generated by Archify. K8s API · 파드 로그 스트림 · Architecture component K8s API 파드 로그 스트림 Alloy · DaemonSet · 전 노드 · Architecture component · hostPath 불필요 Alloy DaemonSet · 전 노드 hostPath 불필요 Loki · SingleBinary · filesystem PVC 10Gi · node2 (workload=heavy) · retention 14일 Loki SingleBinary · filesystem PVC 10Gi retention 14일 Grafana · Loki datasource uid=loki · node2 (workload=heavy) Grafana Loki datasource uid=loki 파드 로그 tail push :3100 query (LogQL) node2 (workload=heavy) Legend Frontend Backend Database Cloud

수집

  • • 전 노드의 Alloy가 K8s API로 파드 로그를 tail해 Loki에 push
  • • 라벨은 namespace/pod/container/app/node 5개(저카디널리티)

저장 · 조회

  • • Loki는 단일 바이너리 1개, 마이크로서비스 컴포넌트 전부 0
  • • Grafana가 LogQL로 조회