File tree 2 files changed +19
-0
lines changed
2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -12,3 +12,4 @@ pyparsing==2.4.7
12
12
pytest == 6.2.3
13
13
soupsieve == 2.2.1
14
14
toml == 0.10.2
15
+ sentry-sdk == 1.5.10
Original file line number Diff line number Diff line change @@ -368,6 +368,12 @@ def main():
368
368
dest = "verbose_poll" ,
369
369
help = "also enable logging for poll requests and responses" ,
370
370
)
371
+ p .add_option (
372
+ '--sentry_dsn' ,
373
+ '-s' ,
374
+ help = "Sentry DSN url to enable error reporting to remote system" ,
375
+ default = "" ,
376
+ )
371
377
372
378
options , _ = p .parse_args ()
373
379
@@ -379,6 +385,18 @@ def main():
379
385
)
380
386
logging .getLogger ('pika' ).setLevel (logging .WARNING )
381
387
388
+ if options .sentry_dsn :
389
+ import sentry_sdk
390
+ from sentry_sdk .integrations .logging import LoggingIntegration
391
+ sentry_logging = LoggingIntegration (
392
+ level = logging .INFO ,
393
+ event_level = logging .ERROR ,
394
+ )
395
+ sentry_sdk .init (
396
+ dsn = options .sentry_dsn ,
397
+ integrations = [sentry_logging , ],
398
+ )
399
+
382
400
srv = EPP_RPC_Server (
383
401
epp_params = open (options .epp , 'r' ).read ().strip ().split (' ' ),
384
402
rabbitmq_params = open (options .rabbitmq , 'r' ).read ().strip ().split (' ' ),
You can’t perform that action at this time.
0 commit comments