Enabling ServiceMonitors for fluentd and fluentbit in rancher-logging
This document (000021712) is provided subject to the disclaimer at the end of this document.
Environment
- SUSE Rancher v2.9+
- rancher-monitoring installed
- rancher-logging installed
Situation
There are several ways of enabling ServiceMonitors in the rancher-logging helm chart, for both fluentd and fluent bit. This article details the correct configuration to ensure the ServiceMonitors are enabled for all logging instances.
Resolution
Rancher v2.10+
In Rancher v2.10+, with rancher-logging 105.0.0+up4.8.0 and above, ServiceMonitors can be configured via the fluentd.metrics.serviceMonitor and fluentbit.metrics.serviceMonitor values of the rancher-logging Helm Chart:
fluentd:
metrics:
serviceMonitor: true
fluentbit:
metrics:
serviceMonitor: true
Rancher v2.9
In Rancher v2.9 an overlay configuration is needed for it to work correctly and expose the metrics offered by both fluentd and fluent bit. To do so, the following parameters have to be defined in the values of the rancher-logging Helm Chart:
loggingOverlay:
spec:
fluentd:
metrics:
serviceMonitor: true
fluentbitAgentOverlay:
spec:
metrics:
serviceMonitor: true
After upgrading the chart with these values, the metrics will start to appear in rancher-monitoring.
Disclaimer
This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.