mkhludnev commented on code in PR #4902:
URL: https://github.com/apache/solr/pull/4902#discussion_r4033893329


##########
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:
   extracted to https://issues.apache.org/jira/browse/SOLR-18442



-- 
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]

Reply via email to