---
title: ActiveMQ
description: Collect metrics for brokers and queues, producers and consumers, and more.
breadcrumbs: Docs > Integrations > ActiveMQ
---

# ActiveMQ
Supported OS Integration version5.3.0
## Overview{% #overview %}

The ActiveMQ check collects metrics for brokers, queues, producers, consumers, and more.

**Note:** This check also supports ActiveMQ Artemis (future ActiveMQ version `6`) and reports metrics under the `activemq.artemis` namespace. See the Metrics section for a list of available metrics.

**Note**: If you are running an ActiveMQ version older than 5.8.0, see the [Agent 5.10.x released sample files](https://raw.githubusercontent.com/DataDog/dd-agent/5.10.1/conf.d/activemq.yaml.example).

**Minimum Agent version:** 6.0.0

## Setup{% #setup %}

### Installation{% #installation %}

The Agent's ActiveMQ check is included in the [Datadog Agent](https://app.datadoghq.com/account/settings/agent/latest) package, so you don't need to install anything else on your ActiveMQ nodes.

The check collects metrics from JMX with [JMXFetch](https://github.com/DataDog/jmxfetch). A JVM is needed on each node so the Agent can run JMXFetch. Datadog recommends using an Oracle-provided JVM.

### Configuration{% #configuration %}

{% tab title="Host" %}
#### Host{% #host %}

To configure this check for an Agent running on a host:

1. **Make sure that [JMX Remote is enabled](https://activemq.apache.org/jmx.html) on your ActiveMQ server.**

1. Configure the Agent to connect to ActiveMQ. Edit `activemq.d/conf.yaml`, in the `conf.d/` folder at the root of your [Agent's configuration directory](https://docs.datadoghq.com/agent/guide/agent-configuration-files/#agent-configuration-directory). See the [sample activemq.d/conf.yaml](https://github.com/DataDog/integrations-core/blob/master/activemq/datadog_checks/activemq/data/conf.yaml.example) for all available configuration options. See the [`metrics.yaml` file](https://github.com/DataDog/integrations-core/blob/master/activemq/datadog_checks/activemq/data/metrics.yaml) for the list of default collected metrics.

   ```yaml
   init_config:
     is_jmx: true
     collect_default_metrics: true
   
   instances:
     - host: localhost
       port: 1616
       user: username
       password: password
       name: activemq_instance
   ```

1. [Restart the agent](https://docs.datadoghq.com/agent/guide/agent-commands/#start-stop-and-restart-the-agent)

##### Log collection{% #log-collection %}

*Available for Agent versions >6.0*

1. Collecting logs is disabled by default in the Datadog Agent, enable it in your `datadog.yaml` file:

   ```yaml
   logs_enabled: true
   ```

1. Add this configuration block to your `activemq.d/conf.yaml` file to start collecting your ActiveMQ logs:

   ```yaml
   logs:
     - type: file
       path: "<ACTIVEMQ_BASEDIR>/data/activemq.log"
       source: activemq
       service: "<SERVICE_NAME>"
     - type: file
       path: "<ACTIVEMQ_BASEDIR>/data/audit.log"
       source: activemq
       service: "<SERVICE_NAME>"
   ```

1. [Restart the Agent](https://docs.datadoghq.com/agent/guide/agent-commands/#start-stop-and-restart-the-agent).

{% /tab %}

{% tab title="Containerized" %}
#### Containerized{% #containerized %}

For containerized environments, see the [Autodiscovery Integration Templates](https://docs.datadoghq.com/containers/guide/autodiscovery-with-jmx/?tab=containeragent) for guidance on applying the parameters below.

##### Metric collection{% #metric-collection %}

| Parameter            | Value                                |
| -------------------- | ------------------------------------ |
| `<INTEGRATION_NAME>` | `activemq`                           |
| `<INIT_CONFIG>`      | `"is_jmx": true`                     |
| `<INSTANCE_CONFIG>`  | `{"host": "%%host%%","port":"1099"}` |

##### Log collection{% #log-collection %}

*Available for Agent versions >6.0*

Collecting logs is disabled by default in the Datadog Agent. To enable it, see [Kubernetes Log Collection](https://docs.datadoghq.com/agent/kubernetes/log/).

| Parameter      | Value                                                  |
| -------------- | ------------------------------------------------------ |
| `<LOG_CONFIG>` | `{"source": "activemq", "service": "<YOUR_APP_NAME>"}` |

{% /tab %}

### Validation{% #validation %}

[Run the Agent's status subcommand](https://docs.datadoghq.com/agent/guide/agent-commands/#agent-status-and-information) and look for `activemq` under the Checks section.

## Data Collected{% #data-collected %}

### Metrics{% #metrics %}

|  |
|  |
| **activemq.artemis.address.bytes\_per\_page**(gauge)     | (Artemis only) Number of bytes used by each page for this address.*Shown as byte*                                                                       |
| **activemq.artemis.address.number\_of\_messages**(rate)  | (Artemis only) The sum of messages on queue(s), including messages in delivery.*Shown as message*                                                       |
| **activemq.artemis.address.pages\_count**(gauge)         | (Artemis only) Number of pages used by this address.*Shown as page*                                                                                     |
| **activemq.artemis.address.routed\_messages**(rate)      | (Artemis only) Number of messages routed to one or more bindings, as a rate.*Shown as message*                                                          |
| **activemq.artemis.address.size**(gauge)                 | (Artemis only) Number of estimated bytes being used by all the queue(s) bound to this address; used to control paging and blocking.*Shown as byte*      |
| **activemq.artemis.address.unrouted\_messages**(rate)    | (Artemis only) Number of messages not routed to any bindings, as a rate.*Shown as message*                                                              |
| **activemq.artemis.address\_memory\_usage**(gauge)       | (Artemis only) Memory used by all the addresses on broker for in-memory messages.*Shown as byte*                                                        |
| **activemq.artemis.address\_memory\_usage\_pct**(gauge)  | (Artemis only) Memory used by all the addresses on broker as a percentage of the global-max-size.*Shown as percent*                                     |
| **activemq.artemis.connection\_count**(gauge)            | (Artemis only) Number of clients connected to this server.*Shown as connection*                                                                         |
| **activemq.artemis.disk\_store\_usage\_pct**(gauge)      | (Artemis only) Percentage of total disk store used.*Shown as percent*                                                                                   |
| **activemq.artemis.max\_disk\_usage**(gauge)             | (Artemis only) Maximum limit for disk use in percentage.*Shown as percent*                                                                              |
| **activemq.artemis.queue.consumer\_count**(gauge)        | (Artemis only) Number of consumers consuming messages from this queue.                                                                                  |
| **activemq.artemis.queue.max\_consumers**(gauge)         | (Artemis only) Maximum number of consumers allowed on this queue at any one time.                                                                       |
| **activemq.artemis.queue.message\_count**(gauge)         | (Artemis only) Number of messages currently in this queue (includes scheduled, paged, and in-delivery messages), as a rate.*Shown as message*           |
| **activemq.artemis.queue.messages\_acknowledged**(rate)  | (Artemis only) Number of messages acknowledged from this queue since it was created, as a rate.*Shown as message*                                       |
| **activemq.artemis.queue.messages\_added**(rate)         | (Artemis only) Number of messages added to this queue since it was created, as a rate.*Shown as message*                                                |
| **activemq.artemis.queue.messages\_expired**(rate)       | (Artemis only) Number of messages expired from this queue since it was created, as a rate.*Shown as message*                                            |
| **activemq.artemis.queue.messages\_killed**(rate)        | (Artemis only) Number of messages removed from this queue since it was created due to exceeding the max delivery attempts, as a rate.*Shown as message* |
| **activemq.artemis.total\_connection\_count**(rate)      | (Artemis only) Number of clients which have connected to this server since it was started, as a rate.*Shown as connection*                              |
| **activemq.artemis.total\_consumer\_count**(rate)        | (Artemis only) Number of consumers consuming messages from all the queues on this server, as a rate.                                                    |
| **activemq.artemis.total\_message\_count**(rate)         | (Artemis only) Number of messages in all queues on the server, as a rate.*Shown as connection*                                                          |
| **activemq.artemis.total\_messages\_acknowledged**(rate) | (Artemis only) Number of messages acknowledged from all the queues on this server since it was started, as a rate.*Shown as connection*                 |
| **activemq.artemis.total\_messages\_added**(rate)        | (Artemis only) Number of messages sent to this server since it was started, as a rate.*Shown as connection*                                             |
| **activemq.broker.memory\_pct**(gauge)                   | The percentage of memory in use.*Shown as percent*                                                                                                      |
| **activemq.broker.store\_pct**(gauge)                    | The percentage of store in use.*Shown as percent*                                                                                                       |
| **activemq.broker.temp\_pct**(gauge)                     | The percentage of temporary in use.*Shown as percent*                                                                                                   |
| **activemq.queue.avg\_enqueue\_time**(gauge)             | On average the amount of time (ms) that messages remained enqueued.*Shown as millisecond*                                                               |
| **activemq.queue.consumer\_count**(gauge)                | The number of consumers connected.                                                                                                                      |
| **activemq.queue.dequeue\_count**(gauge)                 | The rate of messages that are being dequeued.*Shown as message*                                                                                         |
| **activemq.queue.dispatch\_count**(gauge)                | The rate of messages that are being dispatched.*Shown as message*                                                                                       |
| **activemq.queue.enqueue\_count**(gauge)                 | The rate of messages that are being enqueued.*Shown as message*                                                                                         |
| **activemq.queue.expired\_count**(gauge)                 | The rate of messages that are becoming expired.*Shown as message*                                                                                       |
| **activemq.queue.in\_flight\_count**(gauge)              | The rate of messages that are becoming in flight.*Shown as message*                                                                                     |
| **activemq.queue.max\_enqueue\_time**(gauge)             | The max the amount of time (ms) that messages remained enqueued.*Shown as millisecond*                                                                  |
| **activemq.queue.memory\_pct**(gauge)                    | The percentage of memory currently in use.*Shown as percent*                                                                                            |
| **activemq.queue.min\_enqueue\_time**(gauge)             | The min the amount of time (ms) that messages remained enqueued.*Shown as millisecond*                                                                  |
| **activemq.queue.producer\_count**(gauge)                | The number of producers connected.                                                                                                                      |
| **activemq.queue.size**(gauge)                           | The amount of messages that remained queued.*Shown as message*                                                                                          |

### Events{% #events %}

The ActiveMQ check does not include any events.

### Service Checks{% #service-checks %}

**activemq.can\_connect**

Returns `CRITICAL` if the Agent is unable to connect to and collect metrics from the monitored ActiveMQ instance, `WARNING` if no metrics are collected, and `OK` otherwise.

*Statuses: ok, critical, warning*

## Troubleshooting{% #troubleshooting %}

Need help? Contact [Datadog support](https://docs.datadoghq.com/help/).

## Further Reading{% #further-reading %}

- [ActiveMQ architecture and key metrics](https://www.datadoghq.com/blog/activemq-architecture-and-metrics)
- [ActiveMQ blog](https://www.datadoghq.com/blog/monitor-activemq-metrics-performance)
