diff --git a/bot.py b/bot.py index f4a472f..cfb5058 100755 --- a/bot.py +++ b/bot.py @@ -10,6 +10,7 @@ import re import pytz +import sentry_sdk from client_wrapper import ClientWrapper from constants import ( @@ -1607,11 +1608,22 @@ def has_command(command_words, input_words): input_words = [word.lower() for word in input_words] return command_words == input_words[: len(command_words)] +def init_sentry(): + """Initialize the Sentry SDK""" + sentry_dsn = os.environ.get("SENTRY_SDK", "") + + if sentry_dsn: + sentry_sdk.init( + dsn=sentry_dsn, + send_default_pii=False, + ) async def async_main(): """async function for bot""" envs = get_envs() + init_sentry() + channels_info = await get_channels_info(envs["SLACK_ACCESS_TOKEN"]) doof_id = await get_doofs_id(envs["SLACK_ACCESS_TOKEN"]) repos_info = load_repos_info(channels_info) diff --git a/requirements.txt b/requirements.txt index e9c5706..d517dfc 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,6 @@ python-dateutil pytz requests +sentry tornado virtualenv