如何忽略Sentry(不要发送它们)的某些错误?
我有一个基于Django(3.2.10)和Sentry-SDK(1.16.0)的项目 有我的哨兵输入文件:
from os import getenv
SENTRY_URL = getenv('SENTRY_URL')
if SENTRY_URL:
from sentry_sdk import init
from sentry_sdk.integrations.django import DjangoIntegration
from sentry_sdk.integrations.redis import RedisIntegration
from sentry_sdk.integrations.celery import CeleryIntegration
init(
dsn=SENTRY_URL,
integrations=[DjangoIntegration(), RedisIntegration(), CeleryIntegration()],
traces_sample_rate=1.0,
send_default_pii=True,
debug=True,
)
我都会从例外继承一个自定义词,
每次提出CustomError Sentry-SDK时,
然后将其发送给DSN-url。我想忽略一些错误或类似的错误。 我该怎么做?
I have a project based on django (3.2.10) and sentry-sdk (1.16.0)
There is my sentry-init file:
from os import getenv
SENTRY_URL = getenv('SENTRY_URL')
if SENTRY_URL:
from sentry_sdk import init
from sentry_sdk.integrations.django import DjangoIntegration
from sentry_sdk.integrations.redis import RedisIntegration
from sentry_sdk.integrations.celery import CeleryIntegration
init(
dsn=SENTRY_URL,
integrations=[DjangoIntegration(), RedisIntegration(), CeleryIntegration()],
traces_sample_rate=1.0,
send_default_pii=True,
debug=True,
)
I have a CustomError inherited from Exception
Every time I raise the CustomError sentry-sdk sends it to the dsn-url.
I want to ignore some class of error or something like this.
How can I do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以传递过滤要发送的错误的函数:
您可以在文档。
You can pass a function that filters the errors to be sent:
You can find more info in the documentation.