How to monitor ActiveMQ Artemis
Asked Answered
J

2

7

I'm doing some testing with RabbitMQ, ActiveMQ "Classic" and ActiveMQ Artemis in a Windows .NET environment. RabbitMQ and ActiveMQ "Classic" ship with a web interface where you can see information about your broker, queues, messages etc., but ActiveMQ Artemis does not. I really want to be able to monitor my ActiveMQ Artemis broker in a web interface or at the very least with some cmd/PowerShell commands.

I've read on this page about some third-party tools that can be used to monitor an ActiveMQ instance and I assumed that it also applied to Artemis. Unfortunately, I have not been able to get these third-party tools to work. Some of them don't seem to work well on Windows and some are old/inactive.

My clients are communicating with the brokers through NMS (.NET Messaging API) in C#. If anyone has been able to monitor their Artemis broker, especially on a Windows machine, please let me know how you did it!

EDIT: I have managed to communicate with the Jolokia REST API now. With a GET request to:

http://username:password@localhost:8161/jolokia/read/org.apache.activemq.artemis:*

I am able to see a bunch of information about my queues such as messages added and consumed. This is nice information that will help me but I would like information about current memory usage and disk usage.

Jersey answered 11/5, 2016 at 12:20 Comment(3)
Hi. I am sorry, I cannot really help you with your problem, but I try to achieve something similar and wanted to ask you something: Does your Apache Artemis run embedded in Wildfly 10 by any chance? Because I try to connect to such an instance with Apache NMS and I cannot get it to run. When Apache Artemis runs standalone it's no problem, but not in Wildfly. I even tried to add Openwire to Wildfly by following this link , but it did not work either.Soak
@Soak Nope, I'm running it standalone, sorry!Jersey
I was afraid of that, thanks for the reply anyway and good luck with your problem! ;)Soak
T
12

Take a look at the Management chapter of the Artemis manual. As far as I know, the following options are available to you

JMX (Java Management Service)

JMX is a Java API for managing Java servers. There are multiple GUIs that connect to java servers via JMX. The most notable being jConsole. There is a list of other GUIs here or there, or you could build your own

jConsole

enter image description here

jConsole is a GUI application that you can connect to a JMX enabled server. It is a part of the Java JDK, so you probably have it installed already.

Jolokia

Jolokia, tutorial, is a JSON API layer over JMX. It makes the JMX interface accessible over HTTP(S). You may query the information using any HTTP client library. You already figured out this in your question. Again, there are GUIs on top of that, the most notable being

Hawt.io Artemis plugin

enter image description here

Hawt.io is an Angular.js management console. It can be thought of as a GUI for Jolokia.

Artemis 2.6 and newer

Hawt.io plugin is built in, no extra setup necessary.

Artemis 1

There is a hawt.io plugin for Artemis made by Red Hat. Compile the plugin and get a .war file. Artemis contains a built-in Jetty webserver. You need put that war to apache-artemis-1.3.0/web. You also need to download hawtio-default.war from http://hawt.io/getstarted/index.html to the same directory. Then, in the instance directory, edit etc/bootstrap.xml and add these wars to config.

Or you can get Red Hat AMQ 7, currently in Alpha, which has the management plugin built in. Start it up and go to localhost:8161/hawtio. I work for a company that sells that product.

Prometheus and Grafana

Grafana ActiveMQ Artemis

There is a repository and an accompanying blogpost that describes Prometheus and Grafana setup with ActiveMQ Artemis, all running in OpenShift.

The jmx exporter for Prometheus contains example config for Artemis 2 to get started.

Thaler answered 19/7, 2016 at 10:50 Comment(6)
I am still suprised by the lack of good administrative console, like the ActiveMQWeb for ActiveMQ. It is not perfect although, but at least you can see in one sight the state (pending messages, consumers, etc...) of all queues on one page. JMX counter have to be browsed one by one which make the operations very slow and not user friendly.Shf
Is Appdynamix extension available for ActiveMQ Artemis?Calzada
@JohnSmith Not that I am aware of. You can point Appdynamix to the JMX management interface in Artemis, and it will try to pull some useful metrics from that, docs.appdynamics.com/display/PRO43/Monitor+JMX. Monitoring could be topic for discussion in the Artemis project. There is many collectors, each with its own ecosystem. Which of them would be worth pursuing?Thaler
@user7610, I am using the ActiveMQ extension of AppD. It is good to start. With JMXRemote(enabled in artemis.profile) it is OK. But, I want it from localhost. JMX is enabled by default for localhost for AMQ. AMQ management console use jmx internally and it works without JMXRemote enabled. What service URL jolokia use internally to connect using JMX from localhost? Sorry for this direct question to you. Thanks.Calzada
@JohnSmith Can you please post your question as a new item on StackOverflow.com site? Artemis developers are monitoring the activemq-artemis tag and should be able to answer better than me.Thaler
Thanks, asked at #50218709Thaler
H
0

The simplest and easiest way to monitor the broker is with the ActiveMQ Artemis web console. This was added back in 2.3.0 (released in September 2017). At that time it was based on Hawtio 1, but it was recently updated to Hawtio 2.

The most powerful and flexible way to monitor the broker is to use a metrics plugin. Metrics plugins allow integration with specialized monitoring tools like CloudWatch, Datadog, Dynatrace, Elastic, Prometheus, etc. A Prometheus metrics plugin implementation is available. That combined with a Grafana dashboard for visualization and alerting is very powerful.

Hays answered 27/9, 2021 at 19:54 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.