Repository navigation
Expand file tree
/
Copy pathcompose.yml
More file actions
61 lines (58 loc) · 2.16 KB
/
Copy pathcompose.yml
File metadata and controls
61 lines (58 loc) · 2.16 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
# observability brick, local: Prometheus + Grafana + Alloy under profile `observability` (make observability-up).
# Same push path as production: Alloy scrapes /actuator/prometheus and remote-writes, here into a throwaway
# Prometheus instead of Grafana Cloud. The dashboard JSON and the Alloy config are the production files.
services:
prometheus:
profiles: ["observability"]
image: prom/prometheus:v3.1.0
command:
- --config.file=/etc/prometheus/prometheus.yml
- --web.enable-remote-write-receiver
- --storage.tsdb.retention.time=24h
volumes:
- ./prometheus/prometheus.yml:/etc/prometheus/prometheus.yml:ro
ports:
- "127.0.0.1:${PROMETHEUS_PORT:-9090}:9090"
grafana:
profiles: ["observability"]
image: grafana/grafana:11.5.1
environment:
GF_AUTH_ANONYMOUS_ENABLED: "true"
GF_AUTH_ANONYMOUS_ORG_ROLE: Admin
GF_AUTH_DISABLE_LOGIN_FORM: "true"
GF_USERS_DEFAULT_THEME: dark
volumes:
- ./grafana/provisioning:/etc/grafana/provisioning:ro
- ./grafana/dashboards:/var/lib/grafana/dashboards:ro
ports:
- "127.0.0.1:${GRAFANA_PORT:-3000}:3000"
depends_on:
- prometheus
alloy:
profiles: ["observability"]
image: grafana/alloy:v1.10.0
command:
- run
- --server.http.listen-addr=0.0.0.0:12345
- --storage.path=/var/lib/alloy/data
- /etc/alloy/config.alloy
volumes:
- ./alloy/config.alloy:/etc/alloy/config.alloy:ro
- alloy-data:/var/lib/alloy/data
environment:
GRAFANA_CLOUD_PROM_URL: http://prometheus:9090/api/v1/write
GRAFANA_CLOUD_PROM_USER: local
GRAFANA_CLOUD_PROM_TOKEN: local
# The app normally runs on the HOST (`make run`); host-gateway is how a container reaches it on Linux, and a
# static target is used because /etc/hosts aliases are invisible to DNS discovery (see config.alloy).
APP_METRICS_STATIC_TARGET: host.docker.internal:${APP_METRICS_PORT:-8080}
APP_METRICS_HOST: alloy
APP_ENV: local
extra_hosts:
- "host.docker.internal:host-gateway"
ports:
- "127.0.0.1:${ALLOY_PORT:-12345}:12345"
depends_on:
- prometheus
volumes:
alloy-data: