Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Add two metrics rocketmq_active_topic_number and rocketmq_active_subscription_number #8223

Closed
Stephanie0002 opened this issue May 29, 2024 · 1 comment · Fixed by #8225

Comments

@Stephanie0002
Copy link
Contributor

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

@humkum
Copy link
Contributor

humkum commented May 30, 2024

Here you can only get the total number of topics and subscription groups, but cannot determine whether these topics and subscription groups are active. Would it be more accurate to call it rocketmq_total_topic_number & rocketmq_total_subscription_number?

RongtongJin pushed a commit that referenced this issue May 31, 2024
…umer_group_number (#8225)

* Add tow metric createTopicTime and createSubscriptionTime in broker

* roll back BrokerConfig.java

* Add metric view of createTopicTime and createSubscriptionTime in broker

* Add two metric rocketmq_active_topic_number and rocketmq_active_subscription_number

* Add two metric rocketmq_active_topic_number and rocketmq_active_subscription_number

Signed-off-by: 黄梓淇 <[email protected]>

---------

Signed-off-by: 黄梓淇 <[email protected]>
Co-authored-by: 黄梓淇 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants