Sanic Web服务器的哨兵集成
sanic-sentr的Python项目详细描述
Sanic Sentry–与Sanic Web服务器的Sentry集成。
要求
- python>;=3.5
安装
sanic sentry应该使用pip安装:
pip install sanic-sentry
用法
若要初始化插件,您可以将“app”传递到“uuuinit”:
>>>fromsanicimportSanic>>>fromsanic_sentryimportSanicSentry>>>app=Sanic(__name__)>>>plugin=SanicSentry(app)
或者使用初始化应用程序来反转依赖关系:
>>>plugin=SanicSentry()>>>plugin.init_app(app)
可选参数:
sentry\u dsn-应用程序的sentry dsn:
如果不设置RAVEN,则会返回SENTRY\U DSN环境变量。不设置也将禁用Raven。
>>>app.config['SENTRY_DSN']='http://public:secret@example.com/1'
^ {STR 1 } $sCCENYYPARAMS< <强> >为哨兵配置高级参数:
在https://docs.sentry.io/clients/python/advanced/
中解释>>>app.config['SENTRY_PARAMS']={..."release":"myapp_v0.4",..."environment":"production",...}