Open source RSS

Monitoring

Built-in monitoring (Prometheus Operator)

The Loki Helm chart can render ServiceMonitors, PrometheusRule recording rules, PrometheusRule alerts, and Grafana dashboards from the upstream loki-mixin:

YAML
monitoring:
  serviceMonitor:
    enabled: true
  rules:
    enabled: true   # recording rules only
  alerts:
    enabled: true   # alert rules (separate since chart 18.0.0)
  dashboards:
    enabled: true

All monitoring resources are disabled by default.

As of chart 18.0.0, alert rules are managed under monitoring.alerts, not monitoring.rules (which now controls recording rules only). The release-identifying metric label is app_instance by default (monitoring.appInstanceLabelName).

For details on available monitoring keys, refer to the Helm Chart Reference.

Deploying dashboards via the Grafana Operator

Instead of ConfigMaps, the chart can render GrafanaDashboard custom resources for the Grafana Operator project. When you run an operator-managed Grafana instance, this lets that instance import the Loki dashboards automatically, without a sidecar watching ConfigMaps.

YAML
monitoring:
  dashboards:
    enabled: true
    grafanaOperator:
      enabled: true
      instanceSelector:
        matchLabels:
          dashboards: "grafana"
      folder: Loki

instanceSelector is a label selector that the Grafana Operator matches against the labels on your Grafana custom resource; an empty selector (the default) matches every Grafana instance. folder, folderUID, and folderRef all place the dashboards into a folder in Grafana, so set only one of them.

For the full list of monitoring.dashboards.grafanaOperator keys, including annotations, labels, and resyncPeriod, refer to the Helm Chart Reference.

Warning

We no longer recommend using the meta-monitoring Helm chart to monitor Loki. The former monitoring.selfMonitoring / Grafana Agent integration was removed in chart 9.0.0. To consolidate monitoring efforts into one Helm chart, Grafana Labs recommends using the Kubernetes monitoring Helm chart. Instructions for setting up the Kubernetes monitoring Helm chart can be found under Manage.