Integrating Longhorn metrics into the Rancher monitoring system

About the Rancher Monitoring System

Using Rancher, you can monitor the state and processes of your cluster nodes, Kubernetes components, and software deployments through integration with Prometheus, a leading open-source monitoring solution.

See here for the instruction about how to deploy/enable the Rancher monitoring system.

Add Longhorn Metrics to the Rancher Monitoring System

If you are using Rancher to manage your Kubernetes and already enabled Rancher monitoring, you can add Longhorn metrics to Rancher monitoring by simply deploying the following ServiceMonitor:

  1. apiVersion: monitoring.coreos.com/v1
  2. kind: ServiceMonitor
  3. metadata:
  4. name: longhorn-prometheus-servicemonitor
  5. namespace: longhorn-system
  6. labels:
  7. name: longhorn-prometheus-servicemonitor
  8. spec:
  9. selector:
  10. matchLabels:
  11. app: longhorn-manager
  12. namespaceSelector:
  13. matchNames:
  14. - longhorn-system
  15. endpoints:
  16. - port: manager

Once the ServiceMonitor is created, Rancher will automatically discover all Longhorn metrics.

You can then set up a Grafana dashboard for visualization.

You can import our prebuilt Longhorn example dashboard to have an idea.

You can also set up alerts in Rancher UI.


© 2019-2023 Longhorn Authors | Documentation Distributed under CC-BY-4.0

© 2023 The Linux Foundation. All rights reserved. The Linux Foundation has registered trademarks and uses trademarks. For a list of trademarks of The Linux Foundation, please see our Trademark Usage page.

Integrating Longhorn metrics into the Rancher monitoring system - 图1 Integrating Longhorn metrics into the Rancher monitoring system - 图2 Integrating Longhorn metrics into the Rancher monitoring system - 图3 Integrating Longhorn metrics into the Rancher monitoring system - 图4 Integrating Longhorn metrics into the Rancher monitoring system - 图5