Monitoring
Expose Prometheus metrics
Optional statistics about your bot for monitoring tools such as Prometheus and Grafana.
This page is for people who already run a monitoring tool. You can skip it otherwise. Metrics are off by default.
Turn metrics on
Add this to the bot config.json:
{
"metrics": { "enabled": true, "host": "127.0.0.1", "port": 9464, "token": "a-long-random-string" }
}
The statistics are then available at /metrics on that address and port. Any other address answers with "not found".
- Keep
hostat127.0.0.1so only your own PC can read the numbers.0.0.0.0opens them to the whole network. tokenis an optional password with at least 16 characters. When it is set, requests must send it asAuthorization: Bearer <token>.
Prometheus setup:
scrape_configs:
- job_name: discordmute
metrics_path: /metrics
authorization:
type: Bearer
credentials: a-long-random-string
static_configs:
- targets: ["127.0.0.1:9464"]
Available metrics
| Metric | Meaning |
|---|---|
discordmute_plugin_events_total{type} | Events from plugins by type: lobby, game-start, meeting-start, meeting-end, player-died, game-end, link-chat. |
discordmute_games_muted_total | Games for which muting was started. |
discordmute_plugins_connected | Plugins connected right now. |
discordmute_active_games | Games in progress right now. |
discordmute_plugin_sessions{plugin_version,game_version} | Connected plugins per plugin and Among Us version. |
discordmute_mutes_total{action} | Mutes and unmutes (mute or unmute). |
discordmute_mute_failures_total | Mutes and unmutes that failed. |
discordmute_mute_latency_seconds | How long successful mutes and unmutes take. |
discordmute_rate_limit_hits_total | Times Discord slowed the bot down. |
discordmute_guilds | Discord servers the bot is in. |
discordmute_feature_guilds{feature} | Servers the bot is in that have an optional feature switched on, for example ghostChat or serverLog. |
discordmute_cluster_guilds{cluster} | Servers per bot process. |
discordmute_cluster_ws_ping_seconds{cluster} | Connection delay to Discord per bot process. |
discordmute_cluster_snapshot_failures_total | Times a bot process did not answer a statistics request. |
discordmute_process_resident_memory_bytes{process} | Memory used per process. |