socksshop/graphs
whystar b84aecc4c1 init commit 2019-10-21 16:50:33 +08:00
..
Dockerfile init commit 2019-10-21 16:50:33 +08:00
README.md init commit 2019-10-21 16:50:33 +08:00
kubernetes.dashboard.py init commit 2019-10-21 16:50:33 +08:00
prometheus.dashboard.py init commit 2019-10-21 16:50:33 +08:00
sock-shop-performance.dashboard.py init commit 2019-10-21 16:50:33 +08:00
sock-shop-resources.dashboard.py init commit 2019-10-21 16:50:33 +08:00

README.md

Grafana Dashboards

We have included a set of dashboards for Grafana in this demo application. Most of the source of these dashboards look exactly the same. For the sake of keeping our code DRY, we have decided to generate our dashboards using grafanalib.

Requirements

what version
docker >= 17

Getting Started

Make sure that you run the following commands from within the graphs/ directory:

cd graphs/

The Base Image

All the tooling required to generate the dashboards is inside a container. Build it with like this:

docker build -t weaveworks/grafanalib .

Generating Dashboards

docker run --rm -it -v ${PWD}:/opt/code weaveworks/grafanalib /bin/sh -c 'ls /opt/code/*.dashboard.py | parallel generate-dashboard -o {.}.json {}'

This will output all the dashboards for Grafana in JSON format, ready to be imported.

ls -l *.json
-rw-r--r-- 1 john admin 31361 Aug 30 16:12 kubernetes.dashboard.json
-rw-r--r-- 1 john admin 16729 Aug 30 16:12 prometheus.dashboard.json
-rw-r--r-- 1 john admin 40797 Aug 30 16:12 sock-shop-performance.dashboard.json
-rw-r--r-- 1 john admin 17859 Aug 30 16:12 sock-shop-resources.dashboard.json

Importing the dashboards

To import the dashboards, update the deploy/kubernetes/manifests-monitoring/grafana-configmap.yaml file with each dashboard JSON accordingly. For example, to update the Sock Shop Performance dashboard, find the sock-shop-performance-dashboard.json line on the grafana-configmap.yaml file and fill the field with the contents of the sock-sock-performance-dashboard.json file.

The same process needs to be followed for the rest of the dashboards.

Find the instructions on how to deploy Grafana and the dashboards here.