kube-logging / logging-operator

Logging operator for Kubernetes
https://kube-logging.dev
Apache License 2.0
1.54k stars 329 forks source link

Metrics endpoint does not configure correctly in logging CRD #1830

Closed ServerNinja closed 3 days ago

ServerNinja commented 5 days ago

Problem description

Using the "logging" CRD, I'm noticing that the fluentd and fluentbit configurations are not respecting the metrics.serviceMonitor: true configuration. Interestingly, it does configure the buffer metrics for fluentd.

What I've noticed is that with metrics enabled, the operator will configure the serviceMonitor objects in K8s but do not configure the metrics endpoints on the daemonset for fluentbit nor the statefulset for fluentd.

Versions: Logging-operator helm chart version: 4.9.0 Logging-operator docker image: ghcr.io/kube-logging/logging-operator:4.9.0

"logging" manifest":

---
apiVersion: logging.banzaicloud.io/v1beta1
kind: Logging
metadata:
  name: logging
spec:
  controlNamespace: logging-operator
  fluentbit:
    inputTail:
      Mem_Buf_Limit: 50M
    metrics:
      serviceMonitor: true
    podPriorityClassName: system-node-critical
    resources:
      limits:
        cpu: 500m
        memory: 200Mi
      requests:
        cpu: 250m
        memory: 100Mi
    tolerations: []
  fluentd:
    bufferStorageVolume:
      pvc:
        spec:
          accessModes:
          - ReadWriteOnce
          resources:
            requests:
              storage: 10Gi
          storageClassName: ebs-csi-gp3-persistent
          volumeMode: Filesystem
    bufferVolumeMetrics:
      serviceMonitor: true
    logLevel: info
    metrics:
      serviceMonitor: true
    podPriorityClassName: system-node-critical
    resources:
      limits:
        cpu: 2
        memory: 300Mi
      requests:
        cpu: 500m
        memory: 100Mi
    scaling:
      replicas: 3
    tolerations: []

Screenshots: The serviceMonitor is created as expected

Screenshot 2024-10-18 at 4 16 23 PM

However, the http-metrics port is not exposed in the statefulset configuration

Screenshot 2024-10-18 at 4 13 45 PM

Any help or advice is much appreciated

csatib02 commented 3 days ago

Hey @ServerNinja,

Thanks for using Logging-operator. Here's how our monitoring system works:

kép kép kép kép