You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "hangc0276 (via GitHub)" <gi...@apache.org> on 2023/08/16 14:43:03 UTC

[GitHub] [pulsar] hangc0276 opened a new pull request, #21006: Make exposing topic level metric dynamic

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

   <!--
   ### Contribution Checklist
     
     - PR title format should be *[type][component] summary*. For details, see *[Guideline - Pulsar PR Naming Convention](https://pulsar.apache.org/contribute/develop-semantic-title/)*. 
   
     - Fill out the template below to describe the changes contributed by the pull request. That will give reviewers the context they need to do the review.
     
     - Each pull request should address only one issue, not mix up code from multiple issues.
     
     - Each commit in the pull request has a meaningful commit message
   
     - Once all items of the checklist are addressed, remove the above text and this checklist, leaving only the filled out template below.
   -->
   
   <!-- Either this PR fixes an issue, -->
   
   Fixes #xyz
   
   <!-- or this PR is one task of an issue -->
   
   Main Issue: #xyz
   
   <!-- If the PR belongs to a PIP, please add the PIP link here -->
   
   PIP: #xyz 
   
   <!-- Details of when a PIP is required and how the PIP process work, please see: https://github.com/apache/pulsar/blob/master/pip/README.md -->
   
   ### Motivation
   
   <!-- Explain here the context, and why you're making that change. What is the problem you're trying to solve. -->
   Exposing topic-level metrics costs a lot of CPU and memory for brokers and put heavy traffic pressure on Prometheus to pull metrics, especially when the Pulsar cluster has thousands of topics. To address this issue, we can disable the topic-level metrics by default and enable it when some topics encountered any issues.
   
   However, the `exposeTopicLevelMetricsInPrometheus` flag is not dynamic and we need to change the broker configuration and restart all the brokers to enable or disable the flag.
   
   We can make the `exposeTopicLevelMetricsInPrometheus` flag dynamic to avoid restarting all the brokers when enabling or disabling the flag
   
   ### Modifications
   Make the following flags dynamic
   - exposeTopicLevelMetricsInPrometheus
   - exposeConsumerLevelMetricsInPrometheus
   - exposeProducerLevelMetricsInPrometheus
   - exposeManagedLedgerMetricsInPrometheus
   - exposeManagedCursorMetricsInPrometheus
   - exposePreciseBacklogInPrometheus
   - exposeSubscriptionBacklogSizeInPrometheus
   
   <!-- Describe the modifications you've done. -->
   
   ### Verifying this change
   
   - [ ] Make sure that the change passes the CI checks.
   
   *(Please pick either of the following options)*
   
   This change is a trivial rework / code cleanup without any test coverage.
   
   *(or)*
   
   This change is already covered by existing tests, such as *(please describe tests)*.
   
   *(or)*
   
   This change added tests and can be verified as follows:
   
   *(example:)*
     - *Added integration tests for end-to-end deployment with large payloads (10MB)*
     - *Extended integration test for recovery after broker failure*
   
   ### Does this pull request potentially affect one of the following parts:
   
   <!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
   
   *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
   - [x] The metrics
   - [ ] Anything that affects deployment
   
   ### Documentation
   
   <!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
   
   - [ ] `doc` <!-- Your PR contains doc changes. -->
   - [x] `doc-required` <!-- Your PR changes impact docs and you will update later -->
   - [ ] `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: <!-- ENTER URL HERE -->
   
   <!--
   After opening this PR, the build in apache/pulsar will fail and instructions will
   be provided for opening a PR in the PR author's forked repository.
   
   apache/pulsar pull requests should be first tested in your own fork since the 
   apache/pulsar CI based on GitHub Actions has constrained resources and quota.
   GitHub Actions provides separate quota for pull requests that are executed in 
   a forked repository.
   
   The tests will be run in the forked repository until all PR review comments have
   been handled, the tests pass and the PR is approved by a reviewer.
   -->
   


-- 
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-unsubscribe@pulsar.apache.org

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


[GitHub] [pulsar] Technoboy- closed pull request #21006: [improve] [broker] Make exposing topic level metric dynamic

Posted by "Technoboy- (via GitHub)" <gi...@apache.org>.
Technoboy- closed pull request #21006: [improve] [broker] Make exposing topic level metric dynamic
URL: https://github.com/apache/pulsar/pull/21006


-- 
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-unsubscribe@pulsar.apache.org

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


Re: [PR] [improve] [broker] Make exposing topic level metric dynamic [pulsar]

Posted by "hangc0276 (via GitHub)" <gi...@apache.org>.
hangc0276 closed pull request #21006: [improve] [broker] Make exposing topic level metric dynamic
URL: https://github.com/apache/pulsar/pull/21006


-- 
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-unsubscribe@pulsar.apache.org

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


[GitHub] [pulsar] codecov-commenter commented on pull request #21006: [improve] [broker] Make exposing topic level metric dynamic

Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #21006:
URL: https://github.com/apache/pulsar/pull/21006#issuecomment-1687797745

   ## [Codecov](https://app.codecov.io/gh/apache/pulsar/pull/21006?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   > Merging [#21006](https://app.codecov.io/gh/apache/pulsar/pull/21006?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (7369f7f) into [master](https://app.codecov.io/gh/apache/pulsar/commit/d6734b76b14aedd800116218b02ae607b93df9d1?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (d6734b7) will **increase** coverage by `35.83%`.
   > Report is 19 commits behind head on master.
   > The diff coverage is `100.00%`.
   
   [![Impacted file tree graph](https://app.codecov.io/gh/apache/pulsar/pull/21006/graphs/tree.svg?width=650&height=150&src=pr&token=acYqCpsK9J&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)](https://app.codecov.io/gh/apache/pulsar/pull/21006?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   
   ```diff
   @@              Coverage Diff              @@
   ##             master   #21006       +/-   ##
   =============================================
   + Coverage     36.84%   72.68%   +35.83%     
   - Complexity    12195    32478    +20283     
   =============================================
     Files          1698     1875      +177     
     Lines        129852   142887    +13035     
     Branches      14161    16177     +2016     
   =============================================
   + Hits          47843   103852    +56009     
   + Misses        75680    30776    -44904     
   - Partials       6329     8259     +1930     
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/pulsar/pull/21006/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [inttests](https://app.codecov.io/gh/apache/pulsar/pull/21006/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `24.27% <28.57%> (+0.14%)` | :arrow_up: |
   | [systests](https://app.codecov.io/gh/apache/pulsar/pull/21006/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `25.03% <28.57%> (-0.06%)` | :arrow_down: |
   | [unittests](https://app.codecov.io/gh/apache/pulsar/pull/21006/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `71.94% <100.00%> (+39.87%)` | :arrow_up: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Files Changed](https://app.codecov.io/gh/apache/pulsar/pull/21006?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [...org/apache/pulsar/broker/ServiceConfiguration.java](https://app.codecov.io/gh/apache/pulsar/pull/21006?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cHVsc2FyLWJyb2tlci1jb21tb24vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3B1bHNhci9icm9rZXIvU2VydmljZUNvbmZpZ3VyYXRpb24uamF2YQ==) | `98.50% <100.00%> (+0.45%)` | :arrow_up: |
   | [...n/java/org/apache/pulsar/broker/PulsarService.java](https://app.codecov.io/gh/apache/pulsar/pull/21006?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cHVsc2FyLWJyb2tlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2Jyb2tlci9QdWxzYXJTZXJ2aWNlLmphdmE=) | `82.17% <100.00%> (+13.61%)` | :arrow_up: |
   | [...ats/prometheus/PulsarPrometheusMetricsServlet.java](https://app.codecov.io/gh/apache/pulsar/pull/21006?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cHVsc2FyLWJyb2tlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2Jyb2tlci9zdGF0cy9wcm9tZXRoZXVzL1B1bHNhclByb21ldGhldXNNZXRyaWNzU2VydmxldC5qYXZh) | `100.00% <100.00%> (+22.22%)` | :arrow_up: |
   
   ... and [1434 files with indirect coverage changes](https://app.codecov.io/gh/apache/pulsar/pull/21006/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   


-- 
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-unsubscribe@pulsar.apache.org

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


[GitHub] [pulsar] hangc0276 commented on pull request #21006: [improve] [broker] Make exposing topic level metric dynamic

Posted by "hangc0276 (via GitHub)" <gi...@apache.org>.
hangc0276 commented on PR #21006:
URL: https://github.com/apache/pulsar/pull/21006#issuecomment-1680760346

   @asafm Please help take a look this at this PR and it is related to metrics, thanks. 


-- 
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-unsubscribe@pulsar.apache.org

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


[GitHub] [pulsar] asafm commented on pull request #21006: [improve] [broker] Make exposing topic level metric dynamic

Posted by "asafm (via GitHub)" <gi...@apache.org>.
asafm commented on PR #21006:
URL: https://github.com/apache/pulsar/pull/21006#issuecomment-1699369710

   @hangc0276 It looks ok, aside from the fact that you don't have any test to validate it and protect from even being ruined :) 


-- 
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-unsubscribe@pulsar.apache.org

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


[GitHub] [pulsar] github-actions[bot] commented on pull request #21006: [improve] [broker] Make exposing topic level metric dynamic

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #21006:
URL: https://github.com/apache/pulsar/pull/21006#issuecomment-1741623507

   The pr had no activity for 30 days, mark with Stale label.


-- 
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-unsubscribe@pulsar.apache.org

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