logo
Parslinks
Back to blog
Guides6 min read

Monitoring and logs for a small team: four numbers that are enough to start

A dashboard with fifty charts nobody looks at is less useful than four numbers with the right alerts.

Alireza Tadi

Co-founder, Parslinks · Team, marketing & infrastructure

A bus-ticket booking app, the night before Nowruz, 11pm: users are posting on Instagram that ticket purchases won't go through. The tech team finds out at 8am, from those posts. The server was up all night and the home page loaded, so the simple uptime check that only verified the site was "up" reported nothing. But the database connections were exhausted, and every purchase request errored after 30 seconds.

"The site is up" and "the site works" are two different sentences. Good monitoring measures the distance between them.

The four basic signals

Large operations teams call these the "golden signals". For a small team, the same four are the right place to start:

The four basic monitoring signals: latency, traffic, error rate and saturation

Latency: the 95th percentile, not the average

Averages lie. If 90% of requests finish in 100 ms and 10% take 8 seconds, the average is about 900 ms, a number that looks acceptable while one in ten users is closing the page. The 95th percentile (p95) means "95% of requests are faster than this", and it exposes the slow tail.

Traffic: drops are news too

Everyone notices a spike. Few notice a sudden drop. If requests halve at 8pm, usually the peak, something in DNS, the payment gateway or a mobile carrier is probably keeping users from reaching you at all.

Error rate: as a percentage, not a count

A hundred errors an hour is normal for a site with a million requests; for one with a thousand, it's a disaster. Track the share of 5xx responses. For critical paths like checkout and login, set separate, stricter thresholds.

Saturation: before things break

CPU, memory, database connections and disk space. This signal predicts: memory that went from 60% to 85% in a week will take the app down next week.

SignalWhat to measureSuggested starting alert
LatencyOverall p95 and checkout p95Above 1 s for 5 minutes
TrafficRequests per minute vs. the same hour last weekA drop of more than 50% for 10 minutes
Error rateShare of 5xx responsesAbove 2% for 3 minutes; any checkout error
SaturationMemory, CPU, DB connections, diskMemory or disk above 85%

Monitor from outside, and from inside Iran

The signals above come from inside the app. You need one more layer: an external service that, like a real user, opens the home page and a health route every minute. For a business whose users are in Iran, at least one check location should be inside the country. A site that looks healthy from Frankfurt may, at that same moment, fail for users on a domestic carrier.

Logs that help on incident day

console.log("error", err) is harmless on a normal day and useless on incident day. Three small changes make the difference:

Write structured logs. Each line is a JSON object with consistent fields, not a free-form sentence. Searching and filtering becomes simple.

Add a request ID. A unique ID per request, repeated in every log line for that request. When a user says "checkout failed for me at 9:12", that ID finds their whole path.

Never log sensitive data. Card numbers, passwords, one-time codes and tokens never belong in logs. Partially mask phone numbers too.

lib/log.ts
import pino from "pino";

export const log = pino({
  level: process.env.LOG_LEVEL ?? "info",
  redact: ["req.headers.authorization", "*.password", "*.otp", "*.cardNumber"],
});

// Each line is one object with a request ID
log.error(
  { requestId, route: "/api/checkout", orderId, gateway: "shaparak", durationMs: 30012 },
  "payment callback timed out",
);
ts12 lines

Where to start

If you have no monitoring today, this order fits into one afternoon:

  1. An /api/health route that checks the database connection.
  2. An external monitor for the home page and that route, with one check location inside Iran.
  3. Error-rate and latency alerts sent to a team channel, not one person's inbox.
  4. Structured logs with a request ID.

On Parslinks, runtime logs and the build log for every deployment are available in the project dashboard; put external monitoring and alerts alongside them.

Add the rest (distributed tracing, business dashboards, profiling) once these four have run smoothly for a month.

Frequently asked questions

Join the discussion

No comments yet. Be the first to share your thoughts.