Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom store data from ActiveSupport::Notifications not saving in release 0.7.1 #92

Open
davidbasalla opened this issue Nov 19, 2015 · 0 comments

Comments

@davidbasalla
Copy link

Hello, upgrading from 0.7.0 to 0.7.1 breaks the ActiveSupport::Notifications watch behaviour for me.

From the docs:

# Watch calls the block with the same arguments than any ActiveSupport::Notification, plus a store
LogStasher.watch('some.activesupport.notification') do |name, start, finish, id, payload, store|
  # Do something
  store[:count] = 42
end

After the 0.7.1 upgrade, the custom store key/value pair does not get output in the final output log. This is working fine in 0.7.0.

Comparison:
https://github.com/shadabahmed/logstasher/compare/6506a39f6bb71662f954af3f59d36da2f21cc7ec...8206937595a5a61d1e3ab697a60e777abfdd9e7e?diff=split&name=8206937595a5a61d1e3ab697a60e777abfdd9e7e

davidbasalla added a commit to alphagov/frontend that referenced this issue Nov 23, 2015
We log the postcode_errors with `logstasher` to JSON-style logs so that the errors can be viewed in Kibana. `logstasher` supports subscribing to ActiveSupport::Notifications, which we use to log the postcode errors.
https://github.com/shadabahmed/logstasher#listening-to-activesupportnotifications-events

We upgrade `logstasher` to release `0.6.2`. Initially we attempted to upgrade to the latest release `0.8.6`, but custom fields were not being output in the logs, notification subscription did not work, log messages for rendering view templates were being included and the JSON structure of the output was different (`fields` being deprecated since `0.6.5`). This appears not to be a straight-forward API change but rather changes in the internal architecture. In the interest of time I have settled on `0.6.2` as that includes the `watch` method and does not alter the previous logging output. I have logged an issue against the `logstasher` repo -> shadabahmed/logstasher#92 to ask about the breaking change to notification subscriptions.

The commit adds the following to the JSON output:

`"postcode_error_notification":{
  "postcode_error":"invalidPostcodeFormat"
},`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant