Skip to main content

ActiveMQ

icon

The ActiveMQ app is a unified logs and metrics app that helps you monitor the availability, performance, health, and resource utilization of your ActiveMQ messaging clusters. Preconfigured dashboards provide insight into cluster status, nodes, producers, consumers, destinations, resource utilization, message rates, and error logs.

Sample log messages

{
timestamp:1624348918179,
log:"2021-06-22 08:01:57,993 | DEBUG | Publishing: tcp://activemq-2:61616 for broker transport URI: tcp://activemq-2:61616?maximumConnections=1000&wireFormat.maxFrameSize=104857600 | org.apache.activemq.broker.TransportConnector | ActiveMQ Transport: tcp:///10.32.0.1:16932@61616",
stream:"stdout",
time:"2021-06-22T08:01:58.177654533Z"
}

Collecting logs and metrics for ActiveMQ

This App has been tested with following ActiveMQ versions:

  • 5.16.2.

Configure ActiveMQ logs and metrics collection

Choose your environment:

In Kubernetes environments, we use the Telegraf Operator, which is packaged with our Kubernetes collection (learn more). The diagram below illustrates how data is collected from ActiveMQ in a Kubernetes environment. In the architecture shown below, there are four services that make up the metric collection pipeline: Telegraf, Telegraf Operator, Prometheus, and Sumo Logic Distribution for OpenTelemetry Collector.

activemg-telegraf-operator

The first service in the metrics pipeline is Telegraf. Telegraf collects metrics from ActiveMQ. Note that we’re running Telegraf in each pod we want to collect metrics from as a sidecar deployment for example, Telegraf runs in the same pod as the containers it monitors. Telegraf uses the Jolokia2 input plugin to obtain metrics. (For simplicity, the diagram doesn’t show the input plugins.) The injection of the Telegraf sidecar container is done by the Telegraf Operator. Prometheus pulls metrics from Telegraf and sends them to Sumo Logic Distribution for OpenTelemetry Collector, which enriches metadata and sends metrics to Sumo Logic.

In the logs pipeline, Sumo Logic Distribution for OpenTelemetry Collector collects logs written to standard out and forwards them to another instance of Sumo Logic Distribution for OpenTelemetry Collector, which enriches metadata and sends logs to Sumo Logic.

Prerequisites

It’s assumed that you are using the latest helm chart version. If not, upgrade using the instructions here.

Configure Metrics Collection

This section explains the steps to collect ActiveMQ metrics from a Kubernetes environment.

  1. Set up Kubernetes Collection with the Telegraf Operator.
  2. Configure ActiveMQ Image: To enable Telegraf sidecar to get metrics from ActiveMQ Container, you must enable read metrics from ActiveMQ Container via the JMX MBeans and Disable strict-checking.
    1. Enable reads metrics from ActiveMQ Container via the JMX MBeans. While building the ActiveMQ docker image, setting useJmx="true” in ActiveMQ.xml config file:
    <broker useJmx="true" brokerName="BROKER1">
    ...
    </broker>
    1. Disable strict-checking by editing file jolokia-access.xml. While building the ActiveMQ docker image, edit file jolokia-access.xml in <Folder ActiveMQ Installed>/webapps/api/WEB-INF/classes/ and comment or remove section below:
    <cors>
    <strict-checking/>
    </cors>
  3. Add the following annotations on your ActiveMQ pods:
 annotations:
telegraf.influxdata.com/class: sumologic-prometheus
prometheus.io/scrape: "true"
prometheus.io/port: "9273"
telegraf.influxdata.com/inputs: |+
[[inputs.disk]]
mount_points = ["/"]
[inputs.disk.tags]
environment="dev"
component="messaging"
messaging_system="activemq"
messaging_cluster="activemq_on_k8s_CHANGE_ME"
[[inputs.jolokia2_agent]]
urls = ["http://localhost:8161/api/jolokia"]
name_prefix = "activemq_"
username = "<username_CHANGE_ME>"
password = "<password_CHANGE_ME>"
[inputs.jolokia2_agent.tags]
environment="prod_CHANGE_ME"
component="messaging"
messaging_system="activemq"
messaging_cluster="activemq_on_k8s_CHANGE_ME"

[[inputs.jolokia2_agent.metric]]
name = "OperatingSystem"
mbean = "java.lang:type=OperatingSystem"


[[inputs.jolokia2_agent.metric]]
name = "jvm_runtime"
mbean = "java.lang:type=Runtime"
paths = ["Uptime"]

[[inputs.jolokia2_agent.metric]]
name = "jvm_memory"
mbean = "java.lang:type=Memory"


[[inputs.jolokia2_agent.metric]]
name = "jvm_garbage_collector"
mbean = "java.lang:name=*,type=GarbageCollector"
paths = ["CollectionCount"]
tag_keys = ["name"]

[[inputs.jolokia2_agent.metric]]
name = "queue"
mbean =
"org.apache.activemq:brokerName=*,destinationName=*,
destinationType=Queue,type=Broker"
tag_keys = ["brokerName","destinationName"]

[[inputs.jolokia2_agent.metric]]
name = "topic"
mbean =
"org.apache.activemq:brokerName=*,destinationName=*,
destinationType=Topic,type=Broker"
tag_keys = ["brokerName","destinationName"]

[[inputs.jolokia2_agent.metric]]
name = "broker"
mbean = "org.apache.activemq:brokerName=*,type=Broker"
tag_keys = ["brokerName"]

Enter values for the following parameters (marked CHANGE_ME above):

  • telegraf.influxdata.com/inputs. This contains the required configuration for the Telegraf ActiveMQ Input plugin. Please refer to this doc for more information on configuring the ActiveMQ input plugin for Telegraf. Note: As telegraf will be run as a sidecar the host should always be localhost.

    • In the input plugins section, which is [[inputs.jolokia2_agent]]:
      • url - The URL of the ActiveMQ server for JMX MBeans HTTP Endpoint. Please see this doc for more information on additional parameters for configuring the Jolokia2 input plugin for Telegraf.
      • username. The Username of ActiveMQ’s admin account. The default is “admin”.
      • password. The password of ActiveMQ's admin account. The default is “admin”.
    • In the tags section, [inputs.jolokia2_agent.tags]:
      • environment. This is the deployment environment where the ActiveMQ cluster identified by the value of servers resides. For example: dev, prod or qa. While this value is optional we highly recommend setting it.
      • messaging_cluster. Enter a name to identify this ActiveMQ cluster. This cluster name will be shown in the Sumo Logic dashboards.
    Do not modify these values

    Modifying these values will cause the Sumo Logic apps to not function correctly.

    • telegraf.influxdata.com/class: sumologic-prometheus. Instructs the Telegraf operator what output to use.
    • prometheus.io/scrape: "true". Ensures our Prometheus will scrape the metrics.
    • prometheus.io/port: "9273". Tells prometheus what ports to scrape on.
      • telegraf.influxdata.com/inputs
        • In the tags section, [inputs.jolokia2_agent.tags]:
          • component: “messaging” - Used by Sumo Logic apps to identify application components.
          • messaging_system: “activemq” - Identifies the messaging system.
    • For all other parameters, please see this doc for more parameters that can be configured in the Telegraf agent globally.
  1. SumoLogic Kubernetes collection will automatically start collecting metrics from the pods having the labels and annotations defined in the previous step.
  2. Verify metrics in Sumo Logic.

Configure Logs Collection

This section explains the steps to collect ActiveMQ logs from a Kubernetes environment.

  1. Collect ActiveMQ logs written to standard output. If your ActiveMQ pod is writing logs to standard output, follow the steps below to collect logs:

    1. Make sure that the logs from ActiveMQ are sent to stdout. Follow the instructions below to capture ActiveMQ logs from stdout on Kubernetes. Apply the following labels to the ActiveMQ pods:
    environment: "prod_CHANGE_ME"
    component: "messaging"
    messaging_system: "activemq"
    messaging_cluster: "activemq_on_k8s_CHANGE_ME"
    1. Enter in values for the following parameters (marked in CHANGE_ME above):
    • environment. This is the deployment environment where the ActiveMQ cluster identified by the value of servers resides. For example: dev, prod or qa. While this value is optional we highly recommend setting it.
    • messaging_cluster. Enter a name to identify this ActiveMQ cluster. This cluster name will be shown in the Sumo Logic dashboards.
    Do not modify these values

    Modifying these values will cause the Sumo Logic apps to not function correctly.

    • component: “messaging”. This value is used by Sumo Logic apps to identify application components.
    • messaging_system: “activemq”. This value identifies the messaging system.
    • For all other parameters, see this doc for more parameters that can be configured in the Telegraf agent globally.
    1. The Sumologic-Kubernetes-Collection will automatically capture the logs from stdout and will send the logs to Sumologic. For more information on deploying Sumologic-Kubernetes-Collection, please see this page.
  2. (Optional) Collecting ActiveMQ Logs from a Log File. If your ActiveMQ chart/pod is writing its logs to log files, you can use a sidecar to send log files to standard out. To do this:

    1. Determine the location of the ActiveMQ log file on Kubernetes. This can be determined from the log4j.properties for your ActiveMQ cluster along with the mounts on the ActiveMQ pods.
    2. Install the Sumo Logic tailing sidecar operator.
    3. Add the following annotation in addition to the existing annotations.
    annotations:
    tailing-sidecar: sidecarconfig;<mount>:<path_of_ActiveMQ_log_file>/<ActiveMQ_log_file_name>

    Example:

    annotations:
    tailing-sidecar: sidecarconfig;data:/opt/activemq/data/activemq.log
    1. Ensure that the ActiveMQ pods are running and annotations are applied by using the command:
    kubectl describe pod <ActiveMQ_pod_name>
    1. Sumo Logic Kubernetes collection will automatically start collecting logs from the pods having the annotations defined above.
  3. FER to normalize the fields in Kubernetes environments. Labels created in Kubernetes environments automatically are prefixed with pod_labels. To normalize these for our app to work, a Field Extraction Rule is automatically created named AppObservabilityMessagingActiveMQFER

Installing the ActiveMQ app

To install the app, do the following:

note

Next-Gen App: To install or update the app, you must be an account administrator or a user with Manage Apps, Manage Monitors, Manage Fields, Manage Metric Rules, and Manage Collectors capabilities depending upon the different content types part of the app.

  1. Select App Catalog.
  2. In the 🔎 Search Apps field, run a search for your desired app, then select it.
  3. Click Install App.
    note

    Sometimes this button says Add Integration.

  4. Click Next in the Setup Data section.
  5. In the Configure section of your respective app, complete the following fields.
    1. Field Name. If you already have collectors and sources set up, select the configured metadata field name (eg _sourcecategory) or specify other custom metadata (eg: _collector) along with its metadata Field Value.
    2. Is K8S deployment involved. Specify if resources being monitored are partially or fully deployed on Kubernetes (K8s)
  6. Click Next. You will be redirected to the Preview & Done section.

Post-installation

Once your app is installed, it will appear in your Installed Apps folder, and dashboard panels will start to fill automatically.

Each panel slowly fills with data matching the time range query received since the panel was created. Results will not immediately be available but will be updated with full graphs and charts over time.

As part of the app installation process, the following fields will be created by default:

  • component
  • environment
  • messaging_system
  • messaging_cluster
  • pod

If you're using ActiveMQ in a Kubernetes environment, the following additional fields will be automatically created as a part of the app installation process:

  • pod_labels_component
  • pod_labels_environment
  • pod_labels_messaging_system
  • pod_labels_messaging_cluster

Viewing the ActiveMQ Dashboards

All dashboards have a set of filters that you can apply to the entire dashboard. Use these filters to drill down and examine the data to a granular level.

  • You can change the time range for a dashboard or panel by selecting a predefined interval from a drop-down list, choosing a recently used time range, or specifying custom dates and times. Learn more.
  • You can use template variables to drill down and examine the data on a granular level. For more information, see Filtering Dashboards with Template Variables.
  • Most Next-Gen apps allow you to provide the scope at the installation time and are comprised of a key (_sourceCategory by default) and a default value for this key. Based on your input, the app dashboards will be parameterized with a dashboard variable, allowing you to change the dataset queried by all panels. This eliminates the need to create multiple copies of the same dashboard with different queries.

Overview

The ActiveMQ - Overview dashboard gives you an at-a-glance view of your ActiveMQ deployment across brokers, queues, topics, and messages.

Use this dashboard to:

  • Analyze Memory and CPU utilization.
  • Gain insights into Enqueue messages for your ActiveMQ server.
  • Gain insights into Dequeue messages for your ActiveMQ server.
  • Determine node uptime, the number of nodes, connections, producer, consumer, queues, topics unack messages, across each cluster and ensure they match with expectations.
  • Analysis of near errors.
ActiveMQ dashboards

Brokers

The ActiveMQ - Brokers dashboard provides an at-a-glance view of the state of your brokers in the ActiveMQ cluster.

Use this dashboard to:

  • Monitor brokers uptime.
  • Analyze unacknowledged messages, serve connections for your ActiveMQ brokers..
  • Gain insights into the limit of resources for your ActiveMQ brokers.
  • Gain insights into enqueue rate, dequeue rate for your ActiveMQ brokers.
  • Determine the amount of current connections, producers, and consumers for your ActiveMQ brokers.
  • find average message size.
ActiveMQ dashboards

Queues

The ActiveMQ - Queues dashboard provides an at-a-glance view of the state of your queues in ActiveMQ clusters.

Use this dashboard to:

  • Monitor en queue latency, the memory usage of queues.
  • Monitor queues, producers on queues, consumers on queues.
  • Gain insights into en queue rate, dequeue rate for your ActiveMQ queues.
  • Determine the number of current connections, producers, consumers, errors, and expired messages on queues.
  • Find average message size on queues.
ActiveMQ dashboards

Topics

The ActiveMQ - Topics dashboard provides an at-a-glance view of the state of your topics in ActiveMQ clusters.

Use this dashboard to:

  • Monitor en queue latency, the memory usage of topics.
  • Determine the number of topics, producers on topics, consumers on topics.
  • Gain insights into en queue rate, dequeue rate for your ActiveMQ topics.
  • Analyze current connections, producers, consumers, errors, and expired messages on queues.
  • Find average message size on queues.
ActiveMQ dashboards

Resource Utilization

The ActiveMQ - Resource Utilization dashboard provides an at-a-glance view of the state of system loads in clusters: CPU usage, memory usage, Swap usage, file descriptor usage, garbage collection rate, heap, and non-heap usage.

Use this dashboard to:

  • Analyze memory, CPU, disk, swap, file descriptor utilization of nodes in clusters.
  • Gain insights into the garbage collection rate for your ActiveMQ nodes.
  • Gain insights into a heap, non-heap usage for your ActiveMQ nodes.
ActiveMQ dashboards

Logs

The ActiveMQ - Logs dashboard helps you quickly analyze your ActiveMQ error logs across all clusters.

Use this dashboard to:

  • Identify critical events in your ActiveMQ cluster.
  • Examine trends to detect spikes in Error or Fatal events
  • Monitor Broker added/started and shutdown events in your cluster.
  • Quickly determine patterns across all logs in a given ActiveMQ cluster.
ActiveMQ dashboards

Create monitors for ActiveMQ app

From your App Catalog:

  1. From the Sumo Logic navigation, select App Catalog.
  2. In the Search Apps field, search for and then select your app.
  3. Make sure the app is installed.
  4. Navigate to What's Included tab and scroll down to the Monitors section.
  5. Click Create next to the pre-configured monitors. In the create monitors window, adjust the trigger conditions and notifications settings based on your requirements.
  6. Scroll down to Monitor Details.
  7. Under Location click on New Folder.
    note

    By default, monitor will be saved in the root folder. So to make the maintenance easier, create a new folder in the location of your choice.

  8. Enter Folder Name. Folder Description is optional.
    tip

    Using app version in the folder name will be helpful to determine the versioning for future updates.

  9. Click Create. Once the folder is created, click on Save.

ActiveMQ alerts

Alert NameDescriptionAlert ConditionRecover Condition
ActiveMQ - High CPU Usage AlertThis alert gets triggered when there is high CPU usage on a node in a ActiveMQ cluster.Count >= 80Count < 80
ActiveMQ - High Memory Usage AlertThis alert gets triggered when there is high memory usage on a node in a ActiveMQ cluster.Count >= 80Count < 80
ActiveMQ - High Storage Used AlertThis alert gets triggered when there is high store usage on a node in a ActiveMQ cluster.Count >= 80Count < 80
ActiveMQ - Maximum Connection AlertThis alert gets triggered when one node in ActiveMQ cluster exceeds the maximum allowed client connection limit.Count >= 1Count < 1
ActiveMQ - No Consumers on Queues AlertThis alert gets triggered when a ActiveMQ queue has no consumers.Count < 1Count >= 1
ActiveMQ - Node Down AlertThis alert gets triggered when a node in the ActiveMQ cluster is down.Count >= 1Count < 1
ActiveMQ - Too Many Connections AlertThis alert gets triggered when there are too many connections to a node in a ActiveMQ cluster.Count >= 1000Count < 1000
Status
Legal
Privacy Statement
Terms of Use

Copyright © 2025 by Sumo Logic, Inc.