diff --git a/discord/ext/prometheus/prometheus_cog.py b/discord/ext/prometheus/prometheus_cog.py index 0633ace..d1eaeff 100644 --- a/discord/ext/prometheus/prometheus_cog.py +++ b/discord/ext/prometheus/prometheus_cog.py @@ -2,6 +2,7 @@ from prometheus_client import start_http_server, Counter, Gauge from discord.ext import commands, tasks from discord import Interaction, InteractionType, AutoShardedClient +from discord.app_commands.commands import Command log = logging.getLogger("prometheus") @@ -124,7 +125,15 @@ async def on_interaction(self, interaction: Interaction): interaction.type == InteractionType.application_command and interaction.command ): - command_name = interaction.command.name + if isinstance(interaction.command, Command): + command_name = "" + parent = interaction.command.parent + while parent is not None: + command_name += parent.name + " " + parent = parent.parent + command_name += interaction.command.name + else: + command_name = interaction.command.name ON_INTERACTION_COUNTER.labels( shard_id, interaction.type.name, command_name