简体   繁体   English

Apache ActiveMQ - 检索 JMS 指标

[英]Apache ActiveMQ - retrieving JMS metrics

In my corporate project I am using Spring Boot and Apache ActiveMQ 5.x Spring Boot starter.在我的公司项目中,我使用 Spring Boot 和 Apache ActiveMQ 5.x Spring Boot starter。 I am a totally beginner in this.我在这方面完全是初学者。

My goal is to expose Prometheus endpoint with some JMS queue metrics:我的目标是使用一些 JMS 队列指标公开 Prometheus 端点:

  • number of messages in queue队列中的消息数
  • number of messages in error queue错误队列中的消息数

What are dedicated tools for retrieving such metrics?检索此类指标的专用工具是什么? Up to now I have found two possible ways.到目前为止,我已经找到了两种可能的方法。 Can anyone confirm which of these two tools can solve my problem?谁能确认这两个工具中的哪一个可以解决我的问题?

I don't think the Spring stuff will work because that will provide Spring-related metrics from the application itself, not the ActiveMQ broker.我不认为 Spring 的东西会起作用,因为它会从应用程序本身而不是 ActiveMQ 代理提供与 Spring 相关的指标。

Also, the documentation for ActiveMQ you cited is for ActiveMQ Artemis.此外,您引用的 ActiveMQ 文档适用于 ActiveMQ Artemis。 However, the dependency you're using is for ActiveMQ 5.x.但是,您使用的依赖项适用于 ActiveMQ 5.x。 Therefore, the documentation is not applicable.因此,文档不适用。 However, if you choose to use ActiveMQ Artemis it is very simple to expose a Prometheus endpoint using this Prometheus metrics plugin implementation .但是,如果您选择使用 ActiveMQ Artemis,则使用此Prometheus 指标插件实现公开 Prometheus 端点非常简单。 It's worth noting that Artemis is ActiveMQ's next generation message broker.值得注意的是,Artemis 是 ActiveMQ 的下一代消息代理。 If you're starting a new project I would recommend you use it rather than 5.x.如果您正在开始一个新项目,我建议您使用它而不是 5.x。 Artemis is planned to replace 5.x and become ActiveMQ 6.0 in the future. Artemis 计划在未来取代 5.x 并成为 ActiveMQ 6.0。

I think your best bet would be to configure the Prometheus JMX exporter .我认为您最好的选择是配置Prometheus JMX exporter It even has a sample configuration for ActiveMQ 5.x.它甚至还有 ActiveMQ 5.x 的示例配置

ActiveMQ comes with Jolokia bundled by default for extracting JMX Beans for the JVM, queues and a bunch of other metrics using HTTP. ActiveMQ默认捆绑了Jolokia ,用于为 JVM、队列和使用 HTTP 的一系列其他指标提取 JMX Bean。 That way we can easily export using a software like Telegraf , which comes with a simple input plugin for ActiveMQ and a simple output plugin for Prometheus .这样我们就可以使用Telegraf等软件轻松导出,该软件带有一个用于 ActiveMQ 的简单输入插件和一个用于 Prometheus 的简单 output 插件

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM