Skip to content

Solr 9 JMX module#2821

Open
jtduffy wants to merge 1 commit intomainfrom
solr-jmx-9
Open

Solr 9 JMX module#2821
jtduffy wants to merge 1 commit intomainfrom
solr-jmx-9

Conversation

@jtduffy
Copy link
Copy Markdown
Contributor

@jtduffy jtduffy commented Apr 3, 2026

Resolves #847

Overview

Adds support for JMX metrics from Solr v9.x up to (but not including) v10.

A replica of the Solr JMX v7.4.0 module except for the following...

Our instrumentation point for Solr v9 no longer accepts a SolrInfoBean instance in the SolrMetricManager_Instrumentation.registerMetric() method. Instead, it takes a SolrMetricsContext instance, which no longer exposes a getName method, which was used to generate metric names.

To handle this, a new class, SolrComponentRegistry was created. This class is used to map getTag() values (from SolrMetricsContext) to corresponding SolrInfoBean.getName() values. This allows Solr 9.0 instrumentation to maintain metric name parity with Solr 8.x. The SolrComponentRegistry instance is populated via the SolrCoreMetricManager_Instrumentation.registerMetricProducer() instrumentation point.

In some cases, metrics may be created before the bean name is known, so they use fallback names like "updateHandler". When the proper bean name (the fully qualified package/class name) is registered later, all matching metrics that are currently stored in the MetricUtil class get retroactively updated..

Added some additional tests for the new context class and bean name update logic.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.64%. Comparing base (4e37033) to head (b82e796).
⚠️ Report is 101 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #2821      +/-   ##
============================================
+ Coverage     70.36%   70.64%   +0.28%     
- Complexity    10473    10619     +146     
============================================
  Files           873      881       +8     
  Lines         42329    42913     +584     
  Branches       6433     6486      +53     
============================================
+ Hits          29784    30318     +534     
- Misses         9642     9672      +30     
- Partials       2903     2923      +20     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

Add new instrumentation for Solr JMX 9.0.0

2 participants