/grafyaml

A nice and easy way to template Grafana dashboards in YAML 📊 🎉

Primary LanguagePythonApache License 2.0Apache-2.0

grafyaml: Grafana dashboards templated in YAML

Delivery Hero ❤️ Grafana

Delivery Hero are big fans of Grafana but when Prometheus becomes your default storage for metrics of all types then the importance of good, consistent and manageable Grafana dashboards becomes paramount. Then once you add many teams, applications, services and environments to the mix, it becomes clear that a tool is needed to manage this complexity. This is that tool 🎉

  • No more headaches with copying, pasting and editing JSON
  • Template panels and use them in multiple dashboards
  • Mass update many dashboards quickly and easily

Install and quick start

Install grafyaml:

pip3 install https://github.com/deliveryhero/grafyaml/archive/master.zip

Create a file, e.g. my-example-dashboard.yaml:

dashboard:
  title: My Dashboard
  rows:
  - title: Container metrics
    height: 500px
    panels:
    - title: Container CPU usage
      targets:
      - expr: rate(container_cpu_user_seconds_total[30s]) * 100
      type: graph

Sync it to Grafana:

export GRAFANA_API_KEY="API_KEY_HERE"
grafana-dashboard --grafana-url https://my-grafana-host.domain.com update my-example-dashboard.yaml

More examples

License, history and contributors

The LICENSE is Apache License 2.0. Most of the code in this repository was initially written at opendev.org/opendev/grafyaml before being forked to here.