fluentd icon indicating copy to clipboard operation
fluentd copied to clipboard

Output exception stacktrace as part of @FLUENT_LOG

Open fujimotos opened this issue 1 year ago • 0 comments

Problem

Fluentd has "stacktrace" support, which outputs the detailed execution context whenever an unhandled exception happened. This feature is very useful when investigating errors occured on production system.

Here is an example:

2020-01-01 00:00:00 +0000 [warn]: #0 emit transaction failed: error_class=IOError error="closed stream" location="/fluentd/vendor/bundle/ruby/2.6.0/gems/fluentd-1.11.1/lib/fluent/plugin/buffer/file_chunk.rb:82:in `pos'" tag="cafiscode-eks-cluster.default"
  2020-01-01 00:00:00 +0000 [warn]: #0 /fluentd/vendor/bundle/ruby/2.7.0/gems/fluentd-1.11.1/lib/fluent/plugin/buffer/file_chunk.rb:82:in `pos'
  2020-01-01 00:00:00 +0000 [warn]: #0 /fluentd/vendor/bundle/ruby/2.7.0/gems/fluentd-1.11.1/lib/fluent/plugin/buffer/file_chunk.rb:82:in `rollback'
  2020-01-01 00:00:00 +0000 [warn]: #0 /fluentd/vendor/bundle/ruby/2.7.0/gems/fluentd-1.11.1/lib/fluent/plugin/buffer.rb:339:in `rescue in block in write'

The problem is that these stacktraces won't never be emitted to @FLUENT_LOG.

Desired Behavior

  • Fluentd should emit the stacktrace to @FLUENT_LOG as well.

fujimotos avatar Oct 17 '22 01:10 fujimotos