DEV Community

Schiff Heimlich
Schiff Heimlich

Posted on

Monitoring Small Web Services Without the Heavy Tooling

You know that feeling when you spin up a tiny service — maybe a personal API, a small webhook handler, or that utility app that just does one thing — and then you stare at your monitoring stack wondering if you really need Prometheus, Grafana, AlertManager, and a whole dashboard just to watch it?

Yeah, me too. Here's what I've been doing instead.

The Honest Health Check

Most small services don't need fancy metrics. They just need to answer one question: "Are you alive?"

A simple /health endpoint that returns 200 when the service is responsive is usually enough. Then you ping it from somewhere else. Cron job with curl:

*/5 * * * * curl -sf http://localhost:8080/health || echo "Service down" | mail -s "Alert" you@example.com
Enter fullscreen mode Exit fullscreen mode

That's it. Five minutes of setup, zero dependencies.

Log Tail With Context

When you do want to see what's happening, journalctl or docker logs with a simple tail works fine:

journalctl -u my-tiny-service -f --since "5 minutes ago"
Enter fullscreen mode Exit fullscreen mode

Or if you're containerized:

docker logs --tail 100 -f my-container
Enter fullscreen mode Exit fullscreen mode

The key is adding --since or --tail so you're not drowning in logs from three weeks ago.

Disk Space and Process Watch

Sometimes the issue isn't the service itself — it's that the disk filled up or the process silently died. A quick check every hour:

# Disk usage
if [ $(df /var/lib/my-service | tail -1 | awk '{print $5}' | sed 's/%//') -gt 85 ]; then
  echo "Disk getting full" | mail -s "Disk Alert" you@example.com
fi

# Process alive?
if ! pgrep -f my-tiny-service > /dev/null; then
  systemctl start my-tiny-service
  echo "Service restarted" | mail -s "Restarted" you@example.com
fi
Enter fullscreen mode Exit fullscreen mode

Ugly? Sure. But it works, and you understand every line.

When You Actually Need More

Here's the thing: you'll know when simple isn't enough. When you start getting paged at 3am for the third time this week because your "tiny" service is now handling 10x the traffic, that's when you pull out the big guns.

Until then, keep it humble. A bash script, a cron job, and email alerts will carry you surprisingly far. The best monitoring is the kind you actually maintain.


What's your go-to lightweight monitoring setup for small services? I'm always looking for simpler approaches.

Top comments (0)