JMX:如何检索/检测从受监视的应用程序抛出的异常
我正在尝试使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我喜欢使用趋势上升计数器(调用计数和异常计数),我的监控工具(例如开源 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)
尝试使用 JMX 通知。 这里有一个很棒的教程
Try using JMX notifications. You have a great tutorial here