“外观网络服务”的监控和日志记录策略?

发布于 2024-08-06 13:48:59 字数 959 浏览 2 评论 0原文

我正在开发“外观网络服务”,我需要重新考虑其中的一部分。

上下文 - 我的 Web 服务(我们称之为“FacadeWebservice”)是一个内部 Web 服务,旨在隐藏我的系统中其他 Web 服务的复杂性:

  • 我的 FacadeWebservice 调用 ExternalWebserviceAExternalWebserviceB 并且很快需要调用 ExternalWebserviceC
  • ExternalWebserviceAExternalWebserviceBExternalWebserviceC是外部Web服务;它们可能会发生变化和停机。

复杂性越来越高,我需要重新考虑监视 FacadeWebservice 和外部 Webservice 的方式。我需要:

  • 我的应用程序状态的完整视图(调用次数、发送的错误代码)
  • 清楚了解外部 Web 服务的情况(外部 Web 服务停机时间、我的 Web 服务收到的响应代码 - 例如,其中之一经常出现“技术错误/只读”一段时间)
  • 基本上是一个显示整体状态的简单视图/工具。
  • 服务可用性几乎已涵盖(因此我不需要像 Nagios 这样的应用程序),我想知道应用程序级别发生了什么。

我正在考虑在我的 FacadeWebservice 中使用 JMX - 这可以为我提供一些有趣的图表和统计数据。

这是要走的路吗?或者一个好的日志记录策略足以完成这项任务(即使外部更改是我问题的一个重要部分)?

关于这个主题有什么建议或经验吗?

I'm working on a "facade webservice" and I need to rethink part of it.

The context - my webservice (let's call it "FacadeWebservice") is an internal webservice developed to hide other webservices complexity from my system:

  • My FacadeWebservice calls ExternalWebserviceA, ExternalWebserviceB and will soon need to call ExternalWebserviceC.
  • ExternalWebserviceA, ExternalWebserviceB and ExternalWebserviceC are external webservices; they're subject to change and downtime.

Complexity is getting higher and higher, and I need to rethink the way I'm monitoring my FacadeWebservice and the external webservices. I need:

  • a complete view of my application status (number of calls, error codes sent)
  • a good idea of what's going on with external webservices (external webservices downtime, reponse codes received by my webservice - for example, one of them often go "technical error / readonly" for some time)
  • basically, a simple view/tool that shows the overall status.
  • service availability is pretty much covered (so I don't need apps like Nagios), I want to know what's going on at application level.

I was thinking about using JMX within my FacadeWebservice - this could provide me some ineresting graphs and statisics.

Is it the way to go? Or a good logging strategy is plenty enough for this task (even if external changes is a big part of my problem)?

Any advice or experience on the subject?

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

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

发布评论

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

评论(3

放肆 2024-08-13 13:48:59

这是一个相当复杂的要求,但您可以尝试 JavaMelody,http://javamelody.googlecode.com

  • “应用程序状态(调用次数、发送的错误代码)”:是的,通过 http 调用和 http 错误的次数
  • 可以通过拦截器使用 JavaMelody 来完成
  • “外部 Web 服务”统计:是的,如果您使用 EJB3 或 Spring JavaMelody 在应用程序级别进行监控,则 它有“图表和统计数据”:参见屏幕截图

It is quite a complex requirement but you can try JavaMelody, http://javamelody.googlecode.com

  • "application status (number of calls, error codes sent)" : yes, via number of http calls and http errors
  • "external webservices" statistics: yes, it can be done with JavaMelody via interceptors if you use EJB3 or Spring
  • JavaMelody does monitoring at application level and it has "graphs and statistics": see screenshots
风柔一江水 2024-08-13 13:48:59

JMX的优点是可以运行命令和查询复杂的数据。

缺点是标准控制台(与 Java 版本一起使用)非常有限。它什么都能做,但什么都做不好。

我的解决方案是创建一个简单的 HTML 页面来显示该数据。它具有以下优点:

  1. 我可以轻松地以对我最有用的方式格式化我想要查看的数据。

  2. 我可以使用任何网络浏览器查看(在家、网吧、手机)

主要缺点缺点是显示复杂数据(如图表和趋势)并不容易。

[编辑] 也就是说,JMX 支持显示图形和趋势,但它没有内存。这样您就可以了解启动 JMX 控制台以来发生的情况。如果您需要能够查看过去,则必须始终在某个地方运行 JMX 控制台。

在这种情况下,将图形渲染模块添加到“简单 HTML 页面”中可能会更简单,您可以在其中绘制所需的内容。

The advantage of JMX is that you can run commands and query complex data.

The disadvantage is that the standard console (which you get along with your Java version) is pretty limited. It can do anything but nothing really well.

My solution was to create a simple HTML page which shows that data. It has these advantages:

  1. I can easily format the data I want to see the way most useful for me.

  2. I can use any web browser to have a look (at home, internet cafe, mobile phone)

The main disadvantage is that it's not so easy to display complex data (like graphs and trends).

[EDIT] That said, JMX has support for displaying graphs and trends but it has no memory. So you get what's happening since you started your JMX console. If you need to be able to look into the past, you must run a JMX console somewhere all the time.

In this case, it might be more simple to add a graphics rendering module to your "simple HTML page" where you can draw what you need.

赏烟花じ飞满天 2024-08-13 13:48:59

我不知道这是否是一个选项,但看起来您需要 ESB 组件提供的一些功能:

  • Web 服务的聚合、组合和编排
  • 监控(调用数量、代理 Web 服务的运行状况等)
  • 管理控制台
  • 等也许

您应该检查类似 ServiceMix 的东西,它可以通过 JMX 进行监控(请参阅 使用 JMX 控制台ServiceMix):

替代文字
(来源:apache.org

或其他商业工具(Mule ESB EnterpriseALSBOracle服务巴士...)。

I don't know if this is an option but it looks like you need some features that are offered by ESB component:

  • Aggregation, composition and orchestration of web services
  • Monitoring (number of calls, health of proxyed web services, etc)
  • Management console
  • etc etc

Maybe you should check out something like ServiceMix that can be monitored through JMX (see Using a JMX Console with ServiceMix):

alt text
(source: apache.org)

Or other commercial tools (Mule ESB Enterprise, ALSBOracle Service Bus...).

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