Created
August 28, 2024 20:42
-
-
Save stympy/61dc161f4ff2d4fb3fd7482e61fc81f6 to your computer and use it in GitHub Desktop.
Populate additional info for every event sent to Honeybadger Insights
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# config/initializers/honeybadger.rb | |
Honeybadger.configure do |config| | |
config.before_event do |event| | |
if (environment = ENV["HONEYBADGER_ENV"].presence || ENV["RAILS_ENV"].presence) | |
event[:environment] = environment | |
end | |
event[:user] = { name: Current.user.name, email: Current.user.email } if Current.user | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment