Skip to content

Commit

Permalink
Merge pull request #378 from branden/grafana-home-dashboard
Browse files Browse the repository at this point in the history
Retry requests when setting Grafana's home dashboard
  • Loading branch information
branden authored Jan 23, 2020
2 parents 03d72e0 + 95477ae commit f44ea4d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion staging/prometheus-operator/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ sources:
- https://github.com/coreos/kube-prometheus
- https://github.com/coreos/prometheus-operator
- https://coreos.com/operators/prometheus
version: 8.3.8
version: 8.3.9
appVersion: 0.34.0
tillerVersion: ">=2.12.0"
home: https://github.com/coreos/prometheus-operator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@ metadata:
data:
run.sh: |-
#!/bin/bash
DASHBOARD_ID=$(curl --fail -H "X-Forwarded-User: $X_FORWARDED_USER" {{ .Values.mesosphereResources.hooks.grafana.serviceURL }}/api/search/?query=Kubernetes+%2F+Compute+Resources+%2F+Cluster | jq '.[0].id')
echo $DASHBOARD_ID
curl -X PUT -v --fail -H "Content-Type: application/json" -H "X-Forwarded-User: $X_FORWARDED_USER" -d '{"theme":"","homeDashboardId":'"$DASHBOARD_ID"',"timezone":""}' {{ .Values.mesosphereResources.hooks.grafana.serviceURL }}/api/org/preferences
set -o nounset
set -o errexit
set -o pipefail
CURL="curl --verbose --fail --max-time 60 --retry 10 --retry-connrefused"
DASHBOARD_ID=$($CURL -H "X-Forwarded-User: $X_FORWARDED_USER" {{ .Values.mesosphereResources.hooks.grafana.serviceURL }}/api/search/?query=Kubernetes+%2F+Compute+Resources+%2F+Cluster | jq '.[0].id')
echo "setting home dashboard to ID" $DASHBOARD_ID
$CURL -X PUT -H "Content-Type: application/json" -H "X-Forwarded-User: $X_FORWARDED_USER" -d '{"theme":"","homeDashboardId":'"$DASHBOARD_ID"',"timezone":""}' {{ .Values.mesosphereResources.hooks.grafana.serviceURL }}/api/org/preferences

0 comments on commit f44ea4d

Please sign in to comment.