Monitoring and collecting data from ActiveMQ

Apache ActiveMQ is the most popular and powerful open source messaging and Integration Patterns server. Apache ActiveMQ is fast, supports many Cross Language Clients and Protocols, comes with easy to use Enterprise Integration Patterns and many advanced features while fully supporting JMS 1.1 and J2EE 1.4. Apache ActiveMQ is released under the Apache 2.0 License

More information on: http://activemq.apache.org/

How it works

The plugin can get statistics about ActiveMQ topics and queues using the JMX interface.

The minimal supported version of ActiveMQ is 5.10.0

Installation

The plugin needs to be installed together with a CoScale agent, instructions on how to install the CoScale agent can be found here. If you want to monitor ActiveMQ inside Docker containers using CoScale, check out the instructions here.

Configuration

Enable JMX

Update activemq.xml config file with the following. The useJMX field of the broker needs to be set to true.

<broker xmlns="http://activemq.apache.org/schema/core"
        useJmx="true"
        brokerName="localhost"
        dataDirectory="${activemq.base}/data">

The management context needs to be present and enabled

<!-- Use the following to configure how ActiveMQ is exposed in JMX -->
<managementContext>
    <managementContext createConnector="true" />
</managementContext>

The connector will be created in by default on localhost:1099.

Active checks

This plugin can be configured to post and receive a message to an ActiveMQ queue. This active monitoring allows us to calculate the uptime of the service and the response time of the insert and retrieval of the message.

The plugin uses the STOMP protocol in order to send and receive messages from the ActiveMQ broker. This needs to be enabled for active checks to work.

<transportConnectors>
    ...
    <transportConnector name="stomp" uri="stomp://0.0.0.0:61613?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
    ...
</transportConnectors>

The STOMP port and an optional login and password need to be provided. Also an existing queue should be specified. This queue should be dedicated for this check, since we will insert and retrieve messages from it.

Metrics

ActiveMQ

Name Unit Dimensions
ActiveMQ active check latency s  
ActiveMQ active check uptime %  
ActiveMQ daemon thread count #  
ActiveMQ garbage collection count #  
ActiveMQ garbage collection time s  
ActiveMQ number of queues #  
ActiveMQ number of topics #  
ActiveMQ os free physical memory size b  
ActiveMQ os max open file descriptor count #  
ActiveMQ os open file descriptor count #  
ActiveMQ os process cpu load %  
ActiveMQ os system cpu load %  
ActiveMQ os total physical memory size b  
ActiveMQ peak thread count #  
ActiveMQ thread count #  
ActiveMQ total started thread count #  
ActiveMQ uptime s  

ActiveMQ / Queue

Name Unit Dimensions
ActiveMQ average blocked time per queue s Queue
ActiveMQ average enqueue time per queue s Queue
ActiveMQ average message size per queue b Queue
ActiveMQ blocked sends per queue # Queue
ActiveMQ dequeue count per queue # Queue
ActiveMQ dequeue rate per queue # Queue
ActiveMQ dispatch count per queue # Queue
ActiveMQ enqueue count per queue # Queue
ActiveMQ enqueue rate per queue # Queue
ActiveMQ expired count per queue # Queue
ActiveMQ forward count per queue # Queue
ActiveMQ in flight count per queue # Queue
ActiveMQ number of consumers per queue # Queue
ActiveMQ number of producers per queue # Queue
ActiveMQ queue size # Queue

ActiveMQ / Topic

Name Unit Dimensions
ActiveMQ average blocked time per topic s Topic
ActiveMQ average enqueue time per topic s Topic
ActiveMQ average message size per topic b Topic
ActiveMQ blocked sends per topic # Topic
ActiveMQ dequeue count per topic # Topic
ActiveMQ dequeue rate per topic # Topic
ActiveMQ dispatch count per topic # Topic
ActiveMQ enqueue count per topic # Topic
ActiveMQ enqueue rate per topic # Topic
ActiveMQ expired count per topic # Topic
ActiveMQ forward count per topic # Topic
ActiveMQ in flight count per topic # Topic
ActiveMQ number of consumers per topic # Topic
ActiveMQ number of producers per topic # Topic
ActiveMQ topic queue size # Topic

Events

Name Description Attributes
ACTIVEMQ service state watcher State watcher status