PylonMon

Alert on log errors without shipping every line

There are two completely different things people mean by “log monitoring”, and picking the wrong one is why log bills get frightening. One is counting: how many tracebacks in the last five minutes, as a number you can put a threshold on. The other is searching: keep the stream so you can read around the moment it broke. The agent does both, separately, and most machines only need the first.

The question decides the tool

You want to knowUseWhat travels
“Are errors spiking right now?”[logwatch]A number, plus one sample of the matching block.
“What exactly happened at 02:41?”[logs]The lines themselves.

A few tracebacks an hour is life on the internet. Forty in five minutes is an incident. That difference is a count, and a count is cheap: it is computed on your machine and leaves as a single metric. You do not need to ship a gigabyte of logs to learn that a number went up.

Counting: one line, one metric

Each entry names a file, a pattern, and the window to count over. The window is optional and defaults to five minutes:

/etc/pylon-beacon/beacon.conf
[logwatch]
tracebacks_5m = /var/log/app/app.log | Traceback \(most recent call last\) | 300
auth_fail_5m = /var/log/auth.log | Failed password
oom_1h = /var/log/syslog | Out of memory | 3600

Each becomes an ordinary metric. That means it gets the same alerting as CPU — a comparison, a value, and a duration it must stay breached:

pylonmon.com/portal
tracebacks_5m   greater than   20   for   60 seconds

The sustained gate is what separates a deploy blip from a real spike.

The part that makes the page useful

A number tells you something is wrong and nothing about what. So the most recent matching block rides along with the push as a text sample — capped at forty lines — and appears in the alert. You get the actual traceback in the page, not a count that sends you hunting for it.

This is the whole reason to prefer counting for alerting: you get the number and the evidence, without a log pipeline existing.

Searching: keep the stream

Sometimes you genuinely need the lines. Entries name a file or glob, optionally a service name, and optionally a filter:

beacon.conf
[logs]
app = /var/log/app/app.log | app
nginx = /var/log/nginx/error.log | nginx
auth = /var/log/auth.log | | Failed password|Accepted publickey
pods = /var/log/containers/*.log

Three details worth knowing:

Behaviour that will save you a bad first day

Both features share the same reading discipline, and the first one matters more than it sounds:

The honest limits

How to choose

Start with counting on every machine, because it is nearly free and it is what actually pages you. Add shipping to the two or three services where you know you will want to read around an incident — and put a filter on any file noisy enough that you hesitated before adding it.

Most fleets end up with a lot of [logwatch] and a little [logs]. That ratio is the point.

Agent documentation · Error spikes, end to end · Custom metrics