kube-logging / logging-operator

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

Fluentd file buffering does not work with logz plugin #730

Closed ekhaydarov closed 3 years ago

ekhaydarov commented 3 years ago

Describe the bug: By default logz_buffering is enabled. However, /buffers persistent volumes are created by default too which idles. Manually setting buffer to file starts writing buffers to the /buffers volume. However, data that is sent is not then flushed so the files just build up. Having turned log level to debug there is no error or warning in the /fluentd/logs/out.

Expected behaviour: Default chart template should either be memory buffers and persistent volume disabled or file buffers enable and persistent volume enabled. Then file buffers should send to logz and flush the .buffer and .buffer.meta files

Steps to reproduce the bug: Install logging-operator-logging 3.9.2. then set file buffers for logz clusteroutput

clusterOutputs:
  - name: logz
    spec:
      logz:
        buffer:
          type: file
        endpoint:
          url: https://listener-nl.logz.io
          port: 8071

Additional context: Add any other context about the problem here.

Environment details:

/kind bug

pepov commented 3 years ago

There are two separate issues here:

As of the first, I would create a separate issue. As of the second I beleive that is caused by the timekey/timekey_wait config messing with flush_mode immediate. If you set flush_mode immediate I would recommend setting timekey 1s and timekey_wait 0s or something like that explicitly.