Apache ActiveMQ

Stay organized with collections Save and categorize content based on your preferences.

The Apache ActiveMQ integration writes logs and collects storage usage and message metrics. Storage metrics include memory and disk usage. Message metrics include number of waiting messages, average wait time, and expired messages.

For more information about ActiveMQ, see the Apache ActiveMQ documentation.

Prerequisites

To collect ActiveMQ telemetry, you must install the Ops Agent:

  • For metrics, install version 2.11.0 or higher.
  • For logs, install version 2.15.0 or higher.

You must also enable JMX support in the ActiveMQ broker configuration.

This integration supports the following ActiveMQ versions:

  • Classic 5.8.x through 5.16.x
  • Artemis 2.x.

Configure the Ops Agent for ActiveMQ

Following the guide for Configuring the Ops Agent, add the required elements to collect telemetry from ActiveMQ instances, and restart the agent.

Example configuration

The following command creates the configuration to collect and ingest telemetry for ActiveMQ and restarts the Ops Agent.

# Configures Ops Agent to collect telemetry from the app and restart Ops Agent.

set -e

sudo tee /etc/google-cloud-ops-agent/config.yaml > /dev/null << EOF
metrics:
  receivers:
    activemq:
      type: activemq
  service:
    pipelines:
      activemq:
        receivers:
          - activemq
EOF

sudo service google-cloud-ops-agent restart

Collect logs

ActiveMQ writes logs to syslog, which is captured by the Ops Agent by default. No additional user configuration is required.

Configure metrics collection

To ingest metrics from ActiveMQ, you must create receivers for the metrics that ActiveMQ produces and then create a pipeline for the new receivers.

To configure a receiver for your activemq metrics, specify the following fields:

Field Default Description
collection_interval 60s A time.Duration value, such as 30s or 5m.
endpoint http://localhost:1099 The URL of the node to monitor.
password The configured password if JMX is configured to require authentication.
type This value must be activemq.
username The configured username if JMX is configured to require authentication.

What is monitored

The following table provides the list of metrics that the Ops Agent collects from the ActiveMQ instance.

Metric type 
Kind, Type
Monitored resources
Labels
workload.googleapis.com/activemq.connection.count
GAUGEINT64
gce_instance
 
workload.googleapis.com/activemq.consumer.count
GAUGEINT64
gce_instance
broker
destination
workload.googleapis.com/activemq.disk.store_usage
GAUGEDOUBLE
gce_instance
 
workload.googleapis.com/activemq.disk.temp_usage
GAUGEDOUBLE
gce_instance
 
workload.googleapis.com/activemq.memory.usage
GAUGEDOUBLE
gce_instance
broker
destination
workload.googleapis.com/activemq.message.current
GAUGEINT64
gce_instance
broker
destination
workload.googleapis.com/activemq.message.dequeued
CUMULATIVEINT64
gce_instance
broker
destination
workload.googleapis.com/activemq.message.enqueued
CUMULATIVEINT64
gce_instance
broker
destination
workload.googleapis.com/activemq.message.expired
CUMULATIVEINT64
gce_instance
broker
destination
workload.googleapis.com/activemq.message.wait_time.avg
GAUGEDOUBLE
gce_instance
broker
destination
workload.googleapis.com/activemq.producer.count
GAUGEINT64
gce_instance
broker
destination

Sample dashboard

To view your ActiveMQ metrics, you must have a chart or dashboard configured. Cloud Monitoring provides a library of sample dashboards for integrations, which contain preconfigured charts. For information about installing these dashboards, see Installing sample dashboards.

Verify the configuration

This section describes how to verify that you correctly configured the ActiveMQ receiver. It might take one or two minutes for the Ops Agent to begin collecting telemetry.

To verify that the logs are ingested, go to the Logs Explorer and run the following query to view the ActiveMQ logs:

resource.type="gce_instance"
log_id("syslog")
jsonPayload.message~='(activemq\[[0-9]+\]|activemq):'

To verify that the metrics are ingested, go to Metrics Explorer and run the following query in the MQL tab:

fetch gce_instance
| metric 'workload.googleapis.com/activemq.consumer.count'
| every 1m

What's next

For a walkthrough on how to use Ansible to install the Ops Agent, configure a third-party application, and install a sample dashboard, see the Install the Ops Agent to troubleshoot third-party applications video.