Stephanie0002 opened a new issue, #8223:
URL: https://github.com/apache/rocketmq/issues/8223

   ### Is Your Feature Request Related to a Problem?
   
   The existing observable system of this project lacks broker-side monitoring 
of the number of topic and subscription group.
   
   ### Describe the Solution You'd Like
   
   Add two metrics rocketmq_active_topic_number and 
rocketmq_active_subscription_number as following: 
   
   | Type      | Name   | Unit    | Description   | Label    |
   | --------- | -------------- | ----------- |-----------| ------- |
   | Gauge     | rocketmq_active_topic_number           | count       | The 
number of current topics    | cluster,node_type,node_id    |
   | Gauge     | rocketmq_active_subscription_number    | count       | The 
number of current subscription group   | cluster,node_type,node_id   |
   
   
   ### Describe Alternatives You've Considered
   
   1. **Anticipated use of gauge type metric**
   Gauge: A metric that can be incremented or decremented, used to describe the 
current state of a particular indicator, such as the remaining system memory.
   
   2. **Add metric variables to the BrokerMetricsManager class**: 
`activeTopicNum`, `activeSubGroupNum`
   
   3. **Add corresponding constants to the BrokerMetricsConstant class**
   
   4. **Build corresponding metrics inside the `initStatsMetrics` method of the 
BrokerMetricsManager class**
   
   5. **Write a gauge update callback function that refreshes periodically**
      a. Call 
`this.brokerController.topicConfigManager.getTopicConfigTable().size()` to 
retrieve the number of topics.
      b. Call 
`brokerController.getSubscriptionGroupManager().getSubscriptionGroupTable().size()`
 to obtain the number of subscription groups.
   
   ### Additional Context
   
   _No response_


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@rocketmq.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to