diff --git a/.docker/grafana.ini b/.docker/grafana.ini new file mode 100644 index 00000000..fea07410 --- /dev/null +++ b/.docker/grafana.ini @@ -0,0 +1,12 @@ +[server] +http_port = 3000 + +[security] +admin_user = admin +admin_password = admin + +[users] +allow_sign_up = false + +[paths] +provisioning = /etc/grafana/provisioning:ro diff --git a/.docker/provisioning/datasources/all.yml b/.docker/provisioning/datasources/all.yml new file mode 100644 index 00000000..87d79e48 --- /dev/null +++ b/.docker/provisioning/datasources/all.yml @@ -0,0 +1,8 @@ +apiVersion: 1 + +datasources: + - name: Prometheus + type: prometheus + url: http://prometheus:9090 + access: proxy + isDefault: true diff --git a/docker-compose.yml b/docker-compose.yml index f1f078df..e06e659c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -64,6 +64,20 @@ services: retries: 8 ports: - ${ELASTICSEARCH_PORT:-9200}:9200 + grafana: + image: grafana/grafana:10.0.3 + restart: unless-stopped + ports: + - ${GRAFANA_PORT:-3000}:3000 + environment: + - GF_SECURITY_ADMIN_USER=${GRAFANA_USER:-admin} + - GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_PASSWORD:-admin} + volumes: + - grafana-data:/var/lib/grafana + - ./.docker/grafana.ini:/etc/grafana/grafana.ini:ro + - ./.docker/provisioning:/etc/grafana/provisioning:ro + depends_on: + - prometheus exporter: build: context: . @@ -89,3 +103,4 @@ volumes: prometheus-data: elasticsearch-data: elasticsearch-logs: + grafana-data: