-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.main.yml
152 lines (137 loc) · 3.89 KB
/
docker-compose.main.yml
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
---
networks:
grafana:
services:
grafana:
image: grafana/grafana:latest
container_name: grafana
environment:
- GF_PATHS_PROVISIONING=/etc/grafana/provisioning
- GF_AUTH_ANONYMOUS_ENABLED=true
- GF_AUTH_ANONYMOUS_ORG_ROLE=Admin
- GF_AUTH_DISABLE_LOGIN_FORM=true
- GF_FEATURE_TOGGLES_ENABLE=traceqlEditor,azureMonitorPrometheusExemplars
- TENANT_ID=${TENANT_ID}
- CLIENT_ID=${CLIENT_ID}
- CLIENT_SECRET=${CLIENT_SECRET}
depends_on:
- gateway
ports:
- "3002:3000"
healthcheck:
test:
[
"CMD-SHELL",
"wget --no-verbose --tries=1 --spider http://localhost:3000/api/health || exit 1",
]
interval: 10s
timeout: 5s
retries: 5
volumes:
- ./datasources.yaml:/etc/grafana/provisioning/datasources/datasources.yaml
networks:
grafana:
gateway:
image: nginx:latest
container_name: grafana-gateway
depends_on:
- loki-read
- loki-write
entrypoint:
- sh
- -euc
- |
cat <<EOF > /etc/nginx/nginx.conf
user nginx;
worker_processes 5; ## Default: 1
events {
worker_connections 1000;
}
http {
resolver 127.0.0.11;
server {
listen 3100;
location = / {
return 200 'OK';
auth_basic off;
}
location = /api/prom/push {
proxy_pass http://loki-write:3100\$$request_uri;
}
location = /api/prom/tail {
proxy_pass http://loki-read:3100\$$request_uri;
proxy_set_header Upgrade \$$http_upgrade;
proxy_set_header Connection "upgrade";
}
location ~ /api/prom/.* {
proxy_pass http://loki-read:3100\$$request_uri;
}
location = /loki/api/v1/push {
proxy_pass http://loki-write:3100\$$request_uri;
}
location = /loki/api/v1/tail {
proxy_pass http://loki-read:3100\$$request_uri;
proxy_set_header Upgrade \$$http_upgrade;
proxy_set_header Connection "upgrade";
}
location ~ /loki/api/.* {
proxy_pass http://loki-read:3100\$$request_uri;
}
}
}
EOF
/docker-entrypoint.sh nginx -g "daemon off;"
ports:
- "3100:3100"
healthcheck:
test: ["CMD", "service", "nginx", "status"]
interval: 10s
timeout: 5s
retries: 5
networks:
grafana:
loki:
agent:
image: grafana/agent:v0.27.1
container_name: grafana-agent
volumes:
- ./grafana-agent.yaml:/etc/agent.yaml
- /var/run/docker.sock:/var/run/docker.sock:ro
entrypoint:
- /bin/agent
- -config.file=/etc/agent.yaml
networks:
grafana:
tempo:
prometheus:
image: prom/prometheus:latest
container_name: prometheus
command:
- --config.file=/etc/prometheus.yaml
- --web.enable-remote-write-receiver
- --enable-feature=exemplar-storage
volumes:
- ./prometheus.yaml:/etc/prometheus.yaml
ports:
- "9090:9090"
networks:
grafana:
otel-collector:
image: otel/opentelemetry-collector-contrib
command: [--config=/etc/otel-collector-config.yaml]
container_name: otel-collector
volumes:
- ./otel-config.yaml:/etc/otel-collector-config.yaml
environment:
- APPLICATIONINSIGHTS_CONNECTION_STRING=${APPLICATIONINSIGHTS_CONNECTION_STRING}
ports:
- 1888 # pprof extension
- 8888 # Prometheus metrics exposed by the collector
- 8889 # Prometheus exporter metrics
- 13133 # health_check extension
- 4317 # OTLP gRPC receiver
- 4318 # OTLP http receiver
- 55679 # zpages extension
networks:
tempo:
grafana: