production/helm/meta-monitoring/README.md
This Helm chart provides comprehensive monitoring for Loki deployments in Kubernetes, based on the Grafana Kubernetes Monitoring Helm Chart.
The Meta-monitoring chart collects metrics and logs from Loki deployments using Grafana Alloy (an OpenTelemetry Collector distribution) and sends them to your preferred observability backend. It's designed to work with the pre-compiled Loki mixins to provide dashboards and alerts specifically tailored for Loki monitoring.
# For Grafana Cloud or self-managed stack
kubectl create namespace meta
kubectl create secret generic metrics --namespace meta \
--from-literal=username='YOUR_PROMETHEUS_USERNAME' \
--from-literal=password='YOUR_PROMETHEUS_PASSWORD'
kubectl create secret generic logs --namespace meta \
--from-literal=username='YOUR_LOKI_USERNAME' \
--from-literal=password='YOUR_LOKI_PASSWORD'
helm repo add grafana https://grafana.github.io/helm-charts
helm install meta-loki grafana/k8s-monitoring \
--namespace meta \
-f values.yaml
The default configuration is set up for Grafana Cloud, but you can direct it to your self-managed monitoring stack by modifying the destinations in values.yaml:
destinations:
- name: prometheus
type: prometheus
url: https://<PROMETHEUS-ENDPOINT>/api/prom/push
# Configure authentication as needed
- name: loki
type: loki
url: https://<LOKI-ENDPOINT>/loki/api/v1/push
# Configure authentication as needed
Note: Authentication is based on a pre-configured secret. The Helm chart does support more advanced authentication methods. Examples are provided in the k8s-monitoring documentation
This chart is designed to work with the Loki mixins found in the loki-mixin-compiled directory, which contains:
The dashboards/ directory contains JSON files that can be imported directly into Grafana:
Alternatively, use the Grafana API to programmatically import dashboards:
# Example using curl to import a dashboard
curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer YOUR_API_KEY" \
-d @path/to/dashboard.json \
https://your-grafana-instance/api/dashboards/db
For Grafana Cloud Prometheus or Grafana Mimir, use [mimirtool](https://grafana.com/docs/mimir/latest/manage/tools/mimirtool/#installation) to load the rules:
# Install mimirtool
go install github.com/grafana/mimir/pkg/mimirtool@latest
# Load alert rules
mimirtool rules load alerts.yaml \
--address=https://prometheus-prod-xxx.grafana.net/api/prom \
--id=<Your-Stack-ID> \
--key=<Your-API-Key>
# Load recording rules
mimirtool rules load rules.yaml \
--address=https://prometheus-prod-xxx.grafana.net/api/prom \
--id=<Your-Stack-ID> \
--key=<Your-API-Key>
For self-managed Prometheus:
# For Prometheus
cp rules.yaml alerts.yaml /etc/prometheus/rules/
# Then reload Prometheus configuration
curl -X POST http://prometheus:9090/-/reload
The meta-monitoring chart monitors:
app.kubernetes.io/name: loki)meta namespaceloki and meta namespacesSee the k8s-monitoring documentation for additional configuration options for: