---
rules:
  - beans:
      - org.apache.activemq:type=Broker,brokerName=*,destinationType=Queue,destinationName=*
      - org.apache.activemq:type=Broker,brokerName=*,destinationType=Topic,destinationName=*
    metricAttribute:
      destination: param(destinationName)
      broker: param(brokerName)
    prefix: activemq.
    mapping:
      ProducerCount:
        unit: "{producers}"
        type: updowncounter
        desc: The number of producers attached to this destination
      ConsumerCount:
        unit: "{consumers}"
        type: updowncounter
        desc: The number of consumers subscribed to this destination
      MemoryPercentUsage:
        metric: memory.MemoryPercentUsage
        unit: "%"
        type: gauge
        desc: The percentage of configured memory used
      QueueSize:
        metric: message.QueueSize
        unit: "{messages}"
        type: updowncounter
        desc: The current number of messages waiting to be consumed
      ExpiredCount:
        metric: message.ExpiredCount
        unit: "{messages}"
        type: counter
        desc: The number of messages not delivered because they expired
      EnqueueCount:
        metric: message.EnqueueCount
        unit: "{messages}"
        type: counter
        desc: The number of messages sent to this destination
      DequeueCount:
        metric: message.DequeueCount
        unit: "{messages}"
        type: counter
        desc: The number of messages acknowledged and removed from this destination
      AverageEnqueueTime:
        metric: message.AverageEnqueueTime
        unit: ms
        type: gauge
        desc: The average time a message was held on this destination

  - bean: org.apache.activemq:type=Broker,brokerName=*
    metricAttribute:
      broker: param(brokerName)
    prefix: activemq.
    unit: "%"
    type: gauge
    mapping:
      CurrentConnectionsCount:
        metric: connections.CurrentConnectionsCount
        type: updowncounter
        unit: "{connections}"
        desc: The total number of current connections
      StorePercentUsage:
        metric: disc.StorePercentUsage
        desc: The percentage of configured disk used for persistent messages
      TempPercentUsage:
        metric: disc.TempPercentUsage
        desc: The percentage of configured disk used for non-persistent messages
