Quiz - Error monitoring and structured logs
Your authedAction wrapper catches a thrown DB error, logs it, and returns a Result.err so the user sees a generic toast. Which path gets this error into Sentry?
onRequestError in instrumentation.ts — Next.js fires it for every server-side throw.Sentry.captureException call inside the wrapper’s catch.Result.err is the client SDK’s job.onRequestError only fires for throws that bubble all the way to Next.js’s framework boundary. A caught error never reaches that boundary, so the wrapper’s catch is the only place to capture it. That’s the two-path rule: every uncaught throw rides onRequestError; every catch-and-handle seam calls captureException itself.You generate the requestId and open an AsyncLocalStorage scope in proxy.ts. Why does the lesson insist you also open a scope inside the authedAction wrapper, instead of relying on the proxy’s?
proxy.ts into server actions, so a deep log line in an action would lose the requestId otherwise.requestId higher-cardinality, which the log destination indexes more efficiently.node:async_hooks.requestId as an x-request-id header, and authedAction reads it back to open its own (now enriched with userId/orgId) scope with the same ID.You’re filling in the redact denylist. Which of these should you let through to the log destination, not redact? Select all that apply.
emailuserIdAuthorization headeremail and userId are operator-side identifiers — load-bearing for support, fraud investigation, and incident correlation — so they’re safe and should be logged. Redacting them is the over-correction trap that blinds the operator for no compliance gain. The full name is user-side PII, and the Authorization header carries a secret; both must be redacted.Your Axiom drain shows “data is flowing,” yet level == "error" AND orgId == "org_123" returns nothing. What’s the most likely cause?
pino JSON as one opaque message string, so level and orgId never became queryable columns.requestId is high-cardinality, which forces the destination to drop the other fields on its TTL.level/requestId) and stuffs your application JSON inside a message string. Until the destination parses that inner JSON, your fields aren’t real columns. Axiom auto-parses, but the senior move is to verify it rather than trust the wizard’s “success.”Sentry shows the throwing line and the logs show the full per-request narrative, but neither explains why a valid-looking input failed a validation predicate. Is this the moment to attach the debugger?
--inspect so you debug the real production state.Quiz complete
Score by topic