- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
如 docs 中所述,基于 spring-boot 的 Web 服务正在使用 Sentry .它工作正常,但不应将某些异常发送到 Sentry ,例如为了在某些请求上返回 HTTP 状态 410
而抛出的异常:
// Kotlin code, but in Java it would be similar.
@ResponseStatus(value = HttpStatus.GONE)
class GoneException(msg: String) : RuntimeException(msg) {
}
如何告诉我的 sentryExceptionResolver
跳过这些异常?
最佳答案
在 python 中很简单,你只需在配置文件中添加以下代码即可忽略多个异常
ignore_exceptions = [
'Http404',
'Http401'
'django.exceptions.http.Http404',
'django.exceptions.*',
ValueError,
]
但是在java中我无法在sentry.properties
中找到类似的标签,自己尝试一下也许你会找到。
##Just give it a try, I didnt test
ignore.exceptions:
HTTP 401
或者您可以在您的配置类中添加HandlerExceptionResolver
并覆盖resolveException
方法并手动忽略异常。
@Configuration
public class FactoryBeanAppConfig {
@Bean
public HandlerExceptionResolver sentryExceptionResolver() {
return new SentryExceptionResolver() {
@Override
public ModelAndView resolveException(HttpServletRequest request,
HttpServletResponse response,
Object handler,
Exception ex) {
Throwable rootCause = ex;
while (rootCause .getCause() != null && rootCause.getCause() != rootCause) {
rootCause = rootCause.getCause();
}
if (!rootCause.getMessage().contains("HTTP 401")) {
super.resolveException(request, response, handler, ex);
}
return null;
}
};
}
@Bean
public ServletContextInitializer sentryServletContextInitializer() {
return new SentryServletContextInitializer();
}
}
关于spring - 将某些异常排除在报告给 Sentry 之外,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50037108/
我有一个工作正常的 Sentry 服务器。 raven test -> Sending a test message... success! 我有一台装有 django 1.3 和 raven 1.
使用 Sentry 7.7,在 Docker 的前提下。一切正常,但消息分组很奇怪: 它们是相同的事件,只有一条消息和一个时间戳,但它们并没有组合在一起,为什么? 最佳答案 谢谢@David, 使用指
例如: 我通过在搜索栏中搜索特定用户的电子邮件地址来搜索发生在特定用户身上的错误。这让我回到了错误列表。当我单击其中一个错误时,它会向我显示发生在其他用户身上的类似错误。如何找到我搜索的用户发生的确切
我知道如何开始哨兵。 但是,当我更改sentry.conf.py时,如何使其起作用? 我运行了岗哨帮助,找不到岗哨停止或重新启动commond。 有没有一种方法可以重新启动哨兵服务器? 最佳答案 我自
如何在 Sentry 中自定义用户反馈表? 默认情况下,它会说“看起来我们遇到了一些内部问题”。 是否可以更改消息、收集的数据等? 谢谢。 最佳答案 有一个 API here ,但你必须得到一个 ev
我目前正在将 Sentry 集成到 Angular 网络应用程序中。我成功地将 Sentry 中的 console.log/warn/error 和异常报告为“问题”。 但是,当对我的服务器的请求失败
我是新来的哨兵。 Sentry 中的客户端 key (DSN) 在哪里? 在我的项目页面中,有问题、概览、用户反馈、发布选项卡。 但是没有设置。 哨兵说 “正在寻找 SDK 的 DSN?您会在 [项目
这是给 Sentry (Open-source error tracking)用户。 我尝试了一些代码,但没有成功。我希望你能调查一下。 提前感谢大家。 我已经下载了 SDK zip 并将其上传到服务
即使错误已成功发送,Sentry Dashboard 仍未更新的原因是什么? 我尝试模拟错误并在 Raven 库中记录从获取异常到发送给 Sentry 的整个过程。 Raven 返回了 200 Htt
我正在尝试在我的项目上启用用户反馈功能。到目前为止,我尝试了几件事但没有成功。我正在使用 django 1.11 和 raven 6.8.0 我也遵循了这个解决方案 - [DOCS] Django I
我接手了一个使用 python 和 flask 的项目(我也是 python/flask 的新手!)。我想向其中添加 Sentry 以捕获发生的任何错误/异常。为了增加复杂性,该项目被拆分为多个相互链
我已经包含 Sentry 来跟踪我的移动应用程序的崩溃。它工作正常,现在我想向 Sentry 发送警告消息以跟踪它们。有没有办法从 JavaScript 端做到这一点。谢谢。 最佳答案 // set
我有一个 create-react-app 项目,我希望部署过程生成一个 Sentry 版本并将源映射也上传到 Sentry。 最佳答案 此脚本将为 package.json 文件中指定的版本创建一个
我将为我的 Android 应用程序使用 Sentry。我公司使用的是自托管的 Sentry,版本 9.0.0。当我使用 sentry-cli 运行 sentry-cli info 命令时,我得到以下
我正在使用 Tomcat (7.0.70) + sentry(sentry 和 sentry-spring)+ JUL 以及以下 logging.properties WEB-INF/classes
编辑:标题并添加一些代码示例。 我正在尝试弄清楚如何使用相同的 DSN 将 Celery 工作程序和 Flask 日志记录发送到 Sentry。 设置如下: Flask 应用向 Celery Work
我将为我正在处理的 Android 项目使用 Sentry。我公司使用的是自托管的 Sentry,版本 9.0.0 我关注了Sentry.io Installation Guide . 这些权限已添加
我的应用程序正在使用 slf4j,自然地,我有一个 logback.xml 文件。我尝试向该文件添加一个 Sentry 附加程序。这是我的 logback.xml 文件。
我正在使用 webpack 构建我的应用程序,它可以在本地使用 @sentry/webpack-plugin – 它自动生成发布并将源 map 上传到 Sentry。 但是,如果我尝试在 Heroku
背景: 默认情况下,Sentry 服务将用户 hive、hue 和 impala 作为哨兵管理员。这与 Cloudera Manager (CM) sentry.service.admin.group
我是一名优秀的程序员,十分优秀!