Project: Grafana Mimir (Observability and Analysis / Observability)
File: installing-dashboards-and-alerts.md

aliases: ../../operators-guide/monitoring-grafana-mimir/installing-dashboards-and-alerts/ ../../operators-guide/visualizing-metrics/installing-dashboards-and-alerts/ ../../operators-guide/monitor-grafana-mimir/installing-dashboards-and-alerts/ description: Learn how to install Grafana Mimir dashboards and alerts. menuTitle: Installing dashboards and alerts title: Installing Grafana Mimir dashboards and alerts weight: 30 Grafana Mimir is shipped with a comprehensive set of production-ready Grafana and alerts to monitor the state and health of a Mimir cluster. Grafana Mimir dashboards and alerts to be set by Prometheus or Grafana Agent when scraping your Mimir cluster metrics Some dashboards require recording rules that you should install in your Prometheus Grafana Mimir provides ready to use Grafana dashboards in the `.json` format and Prometheus alerts in the `.yaml` format, that you can directly import into your Grafana installation and Prometheus config. The packaged dashboards and alerts have been compiled from the sources using a default configuration and don't allow you to customize the . If you need to customize the required metrics label names please choose one of the other installation options. Download , and from Grafana Mimir repository Install recording rules and alerts in your Prometheus Grafana Mimir dashboards and alerts are built using language and you can compile them from sources. If you choose this option, you can change the configuration to match your deployment, like customizing the . Checkout Mimir source code ```bash git clone https://github.com/grafana/mimir.git ``` Review the mixin configuration at `operations/mimir-mixin/config.libsonnet`, and apply your changes if necessary. Compile the mixin ```bash make build-mixin ``` Import the dashboards saved at `operations/mimir-mixin-compiled/dashboards/` in Install the recording rules saved at `operations/mimir-mixin-compiled/rules.yaml` in your Prometheus Install the alerts saved at `operations/mimir-mixin-compiled/alerts.yaml` in your Prometheus In case you're already using Jsonnet to define your infrastructure as a code, you can vendor the Grafana Mimir mixin directly into your infrastructure repository and configure it overriding the `_config` fields. Given the exact setup really depends on a case-by-case basis, the following instructions are not meant to be prescriptive but just show the main steps required to vendor the mixin. Initialize Jsonnet ```bash jb init ``` Install Grafana Mimir mixin ```bash jb install github.com/grafana/mimir/operations/mimir-mixin@main ``` Import and configure it ```jsonnet (import 'github.com/grafana/mimir/operations/mimir-mixin/mixin.libsonnet') + { _config+:: { // Override the Grafana Mimir mixin config here. }, } ``` Based on Jsonnet configuration file, you can use to deploy the mixin in both Grafana and Grafana Mimir. To do so, you can use , , and providers. Create a Terraform `main.tf` file: ```hcl terraform { required_version = ">= 1.3.5" required_providers { mixtool = { source = "ovh/mixtool" version = "~> 0.1.1" } mimirtool = { source = "ovh/mimirtool" version = "~> 0.1.1" } grafana = { source = "grafana/grafana" version = "~> 1.32.0" } } } provider "grafana" { url = "http://localhost:9000" auth = "admin:admin" } provider "mimirtool" { address = "http://localhost:9009" tenant_id = "anonymous" } locals { mixin_source = "custom.libsonnet" jsonnet_path = "vendor" } data "mixtool_alerts" "mimir" { source = local.mixin_source jsonnetpath = [local.jsonnetpath] } data "mixtool_rules" "mimir" { source = local.mixin_source jsonnetpath = [local.jsonnetpath] } data "mixtool_dashboards" "mimir" { source = local.mixin_source jsonnetpath = [local.jsonnetpath] } resource "mimirtoolrulernamespace" "rules" { namespace = "rules_community" configyaml = data.mixtoolrules.mimir.rules } resource "mimirtoolrulernamespace" "alerts" { namespace = "alerts_community" configyaml = data.mixtoolalerts.mimir.alerts } resource "grafana_dashboard" "mimir" { foreach = data.mixtooldashboards.mimir.dashboards config_json = each.value } ``` Initialize Terraform: ```bash terraform init ``` Review the changes that Terraform would apply to your infrastructure: ```bash terraform plan ``` Deploy the changes: ```bash terraform apply ```