diff --git a/scripts/grafana/provisioning/dashboards/pcm-provider.yml b/scripts/grafana/provisioning/dashboards/pcm-provider.yml index f6ccfd4e..acd959bd 100644 --- a/scripts/grafana/provisioning/dashboards/pcm-provider.yml +++ b/scripts/grafana/provisioning/dashboards/pcm-provider.yml @@ -16,7 +16,7 @@ providers: # enable dashboard editing editable: true # how often Grafana will scan for changed dashboards - updateIntervalSeconds: 10 + updateIntervalSeconds: 1 # allow updating provisioned dashboards from the UI allowUiUpdates: false options: diff --git a/scripts/grafana/start-prometheus.sh b/scripts/grafana/start-prometheus.sh index 46e8dafd..31a59d91 100755 --- a/scripts/grafana/start-prometheus.sh +++ b/scripts/grafana/start-prometheus.sh @@ -68,6 +68,6 @@ ${CTR_RUN} network create prometheus-network || { echo "Error creating prometheu echo Starting prometheus ${CTR_RUN} run --name prometheus --network=prometheus-network -d -p 9090:9090 -v "$PWD"/prometheus.yml:/etc/prometheus/prometheus.yml:Z -v "$PWD"/prometheus_volume:/prometheus:Z quay.io/prometheus/prometheus:latest || { echo "Error starting prometheus"; exit 1; } echo Starting grafana -${CTR_RUN} run -d --network=prometheus-network --name=grafana -p 3000:3000 -v "$PWD"/grafana_volume:/var/lib/grafana:Z -v "$PWD"/provisioning:/etc/grafana/provisioning:Z docker.io/grafana/grafana:latest || { echo "Error starting grafana"; exit 1; } +${CTR_RUN} run -d --network=prometheus-network --name=grafana -p 3000:3000 -v "$PWD"/grafana_volume:/var/lib/grafana:Z -v "$PWD"/provisioning:/etc/grafana/provisioning:Z -e GF_DASHBOARDS_MIN_REFRESH_INTERVAL=1s docker.io/grafana/grafana:latest || { echo "Error starting grafana"; exit 1; } echo "Start browser at http://"`hostname`":3000/ or http://localhost:3000/ and login with admin user, password admin" diff --git a/scripts/grafana/start.sh b/scripts/grafana/start.sh index 5c1a6538..83e8c163 100755 --- a/scripts/grafana/start.sh +++ b/scripts/grafana/start.sh @@ -72,6 +72,6 @@ ${CTR_RUN} run -d --name influxdb -p 8083:8083 -p 8086:8086 --network=influxdb-n echo Starting telegraf ${CTR_RUN} run -d --name telegraf --network=influxdb-network -v "$PWD"/telegraf.conf:/etc/telegraf/telegraf.conf:ro telegraf || { echo "Error starting telegraf"; exit 1; } echo Starting grafana -${CTR_RUN} run -d --network=influxdb-network --name grafana -p 3000:3000 -v "$PWD"/provisioning:/etc/grafana/provisioning -v "$PWD"/grafana_volume:/var/lib/grafana grafana/grafana || { echo "Error starting grafana"; exit 1; } +${CTR_RUN} run -d --network=influxdb-network --name grafana -p 3000:3000 -v "$PWD"/provisioning:/etc/grafana/provisioning -v "$PWD"/grafana_volume:/var/lib/grafana -e GF_DASHBOARDS_MIN_REFRESH_INTERVAL=1s grafana/grafana || { echo "Error starting grafana"; exit 1; } echo "Start browser at http://"`hostname`":3000/ or http://localhost:3000/ and login with admin user, password admin" diff --git a/scripts/grafana/telegraf.conf.template b/scripts/grafana/telegraf.conf.template index a85a9c17..db656652 100644 --- a/scripts/grafana/telegraf.conf.template +++ b/scripts/grafana/telegraf.conf.template @@ -45,7 +45,7 @@ ## Default flushing interval for all outputs. You shouldn't set this below ## interval. Maximum flush_interval will be flush_interval + flush_jitter - flush_interval = "10s" + flush_interval = "1s" ## Jitter the flush interval by a random amount. This is primarily to avoid ## large write spikes for users running a large number of telegraf instances. ## ie, a jitter of 5s and interval 10s means flushes will happen every 10-15s diff --git a/src/dashboard.cpp b/src/dashboard.cpp index 8242fca7..7fe8e2e4 100644 --- a/src/dashboard.cpp +++ b/src/dashboard.cpp @@ -419,7 +419,7 @@ class Dashboard } result += R"PCMDELIMITER( ], - "refresh": "5s", + "refresh": "1s", "schemaVersion": 22, "style": "dark", "tags": [], @@ -456,7 +456,22 @@ class Dashboard "from": "now-5m", "to": "now" }, - "timepicker": {}, + "timepicker": { + "refresh_intervals": [ + "1s", + "2s", + "5s", + "10s", + "30s", + "1m", + "5m", + "15m", + "30m", + "1h", + "2h", + "1d" + ] + }, "timezone": "", "title": ")PCMDELIMITER"; result += title;