What Happens When You Type a URL and Press Enter
DNS lookups, TCP and TLS handshakes, HTTP requests, servers, and the browser's rendering pipeline. The whole journey of a web page, explained so it finally clicks.
Read →If users report your outages before your tools do, it's time to fix that. Structured logs, error tracking, uptime checks, a few key metrics and alerts that are actually worth waking up for.
Most small apps have no monitoring at all until the day a user emails "is the site down?" That's a rough way to find out. The good news: you don't need an observability team or an expensive platform. A few well-chosen practices give you most of the value, and many of the tools have free tiers.
Add alerts on top of those so that problems reach you instead of waiting to be discovered.
Plain text logs are easy to write and painful to search. Structured logs (JSON) are easy to filter, aggregate and query:
// Hard to search
console.log('User 42 failed to pay order 991: card declined')
// Easy to search and filter
logger.warn({ event: 'payment_failed', userId: 42, orderId: 991, reason: 'card_declined' })
Libraries like pino (Node.js), structlog (Python) and Monolog (PHP) make this simple.
Generate an ID for each request, include it in every log line from that request, and return it in a response header. When a user reports a problem, one ID finds every related log line across services.
No passwords, tokens, API keys, full card numbers or unnecessary personal data. Logs get copied, shipped to third parties and kept for a long time. Redact at the logger level so nobody has to remember. (Security checklist.)
Logs fill disks, and full disks crash apps. Use log rotation on servers, and decide how long to keep logs (often 7 to 30 days for app logs).
An error tracker like Sentry (with a free developer plan) or similar tools captures exceptions with stack traces, the request, the user, the browser and recent events leading up to the error. It groups duplicates and tells you when a new kind of error appears after a deploy.
This is the single highest-value monitoring tool for most apps. Upload source maps so frontend stack traces point to your real code. (Reading stack traces.)
An external service requests your site every minute or few minutes, from outside your infrastructure, and alerts you when it fails. Check:
app.get('/health', async (req, res) => {
try {
await db.query('SELECT 1')
res.json({ status: 'ok' })
} catch {
res.status(503).json({ status: 'degraded' })
}
})
You don't need hundreds of dashboards. For a web app, start with the RED metrics per endpoint:
Plus a few resource metrics for servers: CPU, memory, disk space and database connections.
Averages hide pain. If your average response is 200ms but 5% of requests take 8 seconds, a lot of users are having a bad time. (Diagnosing slowness.)
Bad alerting is worse than none. If alerts fire constantly, people learn to ignore them, including the one that matters.
| Need | Simple option |
|---|---|
| Structured logs | A JSON logger, shipped to your host's log viewer or a log service |
| Errors | Sentry or a similar error tracker |
| Uptime | An external uptime monitor checking /health |
| Metrics | Your host's built-in metrics, or a free APM tier |
| Alerts | Uptime + error tracker alerts to email and phone |
That takes an afternoon to set up and covers the vast majority of incidents.
Errors with context, important business events like signups and payments, and request summaries with IDs and timings. Avoid secrets, passwords, tokens and unnecessary personal data.
Logs record detailed events for investigation. Monitoring watches metrics and health checks over time and alerts you when something goes wrong.
Rate (requests per second), Errors (failed requests) and Duration (response times). They're a simple, effective way to monitor any request-driven service.
DNS lookups, TCP and TLS handshakes, HTTP requests, servers, and the browser's rendering pipeline. The whole journey of a web page, explained so it finally clicks.
Read →There are dozens of HTTP status codes, but about fifteen cover nearly everything. What each one means, when to return it, and the mix-ups (401 vs 403, 301 vs 302) that confuse everyone.
Read →A, AAAA, CNAME, MX, TXT and NS records in plain English, why DNS changes seem slow, and the troubleshooting commands that tell you what is really going on.
Read →