A set of Grafana dashboards and Prometheus alerts for Vitess.
-
Install
jsonnet-bundler
:- via
go
:go get github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb
- via
brew
:brew install jsonnet
- via
-
Install
promtool
:go get github.com/prometheus/prometheus/cmd/promtool
You can manually generate the alerts, dashboards and rules files:
$ make prometheus_alerts.yaml
$ make prometheus_rules.yaml
$ make dashboards_out
The prometheus_alerts.yaml
and prometheus_rules.yaml
file then need to passed
to your Prometheus server, and the files in dashboards_out
need to be imported
into you Grafana server. The exact details will depending on how you deploy your
monitoring stack.
Build the mixins, run the tests:
$ docker run -v $(pwd):/tmp --entrypoint "/bin/promtool" prom/prometheus:latest test rules /tmp/tests.yaml
Generate the alerts, rules and dashboards:
$ jsonnet -J vendor -S -e 'std.manifestYamlDoc((import "mixin.libsonnet").prometheusAlerts)' > alerts.yml
$ jsonnet -J vendor -S -e 'std.manifestYamlDoc((import "mixin.libsonnet").prometheusRules)' >files/rules.yml
$ jsonnet -J vendor -m files/dashboards -e '(import "mixin.libsonnet").grafanaDashboards'
- For more motivation, see "The RED Method: How to instrument your services" talk from CloudNativeCon Austin.
- For more information about monitoring mixins, see this design doc.