Discord uptime monitoring bot
Logdash has no Discord bot, so the working setup is a Discord channel webhook fed by a 30-line Cloudflare Worker that turns the Logdash webhook alert into a Discord message.
Straight answer first. Logdash ships two alert channels, Telegram and webhook. There is no Discord integration and no bot to invite. What does exist: a webhook channel that sends a small JSON object every time a monitor changes state, and Discord channels that accept messages through a webhook URL. Put a 30-line relay between the two and you have a Discord website down alert.
Why not paste the Discord URL straight into Logdash? Discord wants a content or embeds field. Logdash sends newStatus, name, url, statusCode and errorMessage, so Discord rejects the request as an empty message. The relay reshapes one into the other.
One plan detail before you start. On the free Hobby plan the webhook channel sends a bare GET with no body and no headers, which tells a relay that something happened but not what. POST with the JSON body and custom headers come with Builder at $9 a month. On Hobby, Telegram is the free channel that carries the whole alert.
The Discord webhook uptime monitor relay
// worker.js - Logdash webhook in, Discord message out.
// npx wrangler deploy worker.js --name logdash-discord \
// --compatibility-date 2026-01-01
// npx wrangler secret put DISCORD_WEBHOOK_URL --name logdash-discord
// npx wrangler secret put RELAY_SECRET --name logdash-discord
export default {
async fetch(request, env) {
const secret = request.headers.get('x-relay-secret');
if (request.method !== 'POST' || secret !== env.RELAY_SECRET) {
return new Response('forbidden', { status: 403 });
}
// { httpMonitorId, newStatus, name, url, statusCode, errorMessage? }
const alert = await request.json();
const down = alert.newStatus === 'down';
const icon = down ? '🔴' : '🟢';
const lines = [
`${icon} **${alert.name}** is ${alert.newStatus}`,
`\`${alert.url}\``,
];
if (down) {
lines.push(
`Status code: ${alert.statusCode}`,
`Error: ${alert.errorMessage ?? 'N/A'}`,
);
}
const sent = await fetch(env.DISCORD_WEBHOOK_URL, {
method: 'POST',
headers: { 'content-type': 'application/json' },
body: JSON.stringify({
username: 'Logdash',
content: lines.join('\n').slice(0, 2000),
allowed_mentions: { parse: [] },
}),
});
return new Response(null, { status: sent.ok ? 204 : 502 });
},
};Three lines in there do the real work. The secret header check matters because a workers.dev URL is public, and without it anyone who finds the URL can post into your channel. allowed_mentions with an empty parse list stops an error page that happens to contain @everyone from pinging the whole server. The 2,000 character slice is the Discord limit for content, and the error body Logdash forwards can be up to 1,000 characters on its own.
One risk is specific to Cloudflare. Workers send from shared IP addresses, and Discord has rate-limited busy Cloudflare ranges before, answering 429 or error 1015. The relay then returns 502, and Logdash does not retry. If npx wrangler tail logdash-discord ever shows that, run the same handler on a host with its own IP.
- Create the Discord webhook Server Settings, Integrations, Webhooks, New Webhook. Pick the channel and click Copy Webhook URL. You need the Manage Webhooks permission on that channel.
- Deploy the relay Run the three wrangler commands at the top of the file and paste the Discord URL and a long random secret when asked. The Cloudflare free plan allows 100,000 requests a day, and an alert channel uses a handful.
- Wire it and break it In Logdash add a webhook channel with method POST, the workers.dev URL and an x-relay-secret header holding the same secret, then attach it to the monitor next to your Telegram channel. Stop the app: the next failed check posts the red message in Discord and the Telegram alert lands on your phone.
What lands in the channel: a red circle, the monitor name in bold, the URL in a code span so Discord does not unfurl a preview of your own broken site, then the status code and the error. Recovery is a green circle, the name and the URL.
Uptime Kuma Discord vs Logdash
Kuma has Discord built in, with a choice of normal, minimalist or fully templated messages. If Discord is the only channel you care about, that is the shorter path.
Discord alerts: Logdash vs Uptime Kuma
| Feature | Logdash | Uptime Kuma |
|---|---|---|
| Discord support | Webhook channel plus a 30-line relay | Built in, paste the webhook URL |
| Plan needed | Builder, $9/month, for POST | Free, plus the server |
| Message format | Whatever your relay writes | Normal, minimalist or a custom template |
| Alert after | The first failed check | A configurable number of retries |
| Where the sender runs | Hosted, outside your stack | Your server, and it goes down with it |
| App logs and metrics | Same service view, eight SDKs | Not what Kuma is for |
When Uptime Kuma is the better pick
- You already run Kuma. Discord is a dropdown there, no code and no extra account.
- You want Discord alerts for $0. Kuma does it on your own box, while the Logdash webhook only carries the alert from Builder up.
- Nobody on the team wants to own code in the alert path, even 30 lines of it.