jsonnet mixins for grafana dashboards, alertmanager rules and prometheus/mimir recordingrules
  • Jsonnet 97.5%
  • Just 2.5%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2024-12-08 23:53:15 +01:00
node-exporter feat(node-exporter): ✨ Add node exporter mixin 2024-12-08 23:53:04 +01:00
node-exporter-compiled feat(node-exporter): ✨ Add node exporter mixin 2024-12-08 23:53:04 +01:00
.gitignore chore: 🔧 Initial commit 2024-12-08 21:23:47 +01:00
.pre-commit-config.yaml chore: 🔧 Initial commit 2024-12-08 21:23:47 +01:00
devbox.json chore: 🔧 Initial commit 2024-12-08 21:23:47 +01:00
devbox.lock chore: 🔧 Initial commit 2024-12-08 21:23:47 +01:00
justfile chore: 🔧 Initial commit 2024-12-08 21:23:47 +01:00
LICENSE chore: 🔧 Initial commit 2024-12-08 21:23:47 +01:00
README.md docs: 📝 Explain better how to customize the mixins 2024-12-08 23:53:15 +01:00

Monitoring mixins

Collection of monitoring mixins

Requirements

  • jsonnet
  • jsonnet-bundler

Customising the mixin

Ensure you installed the listed packages above

Create a new directory and initilize jsonnet-bundler

jb init

Install the mixin you want to customize

jb install https://codeberg.org/cayne/monitoring-mixins/node-exporter@main

Then create a mixin.libsonnet file to customize the mixin

For example:

local nodeExporter = import 'codeberg.org/cayne/monitoring-mixins/node-exporter/mixin.libsonnet';

nodeExporter {
  _config+:: {
    nodeExporterSelector: 'node',
  },
}

Now you can generate the dashboards, alerting and recording rules

mkdir -p compiled/dashboards

jsonnet -J vendor -m compiled/dashboards -e '(import "mixin.libsonnet").grafanaDashboards'

jsonnet -J vendor -S -e 'std.manifestYamlDoc((import "mixin.libsonnet").prometheusRules)' > compiled/rules.yml

jsonnet -J vendor -S -e 'std.manifestYamlDoc((import "mixin.libsonnet").prometheusAlerts)' > compiled/alerts.yml

Development

Requirements

  • devbox or all packages listed in devbox.json

Clone this repository

git clone https://codeberg.org/cayne/monitoring-mixins

Enter devbox shell

devbox shell

Generate node exporter mixin

just generate-all node-exporter