The Apache ActiveMQ integration 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 activemq.apache.org/.
Prerequisites
To collect and ingest ActiveMQ metrics, you must install Ops Agent version 2.11.0 or higher.
You must enable JMX support in the broker configuration.
This receiver supports the following Apache ActiveMQ versions:
ActiveMQ Classic versions 5.8.x through 5.16.x.
ActiveMQ Artemis version 2.x.
Configure the Ops Agent for ActiveMQ
Following the guide for Configuring the Ops Agent, add the required elements to collect metrics from your ActiveMQ instances, and restart the agent.
Example configuration
The following command creates the configuration file to collect and ingest metrics for ActiveMQ and restarts the Ops Agent on Linux.
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
Configure metrics collection
To collect metrics from ActiveMQ, you must create a receiver for ActiveMQ metrics and then create a pipeline for the new receiver. To configure a receiver for your ActiveMQ metrics, specify the following fields:
Field | Default | Description |
---|---|---|
type |
This value must be activemq . |
|
endpoint |
http://localhost:1099 |
The URL of the node to monitor. |
username |
The configured username if JMX is configured to require authentication. | |
password |
The configured password if JMX is configured to require authentication. | |
collection_interval |
60s |
A time.Duration value, such as 30s or 5m . |
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
|
|
GAUGE , INT64 gce_instance |
|
workload.googleapis.com/activemq.consumer.count
|
|
GAUGE , INT64 gce_instance |
broker
destination
|
workload.googleapis.com/activemq.disk.store_usage
|
|
GAUGE , DOUBLE gce_instance |
|
workload.googleapis.com/activemq.disk.temp_usage
|
|
GAUGE , DOUBLE gce_instance |
|
workload.googleapis.com/activemq.memory.usage
|
|
GAUGE , DOUBLE gce_instance |
broker
destination
|
workload.googleapis.com/activemq.message.current
|
|
GAUGE , INT64 gce_instance |
broker
destination
|
workload.googleapis.com/activemq.message.dequeued
|
|
CUMULATIVE , INT64 gce_instance |
broker
destination
|
workload.googleapis.com/activemq.message.enqueued
|
|
CUMULATIVE , INT64 gce_instance |
broker
destination
|
workload.googleapis.com/activemq.message.expired
|
|
CUMULATIVE , INT64 gce_instance |
broker
destination
|
workload.googleapis.com/activemq.message.wait_time.avg
|
|
GAUGE , DOUBLE gce_instance |
broker
destination
|
workload.googleapis.com/activemq.producer.count
|
|
GAUGE , INT64 gce_instance |
broker
destination
|
Collect logs
ActiveMQ writes logs to syslog
, which is captured by Ops Agent by default.
No additional user configuration is required.
Sample dashboard
You can view the metrics from this integration using a sample Cloud Monitoring dashboard. Complete the Installing sample dashboards procedures to import the ActiveMQ GCE Overview dashboard from the Sample library and view charts that display your ActiveMQ metrics.Verify the ingestion
To verify the logs are ingested, go to the Logs Explorer
and run the following query to view the ActiveMQ logs, replacing
activemq
with your system unit name for ActiveMQ if needed:
resource.type="gce_instance"
logName="projects/PROJECT_ID/logs/syslog"
activemq
You can use the Metrics Explorer to verify that you correctly configured the ActiveMQ metrics receiver. It might take one or two minutes for the Ops Agent to begin collecting metrics.
To verify 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.connection.count'
| align rate(1m)
| every 1m