a year ago
Hi,
Is there an existing method to monitor errors from logs and send a webhook alert when more errors occur than the configured time window threshold allows?
0 Threads mention this feature
1 Reply
9 hours ago
In the meantime, if it helps: I built a template that does this. It reads the deploy and HTTP logs of every service in your project and alerts a webhook, Slack or Discord when a threshold is crossed within a time window, then again when it resolves. It comes with four rules: more than 25 error lines in 5 minutes, more than 5% of requests failing with 5xx, slow requests, and crash lines (panics, OOM, tracebacks). You can change the thresholds and time window with variables (for example SIGNALBOX_ERROR_LINES and SIGNALBOX_WINDOW), no fork needed. You add it to the project you want to watch, so your logs and token stay inside it: https://railway.com/deploy/signalbox
There's also Monirail by Jared from Railway (https://railway.com/deploy/monirail-log-monitoring), which does this as code you write in a Railway function. It's worth a look if you'd rather define the monitors yourself.
Disclosure: signalbox is my project (open source, github.com/shanurwan/signalbox). The Railway team has mentioned native custom alerts are in the works, and when they ship I'd use those and will point the template there. Until then, happy to help if you try it.