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?