Skip to content

Commit cd256ab

Browse files
committed
Added sentry monitoring
1 parent 6a28322 commit cd256ab

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

bot.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import re
1111

1212
import pytz
13+
import sentry_sdk
1314

1415
from client_wrapper import ClientWrapper
1516
from constants import (
@@ -1607,11 +1608,22 @@ def has_command(command_words, input_words):
16071608
input_words = [word.lower() for word in input_words]
16081609
return command_words == input_words[: len(command_words)]
16091610

1611+
def init_sentry():
1612+
"""Initialize the Sentry SDK"""
1613+
sentry_dsn = os.environ.get("SENTRY_SDK", "")
1614+
1615+
if sentry_dsn:
1616+
sentry_sdk.init(
1617+
dsn=sentry_dsn,
1618+
send_default_pii=False,
1619+
)
16101620

16111621
async def async_main():
16121622
"""async function for bot"""
16131623
envs = get_envs()
16141624

1625+
init_sentry()
1626+
16151627
channels_info = await get_channels_info(envs["SLACK_ACCESS_TOKEN"])
16161628
doof_id = await get_doofs_id(envs["SLACK_ACCESS_TOKEN"])
16171629
repos_info = load_repos_info(channels_info)

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
python-dateutil
22
pytz
33
requests
4+
sentry-sdk
45
tornado
56
virtualenv

0 commit comments

Comments
 (0)