mirror of
https://github.com/rfmoz/grafana-dashboards.git
synced 2025-03-05 20:51:45 -08:00
add make deploy
This commit is contained in:
parent
5e83738d1d
commit
a9f76485dd
|
@ -29,6 +29,24 @@ dashboards_out: mixin.libsonnet config.libsonnet $(wildcard dashboards/*)
|
||||||
prometheus_alerts.yaml: mixin.libsonnet alerts/*.libsonnet
|
prometheus_alerts.yaml: mixin.libsonnet alerts/*.libsonnet
|
||||||
mixtool generate alerts mixin.libsonnet -a prometheus_alerts.yaml
|
mixtool generate alerts mixin.libsonnet -a prometheus_alerts.yaml
|
||||||
|
|
||||||
|
|
||||||
|
.PHONY: deploy deploy_rules deploy_dashboards
|
||||||
|
deploy: deploy_rules deploy_dashboards
|
||||||
|
|
||||||
|
deploy_dashboards:
|
||||||
|
ifdef GRAFANA_URL
|
||||||
|
grr apply mixin.libsonnet --target "Dashboard.*" --target "DashboardFolder.*"
|
||||||
|
else
|
||||||
|
$(warning GRAFANA_URL is not set, skipping grafana dashboards deployment)
|
||||||
|
endif
|
||||||
|
|
||||||
|
deploy_rules:
|
||||||
|
ifdef CORTEX_ADDRESS
|
||||||
|
grr apply mixin.libsonnet --target "PrometheusRuleGroup.*"
|
||||||
|
else
|
||||||
|
$(warning CORTEX_ADDRESS is not set, skipping prometheus alerts deployment)
|
||||||
|
endif
|
||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
clean:
|
clean:
|
||||||
rm -rf dashboards_out prometheus_alerts.yaml
|
rm -rf dashboards_out prometheus_alerts.yaml
|
||||||
|
|
|
@ -4,7 +4,7 @@ Apache HTTP mixin is a set of configurable Grafana dashboards and alerts based o
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
Install tools before generating dashboards and alerts:
|
## Install tools
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
go install github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb@latest
|
go install github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb@latest
|
||||||
|
@ -23,11 +23,24 @@ into your Grafana server. The exact details will be depending on your environme
|
||||||
|
|
||||||
`prometheus_alerts.yaml` needs to be imported into Prometheus.
|
`prometheus_alerts.yaml` needs to be imported into Prometheus.
|
||||||
|
|
||||||
|
## Generate dashboards and alerts
|
||||||
|
|
||||||
Edit `config.libsonnet` if required and then build JSON dashboard files for Grafana:
|
Edit `config.libsonnet` if required and then build JSON dashboard files for Grafana:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
make
|
make
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Import dashboards and alerts using Grizzly tool
|
||||||
|
|
||||||
|
Install grizzly first: https://grafana.github.io/grizzly/installation/
|
||||||
|
|
||||||
|
Set env variables GRAFANA_URL and optionally CORTEX_ADDRESS (see for [details](https://grafana.github.io/grizzly/authentication/)).
|
||||||
|
|
||||||
|
Then run to actually import the dashboards and alerts into Grafana instance:
|
||||||
|
```bash
|
||||||
|
make deploy
|
||||||
|
```
|
||||||
|
|
||||||
For more advanced uses of mixins, see
|
For more advanced uses of mixins, see
|
||||||
https://github.com/monitoring-mixins/docs.
|
https://github.com/monitoring-mixins/docs.
|
||||||
|
|
Loading…
Reference in a new issue