aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bot/bot.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/bot/bot.py b/bot/bot.py
index 84caf1873..fa3617f1b 100644
--- a/bot/bot.py
+++ b/bot/bot.py
@@ -6,7 +6,7 @@ import aiohttp
from discord.errors import Forbidden
from pydis_core import BotBase
from pydis_core.utils.error_handling import handle_forbidden_from_block
-from sentry_sdk import push_scope
+from sentry_sdk import push_scope, start_transaction
from bot import constants, exts
from bot.log import get_logger
@@ -29,6 +29,11 @@ class Bot(BotBase):
super().__init__(*args, **kwargs)
+ async def load_extension(self, name: str, *args, **kwargs) -> None:
+ """Extend D.py's load_extension function to also record sentry performance stats."""
+ with start_transaction(op="cog-load", name=name):
+ await super().load_extension(name, *args, **kwargs)
+
async def ping_services(self) -> None:
"""A helper to make sure all the services the bot relies on are available on startup."""
# Connect Site/API