Monitor your logging pipeline with Prometheus Operator
You can configure the Logging operator to expose metrics endpoints for Fluentd, Fluent Bit, and syslog-ng using ServiceMonitor resources. That way, a Prometheus operator running in the same cluster can automatically fetch your logging metrics.
Metrics Variables
You can configure the following metrics-related options in the fluentdSpec, syslogNGSpec, and fluentbitSpec sections of your Logging resource.
Variable Name | Type | Required | Default | Description |
---|---|---|---|---|
interval | string | No | “15s” | Scrape Interval |
timeout | string | No | “5s” | Scrape Timeout |
port | int | No | - | Metrics Port. |
path | int | No | - | Metrics Path. |
serviceMonitor | bool | No | false | Enable to create ServiceMonitor for Prometheus operator |
prometheusAnnotations | bool | No | false | Add prometheus labels to fluent pods. |
For example:
For more details on installing the Prometheus operator and configuring and accessing metrics, see the following procedures.
Install Prometheus Operator with Helm
-
Create
logging
namespace -
Install Prometheus Operator
Prometheus Operator Documentation The prometheus-operator install may take a few more minutes. Please be patient. The logging-operator metrics function depends on the prometheus-operator’s resources. If those do not exist in the cluster it may cause the logging-operator’s malfunction.
Install Logging Operator with Helm
-
Add operator chart repository:
-
Logging Operator
Install Minio
-
Create Minio Credential Secret
-
Deploy Minio
-
Create
logging
resourceNote:
ClusterOutput
andClusterFlow
resource will only be accepted in thecontrolNamespace
-
Create Minio output definition
Note: For production set-up we recommend using longer
timekey
interval to avoid generating too many object. -
Create
flow
resource -
Install log-generator to produce logs with the label
app.kubernetes.io/name: log-generator
Validation
Minio
-
Get Minio login credentials
-
Forward Service
-
Open the Minio Dashboard: http://localhost:9000
Prometheus
-
Forward Service
-
Open the Prometheus Dashboard: http://localhost:9090
Grafana
-
Get Grafana login credentials
Default username:
admin
-
Forward Service
-
Open Gradana Dashboard: http://localhost:3000