Skip to main content

Production Observability and Failure Triage

Production engineering asks what fails for real users, how often, which release introduced it, which routes are affected, whether users can recover, and how quickly the team can diagnose or roll back the change.

Start with a failure taxonomy​

Classify failures before sending them to one error stream
React render
caught · uncaught · recoverable
Hydration
mismatch · recovery · stale HTML/JS
Network/server
request · Server Function · timeout
Business
validation · expected domain rejection
Performance
interaction · hydration · long task · regression
Third party
SDK · widget · provider failure

Different categories have different owners, severity, dashboards, and recovery actions.

Structured telemetry beats message-only logs​

reportError({
name: error.name,
message: error.message,
stack: error.stack,
componentStack: errorInfo?.componentStack,
route: location.pathname,
release: RELEASE_SHA,
buildId: BUILD_ID,
userFlow: 'checkout',
severity: 'error',
});

Do not include secrets or unnecessary personal data.

A useful error event connects code, product, and deployment context
Failure
name · message · stack
React context
component stack · error class
Product context
route · user flow · feature flag IDs
Release
commit · build · deployment
Correlation
trace/request ID
Privacy
allow-listed safe fields only

Release correlation makes incidents actionable​

Correlate a regression with the artifact that introduced it
Baseline
error rate 0.2%
Regression
error rate 3.8%
Affected surface
90% from checkout

Useful identifiers include commit SHA, CI build ID, semantic version, deployment ID, and source-map release ID.

Source maps are production infrastructure​

Your observability system should map minified stacks back to original source while respecting your threat model.

1Build artifact
2Generate source maps
3Upload/protect maps
4Deploy matching release ID
5Symbolicate errors

Dynamic chunks and source maps must refer to the same release as the deployed JavaScript.

JavaScript stacks and Component Stacks complement each other​

JavaScript stack
where code threw
Component Stack
where the failing component sits in the rendered React tree

The same shared Hook can throw from multiple product surfaces; component context helps distinguish them.

Root callbacks feed central observability​

createRoot(container, {
onCaughtError,
onUncaughtError,
onRecoverableError,
});
Root callbacks classify React-managed client failures
Caught
contained by an Error Boundary
Uncaught
escaped React containment
Recoverable
React recovered, but correctness may still need investigation

Repeated recoverable hydration errors are not automatically harmless.

Hydration needs dedicated monitoring​

Hydration mismatches are consistency failures
Server HTML
initial document snapshot
First client render
must agree structurally
Recovery + telemetry
React may rebuild while users pay the cost

Break hydration metrics down by route, browser, locale, release, feature flag, server region, and rendering mode.

Common causes include non-deterministic first render, timezone/locale differences, browser-only conditionals, inconsistent server/client data, invalid HTML nesting, DOM injection by extensions, and version skew between cached HTML and JavaScript.

Performance telemetry needs user context​

Correlate React work with browser and product impact
Product
task completion · retry · abandonment
Interaction
input latency · navigation duration
React
commit/render/Effect profiling
Browser
long tasks · layout · paint
Network
request/chunk latency
Server
RSC/API/DB spans

React DevTools explains a reproduction. Real-user monitoring explains what users experience across devices, networks, browsers, and routes. You usually need both.

Instrument product flows, not component noise​

Weak telemetry mirrors implementation:

Button rendered
Card rendered
Label rendered

Stronger telemetry describes outcomes:

checkout_started
payment_submitted
payment_failed
payment_succeeded
checkout_completed

Component-level profiling is useful for diagnosis; product-level events are useful for outcomes.

Privacy is part of observability design​

Should this field enter telemetry?
Secret/token/payment/private message/raw form draftNo — keep it out
Stable release/route/trace/error classificationUsually yes
User-derived data not needed for diagnosisDo not collect it
Needed for debugging but sensitiveRedact/hash/aggregate according to policy

Prefer allow-lists over dumping props, state, storage, or request bodies.

Correlation IDs connect frontend and backend​

One trace ID can connect the whole failure path
Client interaction
trace=abc123
Server Function/API
trace=abc123
Database/provider
trace=abc123

Now a frontend fallback can be correlated with the server/database failure that caused it.

Third-party failures need isolation​

Optional analytics, maps, editors, payment widgets, and chat clients can fail independently.

How critical is this dependency?
Optional enhancementLazy-load and fail without blocking core UI
Critical transaction dependencyExplicit timeout/error/retry/fallback + observability
Can crash one visual region onlyContain at a meaningful Error Boundary

Incident triage loop​

1Detect
2Classify
3Correlate release/trace
4Reproduce
5Mitigate/rollback
6Fix + regression test

The goal of observability is not more logs. It is faster, safer decisions about real user failures.