What are monitoring mixins and how do you consume them?
AdvancedProductionObservability as Code, Security & Vendor Choices
Answer
A mixin is a Jsonnet package bundling dashboards, recording rules and alerts for one system, written by people who know it (kubernetes-mixin, node-mixin, Prometheus, Loki, Mimir, etcd mixins). kube-prometheus-stack is largely built from them.
jb init && jb install github.com/kubernetes-monitoring/kubernetes-mixin@master
# render with a small jsonnet file that imports the mixin and overrides _config
jsonnet -J vendor -m out/ render.jsonnet
We override _config (selectors, thresholds, clusterLabel) instead of editing generated YAML, pin versions, and re-render on upgrade. Editing the generated output by hand is how teams end up stuck on a three-year-old mixin.
More on Observability as Code, Security & Vendor Choices
What does "observability as code" cover, and why insist on it?BeginnerHow do you manage Grafana with Terraform?IntermediateHow do you validate Alertmanager configuration in CI?BeginnerWhat does a CI pipeline for Prometheus rules look like?IntermediateRaw dashboard JSON, Jsonnet/Grafonnet or the Grafana Foundation SDK: which do you pick?AdvancedHow do Grafana dashboards get loaded automatically in `kube-prometheus-stack`?Beginner