Created
June 3, 2025 20:48
-
-
Save stympy/ed9481344440239b0ba1e5176aa7218a to your computer and use it in GitHub Desktop.
Add tags to Honeybadger errors
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 | |
# See https://docs.honeybadger.io/lib/ruby/gem-reference/configuration/#changing-notice-data for more info | |
Honeybadger.configure do |config| | |
config.before_notify do |notice| | |
additional_tags = | |
case notice.backtrace.lines.first&.file | |
when /stripe\.rb/ | |
["payment"] | |
else | |
[] | |
end | |
notice.tags = Array(notice.tags) |= additional_tags | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment