Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added sentry monitoring #375

Merged
merged 1 commit into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 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 @@ -1608,10 +1609,23 @@ def has_command(command_words, 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-sdk
tornado
virtualenv
Loading