aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Sebastiaan Zeeff <[email protected]>2020-01-13 09:46:06 +0100
committerGravatar GitHub <[email protected]>2020-01-13 09:46:06 +0100
commit278277c522f1c4fb4ac1c3f425153c9a36e2264a (patch)
tree1e805c143db970a5ef1ac79fc1f670857e69143d
parentReplace sphinx mock classes with SimpleNamespaces; add user_agent to config (diff)
parentMerge pull request #726 from python-discord/track-command-completions-by-user (diff)
Merge branch 'master' into doc_config_useragent
-rw-r--r--bot/cogs/metrics.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/bot/cogs/metrics.py b/bot/cogs/metrics.py
index fa858bbd6..47c3cc55e 100644
--- a/bot/cogs/metrics.py
+++ b/bot/cogs/metrics.py
@@ -31,8 +31,8 @@ class Metrics(Cog):
)
self.command_completions = Counter(
name=f'{self.PREFIX}_command_completions',
- documentation="Completed commands by command by guild.",
- labelnames=('guild_id', 'command')
+ documentation="Completed commands by command, user, and guild.",
+ labelnames=('guild_id', 'user_id', 'user_name', 'command')
)
@Cog.listener()
@@ -87,6 +87,8 @@ class Metrics(Cog):
self.command_completions.labels(
guild_id=ctx.message.guild.id,
+ user_id=ctx.author.id,
+ user_name=str(ctx.author),
command=command,
).inc()