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

[improve][broker] Add msgInReplay subscription stat and metric to improve Key_Shared observability #23224

Merged
merged 1 commit into from
Aug 29, 2024

Conversation

lhotari
Copy link
Member

@lhotari lhotari commented Aug 26, 2024

Main Issue: #23205

Motivation

Currently there aren't ways to observe the number of messages that are "in replay" with Key_Shared or Shared subscriptions. Having these metrics would make it easier to understand the behavior of issues such as #23200 .
Please check #23205 for more reasons.

Modifications

  • add msgInReplay in the similar way as the existing msgDelayed subscription stat and metric.

Documentation

  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

@lhotari lhotari added type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages area/metrics labels Aug 26, 2024
@lhotari lhotari added this to the 4.0.0 milestone Aug 26, 2024
@github-actions github-actions bot added the doc-required Your PR changes impact docs and you will update later. label Aug 26, 2024
@codecov-commenter
Copy link

codecov-commenter commented Aug 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.54%. Comparing base (bbc6224) to head (d6d08be).
Report is 546 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #23224      +/-   ##
============================================
+ Coverage     73.57%   74.54%   +0.96%     
- Complexity    32624    34226    +1602     
============================================
  Files          1877     1922      +45     
  Lines        139502   144768    +5266     
  Branches      15299    15832     +533     
============================================
+ Hits         102638   107916    +5278     
+ Misses        28908    28578     -330     
- Partials       7956     8274     +318     
Flag Coverage Δ
inttests 27.66% <28.57%> (+3.08%) ⬆️
systests 24.69% <28.57%> (+0.36%) ⬆️
unittests 73.90% <100.00%> (+1.05%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
...ervice/persistent/MessageRedeliveryController.java 95.38% <100.00%> (+0.38%) ⬆️
...sistent/PersistentDispatcherMultipleConsumers.java 73.37% <100.00%> (-0.96%) ⬇️
...ker/service/persistent/PersistentSubscription.java 77.54% <100.00%> (+0.85%) ⬆️
...ker/stats/prometheus/AggregatedNamespaceStats.java 100.00% <100.00%> (ø)
.../stats/prometheus/AggregatedSubscriptionStats.java 100.00% <ø> (ø)
...ker/stats/prometheus/NamespaceStatsAggregator.java 94.24% <100.00%> (+3.83%) ⬆️
...che/pulsar/broker/stats/prometheus/TopicStats.java 98.42% <100.00%> (+4.22%) ⬆️
...mon/policies/data/stats/SubscriptionStatsImpl.java 94.40% <100.00%> (+0.28%) ⬆️

... and 534 files with indirect coverage changes

Copy link
Contributor

@poorbarcode poorbarcode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a test?

@dao-jun
Copy link
Member

dao-jun commented Aug 27, 2024

LGTM, but maybe the change needs a PIP?

Copy link
Contributor

@codelipenghui codelipenghui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 for having a PIP for this change since it actually changed the Public API output and metrics.

Another point is can we only have new the field in the topic stats? Since we have a lot of metrics on the topic level. Finally, we can't add everything to the prometheus metrics. The stats, the logs are also the part of observability.

@lhotari
Copy link
Member Author

lhotari commented Aug 29, 2024

+1 for having a PIP for this change since it actually changed the Public API output and metrics.

Another point is can we only have new the field in the topic stats? Since we have a lot of metrics on the topic level. Finally, we can't add everything to the prometheus metrics. The stats, the logs are also the part of observability.

@codelipenghui This is not a breaking change in metrics and this change isn't adding significantly more metrics than what currently exists. It's currently a gap in observability of all released versions of Pulsar when msgInReplay is missing. That's why everyone needs this and making it configurable with a feature flag wouldn't be sensible.

@lhotari lhotari merged commit 59424a8 into apache:master Aug 29, 2024
61 checks passed
lhotari added a commit that referenced this pull request Aug 29, 2024
…rove Key_Shared observability (#23224)

(cherry picked from commit 59424a8)
lhotari added a commit that referenced this pull request Aug 29, 2024
…rove Key_Shared observability (#23224)

(cherry picked from commit 59424a8)
lhotari added a commit that referenced this pull request Aug 29, 2024
…rove Key_Shared observability (#23224)

(cherry picked from commit 59424a8)
grssam pushed a commit to grssam/pulsar that referenced this pull request Sep 4, 2024
nikhil-ctds pushed a commit to datastax/pulsar that referenced this pull request Sep 5, 2024
…rove Key_Shared observability (apache#23224)

(cherry picked from commit 59424a8)
(cherry picked from commit 766d2a4)
srinath-ctds pushed a commit to datastax/pulsar that referenced this pull request Sep 5, 2024
…rove Key_Shared observability (apache#23224)

(cherry picked from commit 59424a8)
(cherry picked from commit 766d2a4)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/metrics cherry-picked/branch-3.0 cherry-picked/branch-3.2 cherry-picked/branch-3.3 doc-required Your PR changes impact docs and you will update later. ready-to-test release/3.0.7 release/3.1.4 release/3.2.5 release/3.3.2 type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages
Development

Successfully merging this pull request may close these issues.

8 participants