vitess-gh/vitess-mixin
Guido Iaquinti fdc7b222f2
vitess-mixin: add structure & first 2 dashboards
Signed-off-by: Guido Iaquinti <giaquinti@slack-corp.com>
2019-12-20 22:58:25 +01:00
..
alerts vitess-mixin: add structure & first 2 dashboards 2019-12-20 22:58:25 +01:00
dashboards vitess-mixin: add structure & first 2 dashboards 2019-12-20 22:58:25 +01:00
lib vitess-mixin: add structure & first 2 dashboards 2019-12-20 22:58:25 +01:00
rules vitess-mixin: add structure & first 2 dashboards 2019-12-20 22:58:25 +01:00
.gitignore vitess-mixin: add structure & first 2 dashboards 2019-12-20 22:58:25 +01:00
Makefile vitess-mixin: add structure & first 2 dashboards 2019-12-20 22:58:25 +01:00
README.md vitess-mixin: add structure & first 2 dashboards 2019-12-20 22:58:25 +01:00
config.libsonnet vitess-mixin: add structure & first 2 dashboards 2019-12-20 22:58:25 +01:00
jsonnetfile.json vitess-mixin: add structure & first 2 dashboards 2019-12-20 22:58:25 +01:00
mixin.libsonnet vitess-mixin: add structure & first 2 dashboards 2019-12-20 22:58:25 +01:00

README.md

(Alpha) Prometheus Monitoring Mixin for Vitess

A set of Grafana dashboards and Prometheus alerts for Vitess.

Prerequisites

  1. Install jsonnet-bundler:

    • via go: go get github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb
    • via brew: brew install jsonnet
  2. Install promtool: go get github.com/prometheus/prometheus/cmd/promtool

Generate config files

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.

Running the tests (requires Docker)

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'

Background