A pricing rollout needs enough error context to justify rollback, but collecting every customer attribute makes the evidence expensive to retain and harder to interpret. Keep the decision context small: the rule revision, the evaluated flag state, the deployment, and a request correlation value. TL;DR: in Node.js, catch the pricing exception, extract its relevant details, attach custom metadata, and submit an authenticated POST to the error capture API. Keep the rollback decision independent of whether that submission succeeds.
The concrete system here is a B2B SaaS application introducing a new pricing rule behind a flag. Recovery has two separate obligations: stop exposing customers to the suspect rule, and determine which requests used it. An error event can support both investigations. It cannot reverse a completed charge.
1. What custom metadata makes tracking errors useful during rollback?
Start with the decision.…