Skip to content

Add Sentry error tracking, and the parameter filtering it depends on - #15

Merged
rheos merged 1 commit into
mainfrom
feat/sentry-error-tracking
Sep 28, 2026
Merged

rheos merged 1 commit into
mainfrom
feat/sentry-error-tracking

Conversation

@rheos

@rheos rheos commented Sep 27, 2026

Copy link
Copy Markdown
Collaborator

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.rb did not exist in this repo. The ledger was logging every request parameter verbatim to stdout — including signature, and any private_key / public_key that 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-rails reuses Rails.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:

signature      -> [FILTERED]
private_key    -> [FILTERED]
seed_phrase    -> [FILTERED]
from_address   -> 0xPUBLICADDR     (kept)
value          -> 100              (kept)

Sentry

Setting Value Why
send_default_pii false This service signs and settles credit between real people; the default attaches request bodies and headers to every event.
breadcrumbs_logger [:sentry_logger] The default includes active_support_logger, whose SQL breadcrumbs would carry balances and addresses into unrelated exceptions.
traces_sample_rate 0.0 Errors only.

Safety

Two independent gates: return unless SENTRY_DSN is set, and enabled_environments is production only.

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_send wired.

Worth stating: the early return means CI never executes Sentry.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 as SENTRY_DSN on the production Coolify app.

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>
@coderabbitai

coderabbitai Bot commented Sep 27, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: dd4e757d-3af9-445b-b8f1-05b3590615bc


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@rheos
rheos merged commit 08b14f4 into main Sep 28, 2026
2 checks passed
@rheos
rheos deleted the feat/sentry-error-tracking branch September 28, 2026 00:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant