Repository navigation
Add Sentry error tracking, and the parameter filtering it depends on - #15
Merged
Merged
Conversation
Two changes, and the filtering is the one that matters most. config/initializers/filter_parameter_logging.rb did not exist. The ledger was logging every request parameter verbatim to stdout -- including `signature`, and any `private_key` or `public_key` reaching a controller. That was already a leak into container logs before Sentry entered the picture; sentry-rails reuses the same list, so one file fixes both paths. Addresses, amounts and credit limits are deliberately NOT filtered: they are public ledger identifiers and the things that make an exception diagnosable. Filtering them would leave an unreadable error report. Then Sentry itself. Until today the fleet had no error tracking at all; an exception reached container stdout under a 10MB/3-file rotation and nowhere else. send_default_pii is false -- this service signs and settles credit between real people, and the default would attach request bodies and headers to every event. breadcrumbs_logger is [:sentry_logger] only, since active_support_logger's SQL breadcrumbs would carry balances and addresses into unrelated exceptions. Ships inert: returns early unless SENTRY_DSN is set, and enabled_environments is production-only. Verified by booting with a dummy DSN: Sentry.initialized? true, send_default_pii false, enabled_environments ["production"], breadcrumbs [:sentry_logger], traces 0.0, before_send wired. Scrubbing confirmed -- signature/private_key/seed_phrase FILTERED while from_address and value survive. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Part of adding error tracking to railsbackend, foaf-auth and foaf-protocol-ruby prod. Ships inert — nothing reports until a DSN is set on the production Coolify app.
The filtering is the more important half
config/initializers/filter_parameter_logging.rbdid not exist in this repo. The ledger was logging every request parameter verbatim to stdout — includingsignature, and anyprivate_key/public_keythat reached a controller. That was already leaking into container logs before Sentry was ever discussed; adding Sentry without fixing it would have shipped the same values to a third party.sentry-railsreusesRails.application.config.filter_parameters, so one list covers both paths.Deliberately not filtered: addresses, amounts, credit limits,
idempotency_key. They're public ledger identifiers and the things that make a ledger exception diagnosable — filtering them leaves an unreadable report. Verified:Sentry
send_default_piibreadcrumbs_logger[:sentry_logger]active_support_logger, whose SQL breadcrumbs would carry balances and addresses into unrelated exceptions.traces_sample_rate0.0Safety
Two independent gates:
returnunlessSENTRY_DSNis set, andenabled_environmentsisproductiononly.Verified
Booted in a container with a dummy DSN and read the live config back:
Sentry.initialized? true,send_default_pii false,enabled_environments ["production"],breadcrumbs [:sentry_logger],traces 0.0,before_sendwired.Worth stating: the early
returnmeans CI never executesSentry.init, so a green suite proves nothing about this config. That's why it was checked by booting with a DSN rather than by trusting the tests.Still needed
A DSN (one Sentry project per app under the existing org
o4511003692695552), set asSENTRY_DSNon the production Coolify app.