grafana-utils icon indicating copy to clipboard operation
grafana-utils copied to clipboard

Grafana 5+ utils

Managed by Monitoring Artist: DevOps / Docker / Kubernetes / AWS ECS / Zabbix / Zenoss / Terraform / Monitoring

Grafana Dashboard Exporter/Importer

Export/import Grafana dashboards (Grafana 5+).

Dashboard

Grafana Dashboard Exporter/Importer

Dashboard restore operation

Use dashboard API to restore dashboard. For example:

cat <exported-dashboard.json> | jq '. + {overwrite: true}' | curl -X POST \
-H "Content-Type: application/json" -H "Authorization: Bearer <api-key-with-write-permissions>" \
<grafana-uri>/api/dashboards/db -d @-

When importing dashboards for the first time reset the id:

cat <exported-dashboard.json> | jq '. * {overwrite: true, dashboard: {id: null}}' | curl -X POST \
-H "Content-Type: application/json" -H "Authorization: Bearer <api-key-with-write-permissions>" \
<grafana-uri>/api/dashboards/db -d @-

Grafana 6+ users

The text panel does no longer by default allow unsantizied HTML, which is required to run custom Javascript code in the dashboard. To enable unsafe Javascript execution in text panels enable the settings disable_sanitize_html under the section [panels] in your Grafana ini file, or set env variable GF_PANELS_DISABLE_SANITIZE_HTML=true.

Author

Devops Monitoring Expert, who loves monitoring systems and cutting/bleeding edge technologies: Docker, Kubernetes, ECS, AWS, Google GCP, Terraform, Lambda, Zabbix, Grafana, Elasticsearch, Kibana, Prometheus, Sysdig,...

Summary:

Professional devops / monitoring / consulting services:

Monitoring Artist