Skip to content

Instantly share code, notes, and snippets.

@stympy
Created June 3, 2025 20:48
Show Gist options
  • Save stympy/ed9481344440239b0ba1e5176aa7218a to your computer and use it in GitHub Desktop.
Save stympy/ed9481344440239b0ba1e5176aa7218a to your computer and use it in GitHub Desktop.
Add tags to Honeybadger errors
# 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