Declarative Grafana / Prometheus / Loki / Tempo observability stack

Deploys the whole stack into the observability namespace of the local
cluster with Kustomize alone — no helm install, no dashboard created by
hand in the UI. The Makefile carries every command: deploy, dashboards,
diagnostics, PVC flush, teardown.

Dashboards are files, never UI objects. Each carries a stable uid, which
is what keeps URLs, cross-links and alerts alive across redeployments, and
references datasources by stable uid rather than by name. The dashboard
ConfigMap is generated without a name-suffix hash so applying it updates
it in place and Grafana reloads without a restart, while the provisioning
ConfigMaps keep their hash precisely so that a change there does force one.

Prometheus scrapes the kubelet /metrics/resource endpoint rather than
/metrics/cadvisor: on this cluster cadvisor exposes machine_* series only
and no container_* at all, which would leave every CPU and memory panel
empty.

Alloy ships every pod's logs to Loki through the Kubernetes API, so no
/var/log mount is needed. Tempo's metrics_generator feeds span metrics and
the service graph back into Prometheus, and the datasources are wired so a
log line's trace_id opens the matching trace.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Stéphane Tailland
2026-08-25 07:27:38 +02:00
commit 3937b4f366
42 changed files with 7597 additions and 0 deletions
+79
View File
@@ -0,0 +1,79 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: tempo
namespace: observability
labels:
app.kubernetes.io/name: tempo
app.kubernetes.io/component: traces
app.kubernetes.io/part-of: observability
spec:
replicas: 1
strategy:
type: Recreate
selector:
matchLabels:
app: tempo
template:
metadata:
labels:
app: tempo
app.kubernetes.io/name: tempo
app.kubernetes.io/component: traces
app.kubernetes.io/part-of: observability
annotations:
prometheus.io/scrape: "true"
prometheus.io/port: "3200"
spec:
securityContext:
runAsUser: 10001
runAsGroup: 10001
fsGroup: 10001
containers:
- name: tempo
image: grafana/tempo:3.0.3
args:
- -config.file=/etc/tempo/tempo.yaml
- -target=all
ports:
- name: http
containerPort: 3200
- name: grpc
containerPort: 9095
- name: otlp-grpc
containerPort: 4317
- name: otlp-http
containerPort: 4318
- name: zipkin
containerPort: 9411
resources:
requests:
cpu: 100m
memory: 512Mi
limits:
cpu: "2"
memory: 2Gi
readinessProbe:
httpGet:
path: /ready
port: http
initialDelaySeconds: 30
periodSeconds: 10
livenessProbe:
httpGet:
path: /ready
port: http
initialDelaySeconds: 60
periodSeconds: 30
volumeMounts:
- name: config
mountPath: /etc/tempo
- name: data
mountPath: /var/tempo
volumes:
- name: config
configMap:
name: tempo-config
- name: data
persistentVolumeClaim:
claimName: tempo-data
+18
View File
@@ -0,0 +1,18 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: observability
resources:
- pvc.yaml
- deployment.yaml
- service.yaml
configMapGenerator:
- name: tempo-config
files:
- tempo.yaml
generatorOptions:
labels:
app.kubernetes.io/name: tempo
app.kubernetes.io/part-of: observability
+15
View File
@@ -0,0 +1,15 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: tempo-data
namespace: observability
labels:
app.kubernetes.io/name: tempo
app.kubernetes.io/component: storage
app.kubernetes.io/part-of: observability
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
+29
View File
@@ -0,0 +1,29 @@
apiVersion: v1
kind: Service
metadata:
name: tempo
namespace: observability
labels:
app.kubernetes.io/name: tempo
app.kubernetes.io/component: traces
app.kubernetes.io/part-of: observability
spec:
type: ClusterIP
selector:
app: tempo
ports:
- name: http
port: 3200
targetPort: http
- name: grpc
port: 9095
targetPort: grpc
- name: otlp-grpc
port: 4317
targetPort: otlp-grpc
- name: otlp-http
port: 4318
targetPort: otlp-http
- name: zipkin
port: 9411
targetPort: zipkin
+64
View File
@@ -0,0 +1,64 @@
# Tempo 3.x in monolithic mode (-target=all), local storage on a PVC.
stream_over_http_enabled: true
multitenancy_enabled: false
server:
http_listen_address: 0.0.0.0
http_listen_port: 3200
grpc_listen_address: 0.0.0.0
grpc_listen_port: 9095
log_level: info
distributor:
receivers:
otlp:
protocols:
grpc:
endpoint: 0.0.0.0:4317
http:
endpoint: 0.0.0.0:4318
zipkin:
endpoint: 0.0.0.0:9411
# Generates span metrics and service graphs, pushed to Prometheus through its
# remote-write receiver (--web.enable-remote-write-receiver).
metrics_generator:
registry:
external_labels:
source: tempo
cluster: orbstack
storage:
path: /var/tempo/generator/wal
remote_write:
- url: http://prometheus:9090/api/v1/write
send_exemplars: true
query_frontend:
search:
duration_slo: 5s
throughput_bytes_slo: 1073741824
trace_by_id:
duration_slo: 5s
storage:
trace:
backend: local
wal:
path: /var/tempo/wal
local:
path: /var/tempo/blocks
overrides:
defaults:
metrics_generator:
processors:
- service-graphs
- span-metrics
generate_native_histograms: both
# Tempo 3.x: retention is no longer a top-level `compactor:` block; it is
# driven from here (backend_scheduler/backend_worker otherwise).
compaction:
block_retention: 168h
usage_report:
reporting_enabled: false