janhoy commented on code in PR #3379:
URL: https://github.com/apache/solr/pull/3379#discussion_r2115601188


##########
solr/core/src/java/org/apache/solr/core/CoreContainer.java:
##########
@@ -465,6 +480,19 @@ public CoreContainer(NodeConfig config, CoresLocator 
locator, boolean asyncSolrC
             new SolrNamedThreadFactory("IndexFingerprintPool"));
   }
 
+  private void initializeOpenTelemetrySdk() {
+    PluginInfo info = cfg.getTracerConfiguratorPluginInfo();
+
+    if (OpenTelemetryConfigurator.shouldAutoConfigOTEL()) {
+      OpenTelemetryConfigurator.autoConfigureOpenTelemetrySdk(loader);
+    } else if (info != null && info.isEnabled()) {
+      OpenTelemetryConfigurator.loadOpenTelemetrySdk(loader, 
cfg.getTracerConfiguratorPluginInfo());

Review Comment:
   In the existing tracer loading code 
https://github.com/apache/solr/blob/main/solr/core/src/java/org/apache/solr/core/TracerConfigurator.java#L49-L65
 audoConfig of tracer would only happen if an explicit `<tracerConfig>` is not 
present in solr.xml. It seems as if this is switched around here let 
auto-config override explicit config in solr.xml?
   
   Perhaps a short method javadoc to explain the intended logic?
   
   The difference between `autoConfigure...` and `load...` is also not clear, 
both will actually configure **and** load the sdk?



##########
solr/core/src/java/org/apache/solr/core/OpenTelemetryConfigurator.java:
##########
@@ -17,25 +17,29 @@
 
 package org.apache.solr.core;
 
+import io.opentelemetry.api.GlobalOpenTelemetry;
 import io.opentelemetry.api.trace.Tracer;
 import io.opentelemetry.context.Context;
 import io.opentelemetry.context.Scope;
+import io.opentelemetry.context.propagation.ContextPropagators;
+import io.opentelemetry.sdk.OpenTelemetrySdk;
+import io.opentelemetry.sdk.OpenTelemetrySdkBuilder;
+import io.opentelemetry.sdk.metrics.SdkMeterProvider;
+import io.opentelemetry.sdk.trace.SdkTracerProvider;
 import java.lang.invoke.MethodHandles;
 import java.util.Locale;
 import java.util.Map;
 import java.util.concurrent.atomic.AtomicReference;
-import org.apache.solr.common.SolrException;
 import org.apache.solr.common.util.EnvUtils;
 import org.apache.solr.common.util.ExecutorUtil;
 import org.apache.solr.common.util.NamedList;
 import org.apache.solr.util.plugin.NamedListInitializedPlugin;
 import org.apache.solr.util.tracing.SimplePropagator;
-import org.apache.solr.util.tracing.TraceUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /** Produces a {@link Tracer} from configuration. */

Review Comment:
   Update javadoc



-- 
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: issues-unsubscr...@solr.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org

Reply via email to