From b2641e5e456b72a4e0d91bc657ad64c4dbcb6ae2 Mon Sep 17 00:00:00 2001 From: Scott Leggett Date: Mon, 29 May 2023 14:20:31 +0800 Subject: [PATCH 1/2] feat: add configuration for logging-operator metrics ServiceMonitor Enable the fluentbit ServiceMonitor by default. --- charts/lagoon-logging/templates/logging.yaml | 8 ++++++++ charts/lagoon-logging/values.yaml | 12 ++++++++++++ 2 files changed, 20 insertions(+) diff --git a/charts/lagoon-logging/templates/logging.yaml b/charts/lagoon-logging/templates/logging.yaml index d55cdadf..3393d950 100644 --- a/charts/lagoon-logging/templates/logging.yaml +++ b/charts/lagoon-logging/templates/logging.yaml @@ -12,6 +12,10 @@ spec: fsGroup: 0 scaling: replicas: {{ .Values.fluentdReplicaCount }} + {{- with .Values.fluentdMetrics }} + metrics: + {{- toYaml . | nindent 6 }} + {{- end }} fluentbit: # Enable a default liveness check to avoid stuck pods. # At the time of writing this just hits the metrics endpoint. @@ -26,4 +30,8 @@ spec: tolerations: {{- toYaml . | nindent 4 }} {{- end }} + {{- with .Values.fluentbitMetrics }} + metrics: + {{- toYaml . | nindent 6 }} + {{- end }} controlNamespace: {{ .Release.Namespace | quote }} diff --git a/charts/lagoon-logging/values.yaml b/charts/lagoon-logging/values.yaml index d85363cb..7505be41 100644 --- a/charts/lagoon-logging/values.yaml +++ b/charts/lagoon-logging/values.yaml @@ -261,6 +261,18 @@ fluentbitTolerations: key: lagoon.sh/spot operator: Exists +# Expose metrics of the Logging Operator's fluentbit daemonset and fluentd +# statefulset via a Prometheus Operator compatible ServiceMonitor object. +# +# The fluentd serviceMonitor is disabled by default until a use-case is found. +# +# See here for full documentation of this field: +# https://kube-logging.dev/docs/operation/logging-operator-monitoring/#metrics-variables +fluentbitMetrics: + serviceMonitor: true +# fluentdMetrics: +# serviceMonitor: true + # This chart assumes the container runtime is containerd, which puts the log # message in the `message` field of the log record. # From 71f17abe723f3892c2d99b022433b2e214e235ab Mon Sep 17 00:00:00 2001 From: Scott Leggett Date: Mon, 29 May 2023 14:25:18 +0800 Subject: [PATCH 2/2] chore: bump lagoon-logging chart version --- charts/lagoon-logging/Chart.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/lagoon-logging/Chart.yaml b/charts/lagoon-logging/Chart.yaml index c1e8174e..b8133717 100644 --- a/charts/lagoon-logging/Chart.yaml +++ b/charts/lagoon-logging/Chart.yaml @@ -19,7 +19,7 @@ type: application # time you make changes to the chart and its templates, including the app # version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.76.0 +version: 0.77.0 dependencies: - name: logging-operator @@ -33,4 +33,4 @@ dependencies: annotations: artifacthub.io/changes: | - kind: added - description: added chart option to inject a configuration snippet for post-processing router logs + description: add chart option to configure logging-operator subchart metrics, and enable the fluentbit ServiceMonitor by default