-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
171 lines (162 loc) · 5.82 KB
/
docker-compose.yml
File metadata and controls
171 lines (162 loc) · 5.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
# =============================================================================
# infra-observability — Local Development Stack
# Usage: docker compose up -d
# =============================================================================
name: infra-observability
x-logging: &default-logging
driver: json-file
options:
max-size: "10m"
max-file: "3"
services:
# ---------------------------------------------------------------------------
# OTEL Collector — gateway for all telemetry
# ---------------------------------------------------------------------------
otel-collector:
image: otel/opentelemetry-collector-contrib:0.97.0
container_name: otel-collector
restart: unless-stopped
command: ["--config=/etc/otelcol-contrib/otel-collector-config.yaml"]
volumes:
- ./otel-collector/config/otel-collector-config.yaml:/etc/otelcol-contrib/otel-collector-config.yaml:ro
ports:
- "4317:4317" # OTLP gRPC — services send telemetry here
- "4318:4318" # OTLP HTTP — services send telemetry here
- "8888:8888" # Collector internal metrics
- "8889:8889" # Prometheus exporter (scraped by Prometheus)
- "13133:13133" # Health check
- "55679:55679" # zPages debug UI
environment:
- ENVIRONMENT=${ENVIRONMENT:-local}
healthcheck:
test: ["CMD", "wget", "--spider", "-q", "http://localhost:13133/"]
interval: 10s
timeout: 5s
retries: 3
logging: *default-logging
networks:
- observability
# ---------------------------------------------------------------------------
# Prometheus — metrics storage & alerting
# ---------------------------------------------------------------------------
prometheus:
image: prom/prometheus:v2.51.0
container_name: prometheus
restart: unless-stopped
command:
- "--config.file=/etc/prometheus/prometheus.yml"
- "--storage.tsdb.path=/prometheus"
- "--storage.tsdb.retention.time=30d"
- "--web.enable-lifecycle" # allow hot-reload via POST /-/reload
- "--web.enable-remote-write-receiver"
- "--web.console.libraries=/usr/share/prometheus/console_libraries"
- "--web.console.templates=/usr/share/prometheus/consoles"
volumes:
- ./prometheus/prometheus.yml:/etc/prometheus/prometheus.yml:ro
- ./prometheus/rules:/etc/prometheus/rules:ro
- prometheus_data:/prometheus
ports:
- "9090:9090"
healthcheck:
test: ["CMD", "wget", "--spider", "-q", "http://localhost:9090/-/healthy"]
interval: 10s
timeout: 5s
retries: 3
depends_on:
otel-collector:
condition: service_healthy
logging: *default-logging
networks:
- observability
# ---------------------------------------------------------------------------
# Grafana Tempo — distributed tracing backend
# ---------------------------------------------------------------------------
tempo:
image: grafana/tempo:2.4.1
container_name: tempo
restart: unless-stopped
command: ["-config.file=/etc/tempo.yaml"]
volumes:
- ./tempo/tempo.yaml:/etc/tempo.yaml:ro
- tempo_data:/var/tempo
ports:
- "3200:3200" # Tempo HTTP API
- "4317" # OTLP gRPC (internal only)
healthcheck:
test: ["CMD", "wget", "--spider", "-q", "http://localhost:3200/ready"]
interval: 10s
timeout: 5s
retries: 3
logging: *default-logging
networks:
- observability
# ---------------------------------------------------------------------------
# Grafana — dashboards & visualization
# ---------------------------------------------------------------------------
grafana:
image: grafana/grafana:10.4.2
container_name: grafana
restart: unless-stopped
environment:
- GF_SECURITY_ADMIN_USER=${GRAFANA_ADMIN_USER:-admin}
- GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_ADMIN_PASSWORD:-admin}
- GF_USERS_ALLOW_SIGN_UP=false
- GF_FEATURE_TOGGLES_ENABLE=traceqlEditor traceQLStreaming metricsSummary
- GF_AUTH_ANONYMOUS_ENABLED=false
- GF_ANALYTICS_REPORTING_ENABLED=false
- GF_INSTALL_PLUGINS=grafana-clock-panel,grafana-piechart-panel
volumes:
- ./grafana/provisioning:/etc/grafana/provisioning:ro
- ./grafana/dashboards:/var/lib/grafana/dashboards:ro
- grafana_data:/var/lib/grafana
ports:
- "3000:3000"
healthcheck:
test: ["CMD", "wget", "--spider", "-q", "http://localhost:3000/api/health"]
interval: 10s
timeout: 5s
retries: 3
depends_on:
prometheus:
condition: service_healthy
tempo:
condition: service_healthy
logging: *default-logging
networks:
- observability
# ---------------------------------------------------------------------------
# Node Exporter — host metrics (CPU, memory, disk, network)
# ---------------------------------------------------------------------------
node-exporter:
image: prom/node-exporter:v1.7.0
container_name: node-exporter
restart: unless-stopped
command:
- "--path.rootfs=/host"
- "--collector.filesystem.mount-points-exclude=^/(sys|proc|dev|host|etc)($$|/)"
volumes:
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /:/rootfs:ro
ports:
- "9100:9100"
logging: *default-logging
networks:
- observability
# -----------------------------------------------------------------------------
# Volumes
# -----------------------------------------------------------------------------
volumes:
prometheus_data:
driver: local
grafana_data:
driver: local
tempo_data:
driver: local
# -----------------------------------------------------------------------------
# Networks
# -----------------------------------------------------------------------------
networks:
observability:
name: observability
driver: bridge