Skip to content

Commit

Permalink
Added sentry monitoring
Browse files Browse the repository at this point in the history
  • Loading branch information
rhysyngsun committed Jan 9, 2024
1 parent 6a28322 commit 7c17d0b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
12 changes: 12 additions & 0 deletions bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import re

import pytz
import sentry_sdk

from client_wrapper import ClientWrapper
from constants import (
Expand Down Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
python-dateutil
pytz
requests
sentry
tornado
virtualenv

0 comments on commit 7c17d0b

Please sign in to comment.