Skip to content

Instantly share code, notes, and snippets.

@stympy
Last active February 6, 2026 21:43
Show Gist options
  • Select an option

  • Save stympy/6440d636cfae0f163f210c322bb4728c to your computer and use it in GitHub Desktop.

Select an option

Save stympy/6440d636cfae0f163f210c322bb4728c to your computer and use it in GitHub Desktop.
Less-sensitive fingerprint
PROJECT_ROOT = Regexp.new(/\A\[PROJECT_ROOT\]/)
Honeybadger.configure do |config|
config.before_notify do |notice|
location = begin
Hash(notice.parsed_backtrace.find { |l| PROJECT_ROOT.match(l[:file].to_s) } || notice.parsed_backtrace.first)
rescue
{}
end
notice.fingerprint = [
notice.error_class,
notice.component,
"#{location["file"]}:#{location["method"]}"
].join(':')
end
end
@stympy
Copy link
Author

stympy commented Feb 6, 2026

Thanks for the update!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment