Skip to content

Commit

Permalink
load-grafana: use the dashboard list from file
Browse files Browse the repository at this point in the history
  • Loading branch information
amnonh committed Dec 12, 2019
1 parent 5a876a8 commit 46888e5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions load-grafana.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/usr/bin/env bash

. versions.sh
. dashboards.sh

VERSIONS=$DEFAULT_VERSION
GRAFANA_HOST="localhost"
GRAFANA_PORT=3000
Expand Down Expand Up @@ -45,11 +47,11 @@ fi

mkdir -p grafana/build
IFS=',' ;for v in $VERSIONS; do
for f in scylla-dash scylla-dash-per-server scylla-dash-io-per-server scylla-dash-cpu-per-server scylla-dash-per-machine; do
for f in "${DASHBOARDS[@]}"; do
if [ -e grafana/$f.$v.template.json ]
then
if [ ! -f "grafana/build/$f.$v.json" ] || [ "grafana/build/$f.$v.json" -ot "grafana/$f.$v.template.json" ]; then
./make_dashboards.py -t grafana/types.json -d grafana/$f.$v.template.json
./make_dashboards.py -t grafana/types.json -d grafana/$f.$v.template.json -R "__MONITOR_VERSION__=$CURRENT_VERSION"
fi
curl -XPOST -i http://admin:$GRAFANA_ADMIN_PASSWORD@$GRAFANA_HOST:$GRAFANA_PORT/api/dashboards/db --data-binary @./grafana/build/$f.$v.json -H "Content-Type: application/json"
else
Expand Down

0 comments on commit 46888e5

Please sign in to comment.