Skip to content

Commit 8c1fcb2

Browse files
authored
update sentry config to add sentry releases (#9)
1 parent 5dc1b44 commit 8c1fcb2

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
BOT_TOKEN=
22
SENTRY_DSN=
33
SENTRY_ENV=
4+
SENTRY_RELEASE=

kick_members.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,26 @@
1010
import sentry_sdk
1111
import telebot
1212
from dotenv import load_dotenv
13+
from sentry_sdk.integrations.logging import LoggingIntegration
1314
from telebot.apihelper import ApiTelegramException
1415

1516
logger = logging.getLogger(__name__)
1617

1718
# initialize dot env
1819
load_dotenv()
1920

21+
sentry_logging = LoggingIntegration(
22+
level=logging.INFO, # Capture info and above as breadcrumbs
23+
event_level=logging.ERROR, # Send errors as events
24+
)
25+
2026
# initialize sentry
2127
sentry_sdk.init(
2228
dsn=os.getenv("SENTRY_DSN"),
2329
environment=os.getenv("SENTRY_ENV"),
30+
release=os.getenv("SENTRY_RELEASE"),
2431
traces_sample_rate=1.0,
32+
integrations=[sentry_logging],
2533
)
2634

2735
# load BOT_TOKEN from env file

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
pyTelegramBotAPI==3.7.3
22
python-dotenv==0.14.0
3-
sentry-sdk==0.19.1
3+
sentry-sdk==0.19.4

0 commit comments

Comments
 (0)