JMX:如何检索/检测从受监视的应用程序抛出的异常

发布于 2024-08-26 16:25:50 字数 134 浏览 4 评论 0原文

我正在尝试使用 JMX 来监视应用程序的状态,特别是跟踪应用程序运行时引发的任何异常。

但是,我似乎找不到任何可以检索抛出的异常的现有 API。我尽可能获取线程的堆栈跟踪,但没有捕获任何异常信息。有人有什么想法吗?

谢谢。

I am trying to use JMX to monitor the status of my application, in particular to track any exceptions that are thrown during my application's runtime.

However, I cannot seem to find any existing APIs that can retrieve the exceptions thrown. I went as far as getting a thread's stacktrace but there ain't any exception info captured. Anyone has any idea?

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

听你说爱我 2024-09-02 16:25:50

我喜欢使用趋势上升计数器(调用计数和异常计数),我的监控工具(例如开源 Hyperic HQ)将其转换为“每分钟计数器”。

因此,我有一个“每分钟异常”计数器,可以在出现问题时触发警报(例如“每分钟超过 10 个异常”)。

我们开发了一个 @Profiled 注释,它可以完成这项计数工作,并测量调用所花费的时间和活动调用数量。

此 @profiled 注释与许多其他 JMX 附加功能打包在一起,以简化对常见组件(dbcp、util.concurrent、cxf、jms 等)的监控,并在商业友好的 Apache 软件许可证下建议,网址为 http://code.google.com/p/xebia-france/wiki/XebiaManagementExtras

希望这有帮助,

Cyrille (Xebia)

I like to use trends up counters (invocations count & exceptions count) that my monitoring tool (e.g. the open source Hyperic HQ) converts in "per minute counters".

Thanks to this, I have an "exceptions per minute" per minute counter on which I can trigger alerts in case of problems (e.g. "more than 10 exceptions per minute").

We developed a @Profiled annotation which does this counting job as well as measuring the time spent in the invocations and the active number of invocations.

This @profiled annotation is packaged with many other JMX extras to ease monitoring of common components (dbcp, util.concurrent, cxf, jms, etc) and proposed under a business friendly Apache Software License at http://code.google.com/p/xebia-france/wiki/XebiaManagementExtras .

Hope this helps,

Cyrille (Xebia)

寄人书 2024-09-02 16:25:50

尝试使用 JMX 通知。 这里有一个很棒的教程

Try using JMX notifications. You have a great tutorial here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文