File tree Expand file tree Collapse file tree 3 files changed +10
-1
lines changed
Expand file tree Collapse file tree 3 files changed +10
-1
lines changed Original file line number Diff line number Diff line change 11BOT_TOKEN =
22SENTRY_DSN =
33SENTRY_ENV =
4+ SENTRY_RELEASE =
Original file line number Diff line number Diff line change 1010import sentry_sdk
1111import telebot
1212from dotenv import load_dotenv
13+ from sentry_sdk .integrations .logging import LoggingIntegration
1314from telebot .apihelper import ApiTelegramException
1415
1516logger = logging .getLogger (__name__ )
1617
1718# initialize dot env
1819load_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
2127sentry_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
Original file line number Diff line number Diff line change 11pyTelegramBotAPI == 3.7.3
22python-dotenv == 0.14.0
3- sentry-sdk == 0.19.1
3+ sentry-sdk == 0.19.4
You can’t perform that action at this time.
0 commit comments