rails: install all performance hooks by default #1112
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Previously, we were installing performance hooks based on the value from the
Airbrake config. If
performance_stats
istrue
, then the hooks will beinstalled during initialization, if it's
false
, the hooks would never beinstalled.
Now,
airbrake-ruby
supports remote configuration, which can change the valueof
performance_stats
at runtime. In order to support this feature we mustchange the approach and install the hooks in either case. The
performance_stats
check is now performed inside the hooks, since this willallow us to enable/disable the feature during the runtime.
A pleasant effect of this change is that we no longer need to read the config
inside our railtie. This fixes #1105, which reports an issue with our existing
code where we hook into
after: :load_config_initializers
. With this newapproach we don't need to hook into that event anymore because we don't care at
what stage the
config/initializers/airbrake.rb
is loaded.