mirror of https://github.com/prometheus/prometheus
Browse Source
This makes the mixins usable as abvertised. Signed-off-by: beorn7 <beorn@grafana.com>pull/4474/head
beorn7
5 years ago
3 changed files with 32 additions and 0 deletions
@ -0,0 +1,25 @@
|
||||
JSONNET_FMT := jsonnet fmt -n 2 --max-blank-lines 2 --string-style s --comment-style s
|
||||
|
||||
all: fmt prometheus_alerts.yaml dashboards_out lint |
||||
|
||||
fmt: |
||||
find . -name 'vendor' -prune -o -name '*.libsonnet' -print -o -name '*.jsonnet' -print | \
|
||||
xargs -n 1 -- $(JSONNET_FMT) -i
|
||||
|
||||
prometheus_alerts.yaml: mixin.libsonnet config.libsonnet alerts.libsonnet |
||||
jsonnet -S alerts.jsonnet > $@
|
||||
|
||||
dashboards_out: mixin.libsonnet config.libsonnet dashboards.libsonnet |
||||
@mkdir -p dashboards_out
|
||||
jsonnet -J vendor -m dashboards_out dashboards.jsonnet
|
||||
|
||||
lint: prometheus_alerts.yaml |
||||
find . -name 'vendor' -prune -o -name '*.libsonnet' -print -o -name '*.jsonnet' -print | \
|
||||
while read f; do \
|
||||
$(JSONNET_FMT) "$$f" | diff -u "$$f" -; \
|
||||
done
|
||||
|
||||
promtool check rules prometheus_alerts.yaml
|
||||
|
||||
clean: |
||||
rm -rf dashboards_out prometheus_alerts.yaml
|
@ -0,0 +1 @@
|
||||
std.manifestYamlDoc((import 'mixin.libsonnet').prometheusAlerts) |
Loading…
Reference in new issue