diff --git a/bot/src/bot/modules/command_handler.ts b/bot/src/bot/modules/command_handler.ts index b56f2f5..b5d967a 100644 --- a/bot/src/bot/modules/command_handler.ts +++ b/bot/src/bot/modules/command_handler.ts @@ -73,7 +73,7 @@ let commands: Command[]; let cmd = commands.find(c => c.name == cmdName || (c.aliases?.indexOf(cmdName!) ?? -1) > -1); if (!cmd) return; - metrics.commands.inc(); + metrics.commands.inc({ command: cmd.name }); if (isSudo(msg.author!)) updateSudoTimeout(msg.author!); diff --git a/bot/src/bot/modules/metrics.ts b/bot/src/bot/modules/metrics.ts index c31909a..e73ffa6 100644 --- a/bot/src/bot/modules/metrics.ts +++ b/bot/src/bot/modules/metrics.ts @@ -8,7 +8,7 @@ const PORT = Number(process.env.BOT_METRICS_PORT); prom.collectDefaultMetrics({ prefix: 'automod_' }); const metrics = { - commands: new prom.Counter({ name: 'commands_executed', help: 'Amount of executed commands' }), + commands: new prom.Counter({ name: 'commands_executed', help: 'Command usage stats', labelNames: [ 'command' ] }), servers: new prom.Gauge({ name: 'server_count', help: 'Amount of servers the bot is in' }), wsPing: new prom.Gauge({ name: 'ws_ping', help: 'WebSocket ping as returned by revolt.js' }), msgPing: new prom.Gauge({ name: 'msg_ping', help: 'Amount of time it takes for the bot to send a message' }),