Skip to content

Commit

Permalink
grafana: change the refresh period to 1s
Browse files Browse the repository at this point in the history
  • Loading branch information
rdementi committed Jul 11, 2024
1 parent 019cea6 commit afa0c63
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 6 deletions.
2 changes: 1 addition & 1 deletion scripts/grafana/provisioning/dashboards/pcm-provider.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ providers:
# <bool> enable dashboard editing
editable: true
# <int> how often Grafana will scan for changed dashboards
updateIntervalSeconds: 10
updateIntervalSeconds: 1
# <bool> allow updating provisioned dashboards from the UI
allowUiUpdates: false
options:
Expand Down
2 changes: 1 addition & 1 deletion scripts/grafana/start-prometheus.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 1 addition & 1 deletion scripts/grafana/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 1 addition & 1 deletion scripts/grafana/telegraf.conf.template
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
19 changes: 17 additions & 2 deletions src/dashboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ class Dashboard
}
result += R"PCMDELIMITER(
],
"refresh": "5s",
"refresh": "1s",
"schemaVersion": 22,
"style": "dark",
"tags": [],
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit afa0c63

Please sign in to comment.