-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.traces-metrics.yaml
111 lines (107 loc) · 3.28 KB
/
docker-compose.traces-metrics.yaml
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
x-default-logging: &logging
driver: "json-file"
options:
max-size: "${MAX_LOG_FILE_SIZE}"
max-file: "${MAX_LOG_FILE_COUNT}"
tag: "{{.Name}}|{{.ImageName}}|{{.ID}}"
services:
prometheus:
image: prom/prometheus:${PROMETHEUS_VERSION}
restart: on-failure
# https://prometheus.io/docs/prometheus/latest/feature_flags/
command:
- "--web.console.templates=/etc/prometheus/consoles"
- "--web.console.libraries=/etc/prometheus/console_libraries"
- "--storage.tsdb.retention.time=1y"
- "--storage.tsdb.path=/prometheus"
- "--config.file=/etc/prometheus/prometheus-config.yaml"
- "--web.enable-lifecycle"
- "--web.route-prefix=/"
- "--enable-feature=exemplar-storage"
- "--enable-feature=otlp-write-receiver"
- "--web.enable-remote-write-receiver"
# - "--enable-feature=auto-gomaxprocs"
# - "--enable-feature=auto-gomemlimit"
- "--enable-feature=concurrent-rule-eval"
volumes:
- ./src/prometheus:/etc/prometheus
- prometheus-data:/prometheus
environment:
- GOMAXPROCS=${GOMAXPROCS}
- GOMEMLIMIT=${GOMEMLIMIT}
ports:
- ${PROMETHEUS_PORT}:9090
deploy:
resources:
limits:
cpus: ${CPU_LIMIT}
memory: ${MEM_LIMIT}
healthcheck:
test: "wget -q -t 1 -O - http://localhost:9090/-/ready | grep -q 'Prometheus Server is Ready.'"
interval: 1s
timeout: 1s
retries: 120
logging: *logging
# https://www.jaegertracing.io/docs/1.56/deployment/
jaeger:
image: jaegertracing/all-in-one:${JAEGER_VERSION}
restart: on-failure
ports:
- "4317"
- "4318"
- ${JAEGERQUERY_PORT}:16686
# https://www.jaegertracing.io/docs/1.56/cli/#jaeger-all-in-one-prometheus
environment:
- GOMAXPROCS=${GOMAXPROCS}
- GOMEMLIMIT=${GOMEMLIMIT}
- METRICS_STORAGE_TYPE=prometheus
- PROMETHEUS_SERVER_URL=http://prometheus:9090
- PROMETHEUS_QUERY_SUPPORT_SPANMETRICS_CONNECTOR=true
- PROMETHEUS_QUERY_NORMALIZE_CALLS=true
- PROMETHEUS_QUERY_NORMALIZE_DURATION=true
command:
- "--log-level=info"
deploy:
resources:
limits:
cpus: ${CPU_LIMIT}
memory: ${MEM_LIMIT}
healthcheck:
test: "wget -q -t 1 -O - http://localhost:14269 | grep -q 'Server available'"
interval: 1s
timeout: 1s
retries: 120
depends_on:
prometheus:
condition: service_healthy
logging: *logging
grafana:
image: grafana/grafana:${GRAFANA_VERSION}
restart: on-failure
volumes:
- ./src/grafana/grafana.ini:/etc/grafana/grafana.ini
- ./src/grafana/provisioning/:/etc/grafana/provisioning/
- grafana-data:/var/lib/grafana
ports:
- ${GRAFANA_PORT}:3000
environment:
- GOMAXPROCS=${GOMAXPROCS}
- GOMEMLIMIT=${GOMEMLIMIT}
- GF_SERVER_ROOT_URL=http://${CLUSTER_IP}:${GRAFANA_PORT}
deploy:
resources:
limits:
cpus: ${CPU_LIMIT}
memory: ${MEM_LIMIT}
healthcheck:
test: 'curl -s --retry 0 http://localhost:3000/api/health | grep -q ''"database": "ok"'''
interval: 1s
timeout: 1s
retries: 120
depends_on:
prometheus:
condition: service_healthy
logging: *logging
volumes:
prometheus-data:
grafana-data: