From 2df43584cf4446e9c03d83d65efe8c07786f3600 Mon Sep 17 00:00:00 2001 From: Ian Fijolek Date: Tue, 20 Jun 2023 09:44:04 -0700 Subject: [PATCH] Grafana config reloading: Use explicit path and echo Was running into some issues with this not running. Using an explicit path seems to help, so I'll try it for now. Also added some echo statements to make it easier to discern when run. --- core/metrics/grafana.nomad | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/core/metrics/grafana.nomad b/core/metrics/grafana.nomad index 095e7be..bd3eb2d 100644 --- a/core/metrics/grafana.nomad +++ b/core/metrics/grafana.nomad @@ -233,11 +233,17 @@ GF_SECURITY_ADMIN_PASSWORD={{ .admin_pw }} exec > "$LOG_FILE" exec 2>&1 GRAFANA_URL=http://127.0.0.1:3000 +echo "Reload dashboards" curl -s -S --user admin:$GF_SECURITY_ADMIN_PASSWORD --request POST $GRAFANA_URL/api/admin/provisioning/dashboards/reload +echo "Reload datasources" curl -s -S --user admin:$GF_SECURITY_ADMIN_PASSWORD --request POST $GRAFANA_URL/api/admin/provisioning/datasources/reload +echo "Reload plugins" curl -s -S --user admin:$GF_SECURITY_ADMIN_PASSWORD --request POST $GRAFANA_URL/api/admin/provisioning/plugins/reload +echo "Reload notifications" curl -s -S --user admin:$GF_SECURITY_ADMIN_PASSWORD --request POST $GRAFANA_URL/api/admin/provisioning/notifications/reload +echo "Reload access-control" curl -s -S --user admin:$GF_SECURITY_ADMIN_PASSWORD --request POST $GRAFANA_URL/api/admin/provisioning/access-control/reload +echo "Reload alerting" curl -s -S --user admin:$GF_SECURITY_ADMIN_PASSWORD --request POST $GRAFANA_URL/api/admin/provisioning/alerting/reload EOF change_mode = "noop" @@ -261,7 +267,7 @@ ${file(join("/", [module_path, "grafana", config_file]))} %{ endif } change_mode = "script" change_script { - command = "$${NOMAD_TASK_DIR}/reload_config.sh" + command = "/local/reload_config.sh" } } %{ endfor }