Uploaded image for project: 'OpenShift Logging'
  1. OpenShift Logging
  2. LOG-5918

OpenshiftLabels are not added to log data when the output type is OTLP.

XMLWordPrintable

    • False
    • None
    • False
    • NEW
    • OBSDA-498 - Enable OpenTelemetry in Cluster Logging Operator
    • VERIFIED
    • Release Note Not Required
    • Log Collection - Sprint 257, Log Collection - Sprint 258
    • Moderate

      Description of problem:

      Add filter openShiftLabels to an otlp output, then check the logs in log store, the labels are not added into log data:

      CLF:

      apiVersion: observability.openshift.io/v1
      kind: ClusterLogForwarder
      metadata:
        annotations:
          observability.openshift.io/tech-preview-otlp-output: enabled
        name: clf-otlp
        namespace: logging-otlp
      spec:
        filters:
        - name: openshift-labels
          openShiftLabels:
            clf/observability.openshift.io: logging-74947
            label-test: ocp-74947
          type: openShiftLabels
        - name: detect-multiline-exception
          type: detectMultilineException
        managementState: Managed
        outputs:
        - name: otlp
          otlp:
            tuning:
              compression: gzip
              delivery: atLeastOnce
              maxRetryDuration: 20
              maxWrite: 10M
              minRetryDuration: 5
            url: http://otel-collector.openshift-opentelemetry-operator.svc:4318/v1/logs
          type: otlp
        pipelines:
        - filterRefs:
          - openshift-labels
          - detect-multiline-exception
          inputRefs:
          - application
          name: audit-logs
          outputRefs:
          - otlp
        serviceAccount:
          name: logging-otlp

      Log data:

      2024-08-01T05:32:28.796Z	info	LogsExporter	{"kind": "exporter", "data_type": "logs", "name": "debug", "resource logs": 1, "log records": 250}
      2024-08-01T05:32:28.799Z	info	ResourceLog #0
      Resource SchemaURL: 
      Resource attributes:
           -> cluster.id: Str(bd6c0b9e-939a-4079-a306-80b0f27c66c9)
           -> openshift.log.source: Str(container)
           -> k8s.pod.name: Str(multiline-log-6d689cb58-6pg6v)
           -> k8s.container.name: Str(multiline-log)
           -> k8s.namespace.name: Str(multiline-errors)
      ScopeLogs #0
      ScopeLogs SchemaURL: 
      InstrumentationScope 
      LogRecord #0
      ObservedTimestamp: 2024-08-01 05:24:08.579642076 +0000 UTC
      Timestamp: 2024-08-01 05:24:07.864896649 +0000 UTC
      SeverityText: 
      SeverityNumber: Info(9)
      Body: Str(Traceback (most recent call last):
      	File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 1535, in __call__
      	  rv = self.handle_exception(request, response, e)
      	File "/base/data/home/apps/s~nearfieldspy/1.378705245900539993/nearfieldspy.py", line 17, in start
      	  return get()
      	File "/base/data/home/apps/s~nearfieldspy/1.378705245900539993/nearfieldspy.py", line 5, in get
      	  raise Exception('spam', 'eggs')
      Exception: ('spam', 'eggs'))
      Attributes:
           -> openshift.log.type: Str(application)
           -> k8s.pod.uid: Str(5ff35f11-6d10-4073-a029-59d125e9eca1)
           -> k8s.container.id: Str(cri-o://5be23ed5ad320bde67e1141d862333495493a9327e53de538b34cec1971f69aa)
           -> k8s.pod.label.name: Str(multiline-log)
           -> k8s.pod.label.pod-template-hash: Str(6d689cb58)
      Trace ID: 
      Span ID: 
      Flags: 0 

      vector.toml

      Version-Release number of selected component (if applicable):

      openshift-logging/cluster-logging-rhel9-operator/images/v6.0.0-60

      How reproducible:

      Always

      Steps to Reproduce:

      Actual results:

      Expected results:

      openShiftLabels should be added into log data.

      Additional info:

              cahartma@redhat.com Casey Hartman
              qitang@redhat.com Qiaoling Tang
              Qiaoling Tang Qiaoling Tang
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: