logstasher
logstasher copied to clipboard
Missing ActionContoller event fields due to `#process_action` monkey patch
Hey!
I'm trying to get information about the request's headers after ActiveSupport::Notifications.subscribe 'process_action.action_controller', but the :headers key is missing from the event's payload. As far as I can see, this gem monkey patches ActionController::Instrumentation#process_action hence a few Rails generated fields will be missing: headers and request.
Could these extra fields be still visible for subscribers of the ActionController?
@avlazarov good point - would you be able to create a PR ?
cc @petergoldstein
@shadabahmed Sure, but before that I have a few questions about the current guards, namely:
https://github.com/shadabahmed/logstasher/blob/9de62bcca656ca76d1942c86478559909364efe3/lib/logstasher/rails_ext/action_controller/metal/instrumentation.rb#L11 https://github.com/shadabahmed/logstasher/blob/9de62bcca656ca76d1942c86478559909364efe3/lib/logstasher/rails_ext/action_controller/metal/instrumentation.rb#L13-L17
I've gone through all versions that this gem supports (Rails 5.2+) and none seem to be defensive about format and path:
Am I missing something or can I just use the instrumentation logic from Rails 7.0, without any guards?