Monitoring
Redaction
A monitoring SDK reports whatever you hand it, and sooner or later something you hand it contains a password. Every Octri monitoring runtime scrubs payloads on the way out, so a credential that ended up in a log line or a context object never reaches the dashboard.
This is on by default. There is nothing to enable.
Where it runs
Scrubbing happens at the one point where an event is serialised, so it covers everything the SDK sends: captured events, captured errors and their stacks, and span reports. There is no path around it.
If you install a beforeSend hook, it sees the payload first and the scrubber runs on whatever it returns. A hook can drop an event or add to it, but it cannot hand the dashboard a credential by accident.
Keys that name a credential
Any key whose name looks like a credential has its value replaced with [redacted], at any depth, in objects, maps, arrays and lists alike.
The list is password, passwd, passphrase, secret, token, apiKey, authorization, credential, cookie, session, privateKey, accessKey, cardNumber, creditCard, cvv and ssn.
Matching lowercases the key and strips everything that isn't a letter or a digit, then looks for one of those as a substring. So api_key, apiKey, API-KEY and X-Api-Key are all the same key to it.
auth, card and pin are not on the list, because substring matching on them would eat author, wildcard, discarded and spinner. If your schema uses one of those as a real credential field, add it yourself with addScrubFields.
Free text is swept too
Key matching only helps when the secret sits under a key. A token pasted into a message, or an exception whose text quotes the request it failed on, has no key at all. Every string in the payload is swept for four shapes:
| Shape | Example | Becomes |
|---|---|---|
| Bearer token | Authorization: Bearer sk_live_9f2c… | [redacted] |
| JWT | eyJhbGciOi….eyJzdWIi….4pZ1s… | [redacted] |
| Card number | 4111 1111 1111 1111 | [redacted] |
| Email address | ada@example.com | [redacted] |
Card numbers have to pass the Luhn check before they are touched. That is the difference between a card and the many 16-digit strings that are not one, so an order number like 1234567890123456 and an epoch timestamp in a long id both survive.
user is the exception
user is the field you fill with an identity on purpose. Scrubbing the email out of it would defeat the feature, so free-text sweeping is switched off inside it and user.email is reported exactly as you set it.
Key matching is not switched off. A user.token is still [redacted].
Adding your own fields
addScrubFields("accountNumber", "otp");Names you add are matched the same way as the built-in ones, so accountNumber also catches account_number and ACCOUNT-NUMBER.
Editing or dropping a payload
beforeSend hands you each payload before it goes out. Return it to send it, or return the null value of your language to drop the event.
setBeforeSend((payload) => (payload.path === "/health" ? null : payload));The hook runs on the reporting path, so keep it cheap and don't let it throw.