Part III — The Speed · Lesson 7.1
Logging & Monitoring Overview
In one lineLogs, metrics, and traces answer three different questions — you need all three to debug production.
Where you've seen itCheckout starts failing at 2am. The graph would have shown it instantly; instead the sales team reports it at 9am.
Diagram
Lessons in this diagram7.2 Telemetry7.3 Alerting7.4 Fixing
FRONTEND-SPECIFIC SIGNALS — what the backend can't see
JS errors + stack traces (needs source maps — 7.4)
unhandled promise rejections the most-missed one
failed fetches by endpoint including CORS and network drops
Core Web Vitals from real users (5.3)
rage clicks / dead clicks UX breakage with no exception
console errors from 3rd parties your CSP violations too (3.4)How it works
- Metrics for detection. Cheap to store, fast to query, and what alerts fire on.
- Logs for explanation. Sampled and structured, they tell you what happened in a specific failing session.
- Traces for location. A propagated request id ties a browser action to the backend spans it caused.
- Correlate with releases. Every signal should carry a build id, or "what changed?" is unanswerable.
- Close the loop. After each incident, add the one signal that would have made triage faster.
Trade-offs
| Signal | Volume | Cost | Use for |
|---|---|---|---|
| Metrics | low | low | Alerting, dashboards, trends |
| Logs | high | high | Root cause on a specific case |
| Traces | medium | medium | Cross-service latency |
| Session replay | very high | very high | Hard-to-reproduce UX bugs |
Interview angle
"How do you know your frontend is healthy in production?"
- Metrics first: JS error rate, failed request rate, and p75 Web Vitals, all sliced by release.
- Alert on user-visible symptoms rather than causes — checkout success rate beats CPU usage.
- Then logs and traces for depth, with a request id that connects a browser session to backend spans.
Recap
- Metrics say is something wrong; logs say what; traces say where.
- Tag everything with a release id — the first triage question is always "what shipped?"
- Every incident should end by adding the signal you wished you'd had.