aula-15: implementação completa APM (Tempo + OTel + demo app)
Componentes: - tempo-values.yaml: Grafana Tempo monolithic, 256Mi, 10Gi PVC - otel-collector-values.yaml: recebe OTLP, exporta traces→Tempo, gera span metrics (RED)→Victoria Metrics via spanmetrics connector - demo-app/: Node.js com rotas /fast (1 query), /slow (N+1, 51 queries), /fixed (JOIN), auto-instrumentado com OpenTelemetry - alerts/latency-alerts.yaml: VMRule com Doherty threshold (p95>400ms) - setup.sh: instala Tempo, OTel Collector, configura Grafana datasource, deploy demo app via ConfigMap (sem Docker build necessário) - cleanup.sh: remove apenas recursos da aula-15, preserva aula-12 Zero hardcoded hostnames. Tudo via .env e placeholders.
This commit is contained in:
61
aula-15/tempo-values.yaml
Normal file
61
aula-15/tempo-values.yaml
Normal file
@@ -0,0 +1,61 @@
|
||||
# Grafana Tempo - Monolithic mode (single binary)
|
||||
# Chart: grafana/tempo
|
||||
# Recebe traces do OpenTelemetry Collector e armazena localmente
|
||||
|
||||
# Single replica - minimal for workshop on Hetzner CAX11
|
||||
replicas: 1
|
||||
|
||||
tempo:
|
||||
# Storage config - local filesystem
|
||||
storage:
|
||||
trace:
|
||||
backend: local
|
||||
local:
|
||||
path: /var/tempo/traces
|
||||
wal:
|
||||
path: /var/tempo/wal
|
||||
|
||||
# Retention (maps to compactor.compaction.block_retention in tempo config)
|
||||
retention: 168h # 7 days
|
||||
|
||||
# Receive traces via OTLP only (disable other receivers)
|
||||
receivers:
|
||||
otlp:
|
||||
protocols:
|
||||
grpc:
|
||||
endpoint: "0.0.0.0:4317"
|
||||
http:
|
||||
endpoint: "0.0.0.0:4318"
|
||||
|
||||
# Metrics generator - generates span metrics for Victoria Metrics
|
||||
metricsGenerator:
|
||||
enabled: true
|
||||
remoteWriteUrl: "http://vmsingle-monitoring-victoria-metrics-k8s-stack.monitoring:8429/api/v1/write"
|
||||
processor:
|
||||
service_graphs:
|
||||
dimensions:
|
||||
- http.method
|
||||
- http.route
|
||||
enable_client_server_prefix: true
|
||||
max_items: 10000
|
||||
span_metrics:
|
||||
dimensions:
|
||||
- http.method
|
||||
- http.route
|
||||
- http.status_code
|
||||
enable_target_info: true
|
||||
|
||||
# Resources for tempo container (under tempo key for this chart)
|
||||
resources:
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 256Mi
|
||||
limits:
|
||||
cpu: 500m
|
||||
memory: 512Mi
|
||||
|
||||
# Persistence via Hetzner CSI
|
||||
persistence:
|
||||
enabled: true
|
||||
size: 10Gi
|
||||
storageClassName: hcloud-volumes
|
||||
Reference in New Issue
Block a user