Skip to content

Conversation

@merlimat
Copy link
Contributor

Motivation

Several broker caches metrics are not exposed in the dashboards. We need to manually register them for the metrics to be collected.

Modifications

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:

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
  • The metrics
  • Anything that affects deployment

Documentation

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

Matching PR in forked repository

PR in forked repository:

@merlimat merlimat added this to the 4.1.0 milestone May 30, 2025
@merlimat merlimat self-assigned this May 30, 2025
@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label May 30, 2025
@codecov-commenter
Copy link

codecov-commenter commented May 30, 2025

Codecov Report

Attention: Patch coverage is 96.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 74.26%. Comparing base (bbc6224) to head (c73ca39).
Report is 1126 commits behind head on master.

Files with missing lines Patch % Lines
.../org/apache/pulsar/metadata/api/MetadataStore.java 50.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #24365      +/-   ##
============================================
+ Coverage     73.57%   74.26%   +0.68%     
+ Complexity    32624    32279     -345     
============================================
  Files          1877     1866      -11     
  Lines        139502   145170    +5668     
  Branches      15299    16596    +1297     
============================================
+ Hits         102638   107805    +5167     
+ Misses        28908    28827      -81     
- Partials       7956     8538     +582     
Flag Coverage Δ
inttests 26.68% <80.00%> (+2.10%) ⬆️
systests 23.29% <84.00%> (-1.04%) ⬇️
unittests 73.75% <96.00%> (+0.91%) ⬆️

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

Files with missing lines Coverage Δ
...e/pulsar/broker/authentication/oidc/JwksCache.java 67.34% <100.00%> (+0.68%) ⬆️
...thentication/oidc/OpenIDProviderMetadataCache.java 79.01% <100.00%> (+0.53%) ⬆️
...ker/authentication/AuthenticationProviderSasl.java 58.39% <100.00%> (-1.61%) ⬇️
...ache/pulsar/broker/ManagedLedgerClientFactory.java 82.65% <100.00%> (-1.50%) ⬇️
...apache/pulsar/broker/namespace/OwnershipCache.java 80.18% <ø> (-5.08%) ⬇️
.../service/SystemTopicBasedTopicPoliciesService.java 75.31% <100.00%> (+1.12%) ⬆️
...rg/apache/pulsar/broker/web/PulsarWebResource.java 65.21% <100.00%> (+1.17%) ⬆️
...e/pulsar/common/naming/NamespaceBundleFactory.java 81.31% <ø> (+0.44%) ⬆️
...che/pulsar/common/stats/CacheMetricsCollector.java 100.00% <ø> (ø)
...pache/pulsar/functions/instance/ProducerCache.java 85.24% <100.00%> (ø)
... and 4 more

... and 1070 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@merlimat merlimat merged commit b879ec6 into apache:master May 30, 2025
53 of 54 checks passed
@merlimat merlimat deleted the cache-metrics-2 branch May 30, 2025 22:21
manas-ctds pushed a commit to datastax/pulsar that referenced this pull request Jun 4, 2025
srinath-ctds pushed a commit to datastax/pulsar that referenced this pull request Jun 5, 2025
@codelipenghui
Copy link
Contributor

@lhotari I will revert this change from branch-4.0 first since the metrics seem not correct.

caffeine_cache_eviction_weight{cluster="test",cache="-[simple type, class org.apache.pulsar.common.policies.data.FailureDomainImpl]"} 0.0
caffeine_cache_eviction_weight{cluster="test",cache="-[map type; class org.apache.pulsar.common.policies.data.BookiesRackConfiguration, [simple type, class java.lang.String] -> [map type; class java.util.Map, [simple type, class java.lang.String] -> [simple type, class org.apache.pulsar.common.policies.data.BookieInfo]]]"} 0.0
caffeine_cache_eviction_weight{cluster="test",cache="-[simple type, class org.apache.pulsar.policies.data.loadbalancer.TimeAverageBrokerData]"} 0.0

codelipenghui added a commit to codelipenghui/incubator-pulsar that referenced this pull request Jun 11, 2025
}
}
});
CacheMetricsCollector.CAFFEINE.addCache(metadataStoreName + "-exists", childrenCache);
Copy link
Contributor

Choose a reason for hiding this comment

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

this should use existsCache, will be fix in #24407

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants