GoogleCloudPlatform/fluent-plugin-detect-exceptions

Ruby log regex isn't complete

Opened this issue · 1 comments

The current implementation requires all error backtrace starts with Error but in reality, even a most common 404 logs doesn't have Error as prefix:

ActionController::RoutingError (No route matches [GET] "/foo"):
actionpack (5.1.7) lib/action_dispatch/middleware/debug_exceptions.rb:63:in `call'
actionpack (5.1.7) lib/action_dispatch/middleware/show_exceptions.rb:31:in `call'
railties (5.1.7) lib/rails/rack/logger.rb:24:in `block in call'
activesupport (5.1.7) lib/active_support/tagged_logging.rb:69:in `block in tagged'
activesupport (5.1.7) lib/active_support/tagged_logging.rb:26:in `tagged'
activesupport (5.1.7) lib/active_support/tagged_logging.rb:69:in `tagged'

I saw there're some more complete rulesets like Dart language that tries to list all common error classes. Should we open pull request to add more class names like that?

Related: #59 #38

Yes, making support for Ruby more robust is definitely a good idea. We'd be happy to review a PR. Before you invest the effort, however, please double-check that Stackdriver Error Reporting (the product this plugin was designed to work with) would accept the resulting multiline log entries. See #43 (comment) for instructions. Thanks.