Apache ActiveMQ Stay organized with collections Save and categorize content based on your preferences.
This document describes how to configure your Google Kubernetes Engine deploymentso that you can use Google Cloud Managed Service for Prometheus to collect metrics fromApache ActiveMQ. This document shows you how to do the following:
- Set up the exporter for ActiveMQ to report metrics.
- Access a predefined dashboard in Cloud Monitoring to view the metrics.
- Configure alerting rules to monitor the metrics.
These instructions apply only if you are usingmanaged collectionwith Managed Service for Prometheus.If you are using self-deployed collection, then see thesource repositoryfor the JMX exporterfor installation information.
These instructions are provided as an example and are expected to work inmost Kubernetes environments.If you are having trouble installing anapplication or exporter due to restrictive security or organizational policies,then we recommend you consult open-source documentation for support.
For information about Apache ActiveMQ, seeActiveMQ.
Prerequisites
To collect metrics fromActiveMQby usingManaged Service for Prometheus and managed collection, your deployment mustmeet the following requirements:
- Your cluster must be running Google Kubernetes Engine version 1.28.15-gke.2475000 or later.
- You must be running Managed Service for Prometheus with managed collection enabled. For more information, see Get started with managed collection.
- To use dashboards available in Cloud Monitoring for the ActiveMQ integration, you must use
jmx-exporterversion 0.17.0 or later.For more information about available dashboards, seeView dashboards.
ACTIVEMQ_JMX andACTIVEMQ_OPTS environment variables.Install the ActiveMQ exporter
We recommend that you install the ActiveMQ exporter,jmx-exporter,as a sidecar to your ActiveMQ workload.For information about using sidecars, seeExtended applications on Kubernetes with multi-containerpods.
To installjmx-exporter as a sidecar to ActiveMQ,modify your ActiveMQ configuration as shown in the followingexample:
#Copyright2022GoogleLLC##LicensedundertheApacheLicense,Version2.0(the"License");#youmaynotusethisfileexceptincompliancewiththeLicense.#YoumayobtainacopyoftheLicenseat##https://www.apache.org/licenses/LICENSE-2.0##Unlessrequiredbyapplicablelaworagreedtoinwriting,software#distributedundertheLicenseisdistributedonan"AS IS"BASIS,#WITHOUTWARRANTIESORCONDITIONSOFANYKIND,eitherexpressorimplied.#SeetheLicenseforthespecificlanguagegoverningpermissionsand#limitationsundertheLicense.apiVersion:v1kind:ConfigMapmetadata:name:activemq-exporterdata:config.yaml:|hostPort:localhost:1099lowercaseOutputName:truelowercaseOutputLabelNames:trueblacklistObjectNames:-"org.apache.activemq:clientId=*,*"whitelistObjectNames:-"org.apache.activemq:destinationType=Queue,*"-"org.apache.activemq:destinationType=Topic,*"-"org.apache.activemq:type=Broker,brokerName=*"-"org.apache.activemq:type=Topic,brokerName=*"rules:-pattern:org.apache.activemq<type=Broker,brokerName=(\S*),destinationType=Queue,destinationName=(\S*)><>(\w+)name:activemq_queue_$3attrNameSnakeCase:truelabels:destination:$2-pattern:org.apache.activemq<type=Broker,brokerName=(\S*),destinationType=Topic,destinationName=(\S*)><>(\w+)name:activemq_topic_$3attrNameSnakeCase:truelabels:destination:$2-pattern:org.apache.activemq<type=Broker,brokerName=(\S*)><>CurrentConnectionsCountname:activemq_connectionstype:GAUGE-pattern:org.apache.activemq<type=Broker,brokerName=(\S*)><>Total(.*)Countname:activemq_$2_totaltype:COUNTER-pattern:org.apache.activemq<type=Broker,brokerName=(\S*)><>(.*)PercentUsagename:activemq_$2_usage_ratiotype:GAUGEvalueFactor:0.01---apiVersion:apps/v1kind:Deploymentmetadata:name:activemqspec:selector:matchLabels:+app.kubernetes.io/name:activemqtemplate:metadata:labels:+app.kubernetes.io/name:activemqspec:containers:-name:activemqimage:rmohr/activemq:5.15.9-alpine+ports:+-containerPort:1099+name:jmx+env:+-name:ACTIVEMQ_JMX+value:"1099"+-name:ACTIVEMQ_OPTS+value:"-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=1099 -Dcom.sun.management.jmxremote.rmi.port=1099 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false"+-name:exporter+image:bitnami/jmx-exporter:0.17.0+command:+-java+--jar+-jmx_prometheus_httpserver.jar+args:+-"9000"+-config.yaml+ports:+-containerPort:9000+name:prometheus+volumeMounts:+-mountPath:/opt/bitnami/jmx-exporter/config.yaml+subPath:config.yaml+name:activemq-exporter+volumes:+-name:activemq-exporter+configMap:+name:activemq-exporter+items:+-key:config.yaml+path:config.yamlYou must add any lines preceded by the+ symbol to yourconfiguration.
To apply configuration changes from a local file, run the following command:
kubectl apply -nNAMESPACE_NAME -fFILE_NAME
You can alsouse Terraformto manage your configurations.
Define a PodMonitoring resource
For target discovery, the Managed Service for Prometheus Operatorrequires a PodMonitoring resource that corresponds tothe JMX exporter in the same namespace.
You can use the following PodMonitoring configuration:
# Copyright 2022 Google LLC## Licensed under the Apache License, Version 2.0 (the "License");# you may not use this file except in compliance with the License.# You may obtain a copy of the License at## https://www.apache.org/licenses/LICENSE-2.0## Unless required by applicable law or agreed to in writing, software# distributed under the License is distributed on an "AS IS" BASIS,# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.# See the License for the specific language governing permissions and# limitations under the License.apiVersion:monitoring.googleapis.com/v1kind:PodMonitoringmetadata:name:activemqlabels:app.kubernetes.io/name:activemqapp.kubernetes.io/part-of:google-cloud-managed-prometheusspec:endpoints:-port:prometheusscheme:httpinterval:30spath:/metricsselector:matchLabels:app.kubernetes.io/name:activemqEnsure that the label selectors and the port match the selectors and portused inInstall the ActiveMQ exporter.
To apply configuration changes from a local file, run the following command:
kubectl apply -nNAMESPACE_NAME -fFILE_NAME
You can alsouse Terraformto manage your configurations.
Define rules and alerts
You can use the followingRules configuration to definealerts on your ActiveMQ metrics:
# Copyright 2022 Google LLC## Licensed under the Apache License, Version 2.0 (the "License");# you may not use this file except in compliance with the License.# You may obtain a copy of the License at## https://www.apache.org/licenses/LICENSE-2.0## Unless required by applicable law or agreed to in writing, software# distributed under the License is distributed on an "AS IS" BASIS,# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.# See the License for the specific language governing permissions and# limitations under the License.apiVersion:monitoring.googleapis.com/v1kind:Rulesmetadata:name:activemq-ruleslabels:app.kubernetes.io/component:rulesapp.kubernetes.io/name:activemq-rulesapp.kubernetes.io/part-of:google-cloud-managed-prometheusspec:groups:-name:activemqinterval:30srules:-alert:ActiveMQNoConnectionsannotations:description:|-ActiveMQ no connectionsVALUE = {{ $value }}LABELS: {{ $labels }}summary:ActiveMQ down (instance {{ $labels.instance }})expr:activemq_connections_total{job="activemq"} == 0for:5mlabels:severity:warning-alert:ActiveMQHighStoreUsageannotations:description:|-ActiveMQ high store usageVALUE = {{ $value }}LABELS: {{ $labels }}summary:ActiveMQ high store usage (instance {{ $labels.instance }})expr:activemq_store_usage_ratio{job="activemq"} > 0.9for:5mlabels:severity:warning-alert:ActiveMQHighTempStoreUsageannotations:description:|-ActiveMQ high temp store usageVALUE = {{ $value }}LABELS: {{ $labels }}summary:ActiveMQ high temp store usage (instance {{ $labels.instance }})expr:activemq_temp_usage_ratio{job="activemq"} > 0.9for:5mlabels:severity:warningTo apply configuration changes from a local file, run the following command:
kubectl apply -nNAMESPACE_NAME -fFILE_NAME
You can alsouse Terraformto manage your configurations.
For more information about applying rules to your cluster, seeManaged rule evaluation and alerting.
Verify the configuration
You can use Metrics Explorer to verify that you correctly configuredthe JMX exporter. It might take one or two minutes forCloud Monitoring to ingest your metrics.
To verify the metrics are ingested, do the following:
In the Google Cloud console, go to theleaderboard Metrics explorer page:
If you use the search bar to find this page, then select the result whose subheading isMonitoring.
- In the toolbar of thequery-builder pane, select the button whose name is eithercode MQL orcode PromQL.
- Verify thatPromQL is selectedin theLanguage toggle. The language toggle is in the same toolbar thatlets you format your query.
- Enter and run the following query:
up{job="activemq", cluster="CLUSTER_NAME", namespace="NAMESPACE_NAME"}
View dashboards
The Cloud Monitoring integration includestheActiveMQ Prometheus Overview dashboard.Dashboards are automatically installed when you configure the integration.You can also view static previews of dashboards without installing theintegration.
To view an installed dashboard, do the following:
In the Google Cloud console, go to the Dashboards page:
If you use the search bar to find this page, then select the result whose subheading isMonitoring.
- Select theDashboard List tab.
- Choose theIntegrations category.
- Click the name of the dashboard, for example,ActiveMQ Prometheus Overview.
To view a static preview of the dashboard, do the following:
In the Google Cloud console, go to the
Integrations page:If you use the search bar to find this page, then select the result whose subheading isMonitoring.
- Click theKubernetes Engine deployment-platform filter.
- Locate the Apache ActiveMQ integration and clickView Details.
- Select theDashboards tab.
Troubleshooting
For information about troubleshooting metric ingestion problems, seeProblems with collection from exporters inTroubleshooting ingestion-side problems.
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-02-19 UTC.