container to import grafana dashboards

This commit is contained in:
marcel-dempers 2019-08-27 19:37:34 +10:00
parent aca91ac997
commit 32877a10f7
3 changed files with 35 additions and 10 deletions

View File

@ -32,7 +32,7 @@ services:
container_name: prometheus-svc
image: prom/prometheus
ports:
- "9090:9090"
- "9091:9090"
command: --config.file=/etc/prometheus/prometheus.yaml
volumes:
- ./prometheus.yaml:/etc/prometheus/prometheus.yaml
@ -44,3 +44,17 @@ services:
- GF_AUTH_BASIC_ENABLED=false
- GF_AUTH_ANONYMOUS_ENABLED=true
- GF_AUTH_ANONYMOUS_ORG_ROLE=Admin
grafana-dashboards:
image: alpine:3.10
depends_on:
- grafana
volumes:
- ./grafana-data:/grafana
command: >
/bin/sh -c "
apk add --no-cache curl
echo 'waiting for grafana'
sleep 5s
cd /grafana
curl --request POST http://grafana:3000/api/datasources --header 'Content-Type: application/json' -d @datasources.json
curl --request POST http://grafana:3000/api/dashboards/db --header 'Content-Type: application/json' -d @dashboard.json"

View File

@ -1,3 +1,8 @@
{
"overwrite": true,
"dashboard" :
{
"__inputs": [],
"__requires": [
@ -42,7 +47,7 @@
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "Prometheus",
"datasource": "prometheus",
"fill": 1,
"gridPos": {
"h": 9,
@ -121,7 +126,7 @@
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "Prometheus",
"datasource": "prometheus",
"fill": 1,
"gridPos": {
"h": 9,
@ -214,7 +219,7 @@
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "Prometheus",
"datasource": "prometheus",
"fill": 1,
"gridPos": {
"h": 9,
@ -293,7 +298,7 @@
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "Prometheus",
"datasource": "prometheus",
"fill": 1,
"gridPos": {
"h": 9,
@ -386,7 +391,7 @@
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "Prometheus",
"datasource": "prometheus",
"fill": 1,
"gridPos": {
"h": 9,
@ -465,7 +470,7 @@
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "Prometheus",
"datasource": "prometheus",
"fill": 1,
"gridPos": {
"h": 9,
@ -558,7 +563,7 @@
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "Prometheus",
"datasource": "prometheus",
"fill": 1,
"gridPos": {
"h": 8,
@ -637,7 +642,7 @@
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "Prometheus",
"datasource": "prometheus",
"fill": 1,
"gridPos": {
"h": 8,
@ -755,4 +760,4 @@
"title": "Application Telemetry (Prometheus)",
"uid": "pvXvovKWz",
"version": 2
}
}}

View File

@ -0,0 +1,6 @@
{
"name": "prometheus",
"type": "prometheus",
"url": "http://prometheus:9090",
"access": "proxy"
}