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

Logs from selected namespaces are still collected when the maxRecordsPerSecond is 0.

XMLWordPrintable

    • False
    • None
    • False
    • NEW
    • NEW
    • Hide
      Before this update, it was possible to set containerLimit.maxRecordsPerSecond to zero, which could lead to an exception during Vector's startup.
      With this update, the configuration is validated before being applied, and any invalid values (less than or equal to zero) will be rejected.
      Show
      Before this update, it was possible to set containerLimit.maxRecordsPerSecond to zero, which could lead to an exception during Vector's startup. With this update, the configuration is validated before being applied, and any invalid values (less than or equal to zero) will be rejected.
    • Bug Fix

      Description of problem:

      When setting containerLimit.maxRecordsPerSecond to 0, logs from selected namespaces are still collected.

      CLF:

      apiVersion: logging.openshift.io/v1
      kind: ClusterLogForwarder
      metadata:
        name: instance
        namespace: openshift-logging
      spec:
        inputs:
        - application:
            containerLimit:
              maxRecordsPerSecond: 0
            namespaces:
            - test-project-1
            - test-project-2
          name: limited-rates-1
        - application:
            namespaces:
            - test-project-3
            - test-project-4
          name: app-logs
        - application:
            containerLimit:
              maxRecordsPerSecond: 10
            namespaces:
            - test-project-5
          name: limited-rates-2
        pipelines:
        - inputRefs:
          - limited-rates-1
          - limited-rates-2
          - app-logs
          - infrastructure
          name: to-default
          outputRefs:
          - default 

      vector.toml:

      [transforms.route_application_logs]
      type = "route"
      inputs = ["application"]
      route.app-logs = '(.kubernetes.namespace_name == "test-project-3") || (.kubernetes.namespace_name == "test-project-4")'
      route.limited-rates-1 = '(.kubernetes.namespace_name == "test-project-1") || (.kubernetes.namespace_name == "test-project-2")'
      route.limited-rates-2 = '.kubernetes.namespace_name == "test-project-5"'
      
      
      
      
      [transforms.source_throttle_limited-rates-2]
      type = "throttle"
      inputs = ["route_application_logs.limited-rates-2"]
      window_secs = 1
      threshold = 10
      key_field = "{{ file }}"
      
      
      [transforms.to_default_user_defined]
      type = "remap"
      inputs = ["route_application_logs.limited-rates-1","source_throttle_limited-rates-2","route_application_logs.app-logs","infrastructure"]
      source = '''
        .
      ''' 

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

      openshift-logging/cluster-logging-rhel9-operator/images/v5.8.0-188

      How reproducible:

      Always

      Steps to Reproduce:

      1.  Deploy clusterlogging
      2. Create CLF with above yaml
      3. Create some projects and create some pods in these projects to generate logs

      Actual results:

      Logs from selected namespaces are collected when the maxRecordsPerSecond is 0.

      $ oc exec elasticsearch-cdm-g46bh9kz-1-788c868978-tz4dl -- es_util --query=app*/_count?pretty -d '{"query": {"match_phrase": {"kubernetes.namespace_name": "test-project-1"}}}'
      Defaulted container "elasticsearch" out of: elasticsearch, proxy
      {
        "count" : 73033,
        "_shards" : {
          "total" : 3,
          "successful" : 3,
          "skipped" : 0,
          "failed" : 0
        }
      }
      $ oc exec elasticsearch-cdm-g46bh9kz-1-788c868978-tz4dl -- es_util --query=app*/_count?pretty -d '{"query": {"match_phrase": {"kubernetes.namespace_name": "test-project-2"}}}'
      Defaulted container "elasticsearch" out of: elasticsearch, proxy
      {
        "count" : 72423,
        "_shards" : {
          "total" : 3,
          "successful" : 3,
          "skipped" : 0,
          "failed" : 0
        }
      } 

      Expected results:

      Logs from selected namespaces should not be collected when the maxRecordsPerSecond is 0.

      Additional info:

              vparfono Vitalii Parfonov
              qitang@redhat.com Qiaoling Tang
              Qiaoling Tang Qiaoling Tang
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: