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

No subscription metrics for non persistent topic consumer #13645

Closed
dragonls opened this issue Jan 6, 2022 · 2 comments · Fixed by #13827
Closed

No subscription metrics for non persistent topic consumer #13645

dragonls opened this issue Jan 6, 2022 · 2 comments · Fixed by #13827
Labels
type/bug The PR fixed a bug or issue reported a bug

Comments

@dragonls
Copy link
Contributor

dragonls commented Jan 6, 2022

Describe the bug
It seems that there are no subscription throughput out metrics for non persistent topic consumer, which make it hard to know whether the consumers are working fine.

I tried to produce and consumer a non persistent topic. The metrics pulsar_subscription_msg_throughput_out and pulsar_throughput_out are always 0 for non persistent topics, but work correctly for persistent topics.

To Reproduce
Steps to reproduce the behavior:

  1. Create a non persistent topic
  2. Try to produce and consume the topic
  3. See the metrics pulsar_subscription_msg_throughput_out and pulsar_throughput_out

Expected behavior
See the throughput out of the topic and each subscription.

Screenshots
image
image

Additional context
Pulsar version: 2.7.2

@mattisonchao
Copy link
Member

i can work on it.

@tongsucn
Copy link
Contributor

tongsucn commented Jan 13, 2022

i can work on it.

@mattisonchao Hi, the problem still exists on Pulsar 2.8.2.

I think the problem locates at org.apache.pulsar.common.policies.data.stats.NonPersistentTopicStatsImpl. It owns a map object subscriptions which "overwrites" the parents' one.

In org.apache.pulsar.broker.service.nonpersistent.NonPersistentTopic.getStats, subscription information are updated to NonPersistentTopicStatsImpl.subscriptions rather than TopicStatsImpl.subscriptions.

But org.apache.pulsar.broker.stats.prometheus.NamespaceStatsAggregator.getTopicStats uses TopicStatsImpl.subscriptions to generate Prometheus metrics.

The problem also exists on publishers list and replication map in NonPersistentTopicStatsImpl. Please also pay attention to NonPersistentTopicStatsImpl.msgDropRate, which is a very important metric for non-persistent topic, you may need to add new Prometheus metric like pulsar_subscription_msg_drop_rate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug The PR fixed a bug or issue reported a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants