Skip to content

Commit 3ecf72e

Browse files
committed
feat(docker-compose): enhance Grafana configuration
Added provisioning configuration for datasources including Prometheus, Loki, and Jaeger. Enabled anonymous access, simplified alert routing, and introduced custom Grafana startup script to streamline setup. This improves Grafana's usability and integration with monitoring tools.
1 parent cf1ca99 commit 3ecf72e

File tree

1 file changed

+42
-2
lines changed

1 file changed

+42
-2
lines changed

docker-compose.yml

+42-2
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,50 @@ services:
5252

5353
grafana:
5454
image: grafana/grafana:latest
55-
environment:
56-
- GF_SECURITY_ADMIN_PASSWORD=admin
5755
ports:
5856
- "3000:3000"
57+
environment:
58+
- GF_SECURITY_ADMIN_PASSWORD=admin
59+
- GF_PATHS_PROVISIONING=/etc/grafana/provisioning
60+
- GF_AUTH_ANONYMOUS_ENABLED=true
61+
- GF_AUTH_ANONYMOUS_ORG_ROLE=Admin
62+
- GF_FEATURE_TOGGLES_ENABLE=alertingSimplifiedRouting,alertingQueryAndExpressionsStepMode
63+
entrypoint:
64+
- sh
65+
- -euc
66+
- |
67+
mkdir -p /etc/grafana/provisioning/datasources
68+
cat <<EOF > /etc/grafana/provisioning/datasources/ds.yaml
69+
apiVersion: 1
70+
datasources:
71+
- name: Prometheus
72+
type: prometheus
73+
orgId: 1
74+
url: http://prometheus:9090
75+
basicAuth: false
76+
isDefault: true
77+
version: 1
78+
editable: false
79+
- name: Loki
80+
type: loki
81+
access: proxy
82+
orgId: 1
83+
url: http://loki:3100
84+
basicAuth: false
85+
isDefault: false
86+
version: 1
87+
editable: false
88+
- name: Jaeger
89+
type: jaeger
90+
access: proxy
91+
orgId: 1
92+
url: http://jaeger:16686
93+
basicAuth: false
94+
isDefault: false
95+
version: 1
96+
editable: false
97+
EOF
98+
/run.sh
5999
networks:
60100
- otel-net
61101
depends_on:

0 commit comments

Comments
 (0)