pgier opened a new pull request, #18451:
URL: https://github.com/apache/pulsar/pull/18451

   Fixes #15819
   
   The existing code calculates the pulsar_out_bytes_total and 
pulsar_out_messages_total per subscription metrics by adding the values from 
the currently connected consumers. This produces incorrect values as soon as 
one or more of the consumers disconnects from the subscription.
   
   This changes these two metrics to directly use the subscription stats for 
these values, and match the output of `pulsar-admin topic stats`.
   
   Signed-off-by: Paul Gier <[email protected]>
   
   Fixes #15819
   
   ### Motivation
   
   The prometheus metrics for pulsar_out_bytes_total and 
pulsar_out_messages_total should never decrease,
   and they should match the output seen when using pulsar-admin.
   
   ### Modifications
   
   Changed the calculation of pulsar_out_bytes_total and 
pulsar_out_messages_total to directly use the
   subscription stats instead of calculating these values by summing the values 
of the currently connected
   consumers.
   
   ### Verifying this change
   
   - [X] Make sure that the change passes the CI checks.
   
   Added a unit test to cover this case.
   
   ### Does this pull request potentially affect one of the following parts:
   
   *If the box was checked, please highlight the changes*
   
   - [ ] Dependencies (add or upgrade a dependency)
   - [ ] The public API
   - [ ] The schema
   - [ ] The default values of configurations
   - [ ] The threading model
   - [ ] The binary protocol
   - [ ] The REST endpoints
   - [ ] The admin CLI options
   - [ ] Anything that affects deployment
   
   ### Documentation
   
   <!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
   
   - [ ] `doc` <!-- Your PR contains doc changes. Please attach the local 
preview screenshots (run `sh start.sh` at `pulsar/site2/website`) to your PR 
description, or else your PR might not get merged. -->
   - [ ] `doc-required` <!-- Your PR changes impact docs and you will update 
later -->
   - [X] `doc-not-needed` <!-- Your PR changes do not impact docs -->
   - [ ] `doc-complete` <!-- Docs have been already added -->
   
   ### Matching PR in forked repository
   
   PR in forked repository: https://github.com/pgier/pulsar/pull/2
   
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to