Added prometheus datasource preconfiguration.

master
Tomasz Półgrabia 2024-12-11 22:11:04 +01:00
parent 8e9274e132
commit 8ad94180fe
4 changed files with 45 additions and 0 deletions

View File

@ -0,0 +1,13 @@
# Setup
```
docker compose -f ./setup.yaml up -d
docker container exec grafana_demo1-grafana-1 "/bin/bash" "-c" "mkdir -p /etc/grafana/provisioning/datasources"
docker container cp datasources.yaml grafana_demo1-grafana-1:/etc/grafana/provisioning/datasources/prometheus.yaml
docker compose -f ./setup.yaml down
```
# Actual running
```
docker compose -f ./app.yaml -d
```

View File

@ -15,6 +15,7 @@ services:
- '3000:3000'
volumes:
- 'grafana-storage:/var/lib/grafana'
- 'grafana-provisioning:/etc/grafana/provisioning'
networks:
- net
@ -23,6 +24,7 @@ networks:
driver: bridge
volumes:
grafana-provisioning:
grafana-storage:
prometheus-data:

View File

@ -0,0 +1,12 @@
apiVersion: 1
deleteDatasources:
datasources:
- name: prometheus
type: prometheus
url: http://prometheus:9090/
isDefault: true
jsonData:
sslMode: "disable"
version: 2

View File

@ -0,0 +1,18 @@
version: '3.7'
services:
prometheus:
image: 'nginx'
volumes:
- 'prometheus-data:/prometheus'
grafana:
image: 'nginx'
volumes:
- 'grafana-storage:/var/lib/grafana'
- 'grafana-provisioning:/etc/grafana/provisioning'
volumes:
grafana-provisioning:
grafana-storage:
prometheus-data: