mlbiscoc commented on code in PR #4902:
URL: https://github.com/apache/solr/pull/4902#discussion_r4037533699
##########
solr/core/src/java/org/apache/solr/metrics/SolrMetricManager.java:
##########
@@ -405,16 +367,19 @@ private LongCounterBuilder longCounterBuilder(
private DoubleCounterBuilder doubleCounterBuilder(
String registry, String counterName, String description, OtelUnit unit) {
DoubleCounterBuilder builder =
- meterProvider(registry)
- .get(OTEL_SCOPE_NAME)
- .counterBuilder(counterName)
- .setDescription(description)
- .ofDoubles();
+
meter(registry).counterBuilder(counterName).setDescription(description).ofDoubles();
if (unit != null) builder.setUnit(unit.getSymbol());
return builder;
}
+ private Meter meter(String registry) {
+ if (!enabled) {
+ return OpenTelemetry.noop().getMeterProvider().get(OTEL_SCOPE_NAME);
+ }
+ return meterProvider(registry).get(OTEL_SCOPE_NAME);
+ }
Review Comment:
I like the changes for this on disabling metrics. Can you change the title
to SOLR-18455 and rip out the searcher changes? The other PR should be the
actual fix for the leak.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]