Grafana Tempo Kubernetes 배포, 구성 가이드
Grafana Tempo 는 분산 추적을 위한 고성능 오픈 소스 시스템으로, 다양한 Tracing 프로토콜을 지원하여 애플리케이션의 성능을 모니터링하고, 시스템 내의 문제를 신속하게 진단하는 데 중요한 역할을 합니다.
분산 시스템에서 발생하는 여러 요청 흐름을 추적하고 시각화할 수 있는 기능을 제공하며, Jaeger, Zipkin, OpenTelemetry와 같은 주요 오픈소스 프로토콜과 호환되어 사용자가 기존 시스템과 쉽게 통합할 수 있습니다.
이 가이드에서는 Grafana Tempo를 Kubernetes 환경에 배포하는 방법에 대해 다루며, Helm과 Manifest 방식의 두 가지 주요 배포 방법을 소개합니다.
목차
1. Grafana Tempo란?
2. Helm 배포 방법
3. Manifest 배포 방법
4. Grafana Tempo 구성 방법
5. 결론
1. Grafana Tempo란?
Grafana Tempo는 오픈 소스 기반의 고성능 분산 추적 시스템으로, 애플리케이션의 요청 흐름을 시각화하여 성능 문제를 진단하고 모니터링하는 데 사용됩니다.
Grafana Tempo는 Jaeger, Zipkin, OpenTelemetry를 포함한 여러가지의 오픈소스 Tracing 프로토콜을 처리할 수 있습니다.
Grafana Tempo는 Tracing 데이터를 저장하기 위한 스토리지 구성 옵션을 제공합니다. Local 스토리지와 Amazon S3, Azure Blob, Google Cloude Storage 스토리지 옵션을 제공하고있습니다.
2. Helm 배포 방법
하드웨어 요구 사항
Grafana Tempo의 단일 컴포넌트에 관련된 내용은 Docs에 명시되어 있지 않습니다.
분산 컴포넌트에 대한 하드웨어 요구 사항입니다.
- Distributer : CPU 2 cores, Memory 2GB, 트래픽 10MB/s 마다 1개의 replica가 사용됩니다.
- Ingester : CPU 2.5 cores, Memory 4-20GB, 트래픽 3-5MB/s 마다 1개의 replica가 사용됩니다.
- Querier : CPU (트레이스 크기 및 쿼리에 따라 다름), Memory 4-20GB, 트래픽 1-2MB/s 마다 1개의
replica가 사용됩니다. - Frontend : CPU (트레이스 크기 및 쿼리에 따라 다름), Memory 4-20GB, 2개의 replica가 사용됩니다.
- Compactor : CPU 1 core, Memory 4-20GB, 트래픽 3-5MB/s 마다 1개의 replica가 사용됩니다.
소프트웨어 요구 사항
- Kubernetes 1.29 이상
- Helm 3 이상
Helm Repository를 추가합니다.
helm repo add grafana https://grafana.github.io/helm-charts
helm repo update
Helm을 이용하여 배포 할 경우 아래와 같은 custom.yaml 파일을 통해 Tempo의 구성을 적용할 수 있습니다.
ex) custom.yaml
---
# Specifies which trace protocols to accept by the gateway.
traces:
otlp:
grpc:
enabled: true
http:
enabled: true
zipkin:
enabled: false
jaeger:
thriftHttp:
enabled: false
opencensus:
enabled: false
storage:
trace:
backend: s3
s3:
access_key: 'grafana-tempo'
secret_key: 'supersecret'
bucket: 'tempo-traces'
endpoint: 'tempo-minio:9000'
insecure: true
# MinIO storage configuration
# Note: MinIO should not be used for production environments. This is for demonstration purposes only.
minio:
enabled: true
mode: standalone
rootUser: grafana-tempo
rootPassword: supersecret
buckets:
# Default Tempo storage bucket
- name: tempo-traces
policy: none
purge: false
위의 예시 구성을 저장하고 custom.yaml 구성 옵션을 사용하여 Tempo를 설치합니다.
Grafana Tempo-distributed(분산 컴포넌트)의 경우 deployment 4개, statefulset 2개로 배포되게 됩니다.
- tempo-distributor : 스팬 데이터를 수신하고
ingester로 전달합니다. - tempo-ingester : 데이터를 메모리에 저장하고 나중에 블록으로 백엔드에 기록합니다.
- tempo-compactor : 저장된 작은 블록들을 병합해서 최적화합니다.
- tempo-query-frontend : 쿼리를 나누고
querier에게 전달합니다. - tempo-querier : 저장소에서 트레이스를 조회해서 반환합니다.
- tempo-memcached : 자주 조회되는 데이터 캐싱하여 응답 속도 향상합니다.
helm -n [Namespace] install tempo grafana/tempo-distributed -f [config file]

Grafana Tempo(단일 컴포넌트)의 경우 단일 StatusfulSet으로 배포됩니다.
helm -n [Namespace] install tempo grafana/tempo -f [config file]

3. Manifest 배포 방법
Grafana Tempo는 Helm 설치 방법을 지원하고 있으며 공식문서에서 Manifest 방식은 기재되어있지 않습니다.
Grafana Tempo는 분산 컴포넌트는 Helm 차트를 적극 권장하고 있습니다.
Grafana Tempo의 단일 컴포넌트 방식의 Manifest는 아래와 같습니다.
apiVersion: apps/v1
kind: Deployment
metadata:
name: tempo
labels:
app: tempo
spec:
selector:
matchLabels:
app: tempo
template:
metadata:
labels:
app: tempo
spec:
containers:
- name: tempo
image: grafana/tempo
ports:
- containerPort: 3100
name: tempo-web
- containerPort: 4317
name: grpc-receive
- containerPort: 4318
name: http-receive
args:
- --config.file=/etc/tempo/config.yml
volumeMounts:
- name: tempo-config
mountPath: /etc/tempo/config.yml
subPath: config.yml
volumes:
- name: tempo-config
configMap:
name: tempo-conf
---
apiVersion: v1
kind: ConfigMap
metadata:
name: tempo-conf
data:
config.yml: |
server:
http_listen_port: 3100
distributor:
receivers:
otlp:
protocols:
grpc:
endpoint: 0.0.0.0:4317
http:
endpoint: 0.0.0.0:4318
storage:
trace:
backend: s3
s3:
access_key: 'grafana-tempo'
secret_key: 'supersecret'
bucket: 'tempo-traces'
endpoint: 'tempo-minio:9000'
insecure: true
---
apiVersion: v1
kind: Service
metadata:
name: tempo-svc
labels:
app: tempo
spec:
selector:
app: tempo
ports:
- name: tempo-web
port: 3100
targetPort: 3100
- name: grpc-tempo
port: 4317
protocol: TCP
targetPort: 4317
- name: http-tempo
port: 4318
protocol: TCP
targetPort: 4318
ConfigMap의 tempo-conf를 수정하여 Grafana Tempo의 구성을 변경할 수 있습니다.
4. Grafana Tempo 구성 방법
Grafana Tempo의 구성은 아래와 같이 진행합니다.
ex) value.yaml
server:
http_listen_port: 3100 # Tempo 내부 HTTP 서버가 요청을 수신하는 포트입니다.
distributor:
receivers:
otlp: # OpneTelemetry의 Tracing Data를 전달받습니다.
protocols:
grpc:
endpoint: 0.0.0.0:4317 # OpenTelemetry Collector가 gRPC 프로토콜로 트레이스 데이터를 전송하는 포트입니다.
http:
endpoint: 0.0.0.0:4318 # OpenTelemetry Collector가 HTTP 프로토콜로 트레이스 데이터를 전송하는 포트입니다.
storage:
trace:
backend: s3 # 트레이스 데이터를 저장할 백엔드를 Amazon S3로 설정합니다.
s3:
bucket: tempo-traces # 트레이스 데이터를 저장할 S3 버킷 이름입니다.
endpoint: s3.amazonaws.com # S3 서비스 엔드포인트 주소입니다.
access_key: YOUR_ACCESS_KEY # S3 접근을 위한 액세스 키입니다.
secret_key: YOUR_SECRET_KEY # S3 접근을 위한 비밀 키입니다.
insecure: false # HTTPS 사용 여부를 설정하며, false면 HTTPS를 사용합니다.
wal:
path: /tmp/tempo/wal # Write-Ahead Log(WAL) 임시 저장 경로로, 데이터 안정성 확보에 사용됩니다.
server.http_listen_port를 3100으로 설정하여 Tempo 내부 HTTP 서버가 요청을 수신하는 포트를 지정합니다.distributor.receivers.에서 여러가지 오픈소스 프로토콜을 이용하여 Trace Data를 전달 받을 수 있습니다. zipkin, opencensus, kafka, otel, jaeger의 오픈소스 Trace Data 수집기를 사용할 수 있습니다.storage.trace.backend를s3로 설정하여 트레이스 데이터를 Amazon S3에 저장하도록 합니다.
Grafana Tempo에서는 AWS S3, Azure Blob Storage, Google Cloud Storage, MinlO, OpenShift Data Foundation, Local의 Storage를 지원합니다.storage.trace.s3.access_key,secret_key: S3 버킷 이름과 엔드포인트, 액세스 키 및 비밀 키를 설정합니다.wal.path에 Write-Ahead Log(WAL)를 저장할 임시 경로를 지정하여 데이터 안정성을 확보합니다.
5. 결론
Grafana Tempo는 분산 추적 시스템을 구축하는 데 매우 유용한 도구이며, Kubernetes 환경에서 손쉽게 배포할 수 있습니다. Helm을 사용한 간편한 설치 방법과 Manifest 파일을 통한 직접적인 배포 방법을 제공하여, 다양한 배포 요구 사항에 맞춰 선택적으로 사용할 수 있습니다.
이 가이드를 통해 사용자는 Grafana Tempo를 효과적으로 배포하고, 분산 애플리케이션에서 발생하는 성능 문제를 효과적으로 추적하고 해결할 수 있는 능력을 갖출 수 있습니다.
Kubernetes에 관련된 더 자세한 내용을 알고싶으시다면 NGINX STORE Kubernetes 카테고리를 방문해주세요.
댓글을 달려면 로그인해야 합니다.