openshift/cluster-logging-operator

Labels from ClusterLogForwarder are prefixed by openshift.labels.

Avarei opened this issue · 3 comments

Describe the bug
Labels from ClusterLogForwarder are prefixed by openshift.labels.

Environment

  • OpenShift 4.7.13 (Bare Metal)
  • Red Hat OpenShift Logging 5.0.5-11

Expected behavior
Logs contain a foo: bar field

Actual behavior
Logs contain a openshift.labels.foo: bar field

To Reproduce
Steps to reproduce the behavior:

  1. Create ClusterLogging instance using EFK stack like described in the OpenShift Documentation
  2. create a Clusterlogforwarder with a label:
apiVersion: "logging.openshift.io/v1"
kind: ClusterLogForwarder
metadata:
  name: instance 
  namespace: openshift-logging 
spec:
  outputs: []
  pipelines:
   - name: enable-default-log-store 
     inputRefs:
     - application
     - infrastructure
     - audit
     outputRefs:
     - default 
     labels:
       foo: bar
  1. Wait for the FluentD Pods to reboot
  2. View the Kibana Dashboard Logs

This is by design: https://github.com/openshift/enhancements/blob/master/enhancements/cluster-logging/forwarder-tagging.md These are static labels that are added to every message.

This is unexpected and undocumented behaviour (undocumented in the OpenShift documentation and in the ClusterLogForward CRD)

In the Design document you sent, I do not see any reasoning for this kind of prefix, nor can I see any benefit of having it.

This Design decision introduces a Limitation which is seemingly without payoff, since it would also be possible to set openshift.labels.foo: bar as a label if desired.
As the key and value are set by the Admin I believe the Admin should be responsible for choosing its name.

If an Admin aggregates the logs at a central log stack from VMs, applications AND OpenShift Clusters they may want to add these kind of static labels to all of their logs. (For example for classification of logs)

I ask you to reconsider the decision of prepending this prefix.

The alternatives that I see are far worse, as admins would be forced to either:

  • rewrite the log entry at the central log stack
  • run this operator in the unmanaged Mode, to overwrite the fluentd config.

I would like to reopen this issue for discussion.