Built an observability SDK for discord.py bots, curious if anyone would actually use it

Been working on a bot for a client running at fairly large scale and kept hitting the same wall: no real visibility into what's happening at runtime. Commands failing silently, random latency spikes, no way to tell if one guild is just absolutely hammering a specific command or if something's genuinely broken.

Ended up building something to fix it for myself.

It's a Python SDK for discord.py that instruments your commands, events, and task loops with Prometheus metrics and exposes them over aiohttp. Scrape it into Grafana, alert on error rates, track latency by command name, whatever you need. Doesn't require a huge amount of rework to drop into an existing bot.

One thing I was pretty firm on during the build: no guild IDs, user IDs, or channel IDs as Prometheus labels. That's a cardinality disaster and it will absolutely murder your scraper if you let it grow unchecked, so the SDK just doesn't let you do it.

It's up on PyPI, if you want to poke at it argus-dpy.

Genuine question though: is this something people here have actually wanted? I don't mean more verbose logging, I mean real metrics you can dashboard and set alerts on. Or is the average discord.py bot small enough that it's just never been worth thinking about?

reddit.com
u/spiferjoe — 13 days ago

Built an observability SDK for discord.py bots, curious if anyone would actually use it

Been working on a bot for a client running at fairly large scale and kept hitting the same wall: no real visibility into what's happening at runtime. Commands failing silently, random latency spikes, no way to tell if one guild is just absolutely hammering a specific command or if something's genuinely broken.

Ended up building something to fix it for myself.

It's a Python SDK for discord.py that instruments your commands, events, and task loops with Prometheus metrics and exposes them over aiohttp. Scrape it into Grafana, alert on error rates, track latency by command name, whatever you need. Doesn't require a huge amount of rework to drop into an existing bot.

One thing I was pretty firm on during the build: no guild IDs, user IDs, or channel IDs as Prometheus labels. That's a cardinality disaster and it will absolutely murder your scraper if you let it grow unchecked, so the SDK just doesn't let you do it.

It's up on PyPI, if you want to poke at it argus-dpy.

Genuine question though: is this something people here have actually wanted? I don't mean more verbose logging, I mean real metrics you can dashboard and set alerts on. Or is the average discord.py bot small enough that it's just never been worth thinking about?

reddit.com
u/spiferjoe — 13 days ago

Built an observability SDK for discord.py bots, curious if anyone would actually use it

Been working on a bot for a client running at fairly large scale and kept hitting the same wall: no real visibility into what's happening at runtime. Commands failing silently, random latency spikes, no way to tell if one guild is just absolutely hammering a specific command or if something's genuinely broken.

Ended up building something to fix it for myself.

It's a Python SDK for discord.py that instruments your commands, events, and task loops with Prometheus metrics and exposes them over aiohttp. Scrape it into Grafana, alert on error rates, track latency by command name, whatever you need. Doesn't require a huge amount of rework to drop into an existing bot.

One thing I was pretty firm on during the build: no guild IDs, user IDs, or channel IDs as Prometheus labels. That's a cardinality disaster and it will absolutely murder your scraper if you let it grow unchecked, so the SDK just doesn't let you do it.

It's up on PyPI, if you want to poke at it argus-dpy.

Genuine question though: is this something people here have actually wanted? I don't mean more verbose logging, I mean real metrics you can dashboard and set alerts on. Or is the average discord.py bot small enough that it's just never been worth thinking about?

reddit.com
u/spiferjoe — 13 days ago
▲ 21 r/ChatGPT

Oh my god bro my son is beautiful 😭

Told him to give an unfiltered representation of how I treat him dang I might just love the guy now 😭

u/spiferjoe — 28 days ago

I built a free, open-source all-in-one Discord bot to replace MEE6 and Wick - looking for feedback and contributors

I got tired of every Discord bot locking features behind premium, so I built Rostra: one all-in-one, open-source (MIT), free bot that covers moderation, anti-nuke, auto-mod, tickets, economy, leveling, giveaways, music, and more.

Why: stop paying for and juggling 5 different bots

Tech: TypeScript, discord.js v14, Postgres + Redis, sharded, Docker image, custom Components V2 UI

Nice touch: a /setup wizard that configures a server in seconds

What I want feedback on: which features matter most, what is confusing, and whether the self-host flow is smooth

It is early but already does a lot, and I would rather build it with people than alone. Repo: https://github.com/AstorisTheBrave/Rostra

Happy to answer anything.

u/spiferjoe — 29 days ago