Package org.apache.solr.core
Class OpenTelemetryConfigurator
java.lang.Object
org.apache.solr.core.OpenTelemetryConfigurator
- All Implemented Interfaces:
NamedListInitializedPlugin
public abstract class OpenTelemetryConfigurator
extends Object
implements NamedListInitializedPlugin
Configures and loads/sets
GlobalOpenTelemetry from a OpenTelemetrySdk.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static StringenvNameToSyspropName(String envName) In OTEL Java SDK there is a convention that the java property name for OTEL_FOO_BAR is otel.foo.barprotected static StringReturns system property if found, else returns environment variable, or null if none found.protected abstract io.opentelemetry.sdk.OpenTelemetrySdkprotected abstract io.opentelemetry.api.trace.Tracerstatic voidinitializeOpenTelemetrySdk(NodeConfig cfg, SolrResourceLoader loader) Initializes theGlobalOpenTelemetryinstance by configuring theOpenTelemetrySdkthrough custom plugin, auto-configure or default SDK.static voidMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.solr.util.plugin.NamedListInitializedPlugin
init
-
Field Details
-
TRACE_ID_GEN_ENABLED
public static final boolean TRACE_ID_GEN_ENABLED
-
-
Constructor Details
-
OpenTelemetryConfigurator
public OpenTelemetryConfigurator()
-
-
Method Details
-
initializeOpenTelemetrySdk
Initializes theGlobalOpenTelemetryinstance by configuring theOpenTelemetrySdkthrough custom plugin, auto-configure or default SDK. -
getTracer
protected abstract io.opentelemetry.api.trace.Tracer getTracer() -
getOpenTelemetrySdk
protected abstract io.opentelemetry.sdk.OpenTelemetrySdk getOpenTelemetrySdk() -
getConfig
Returns system property if found, else returns environment variable, or null if none found.- Parameters:
envName- the environment variable to look forenv- current env- Returns:
- the resolved value
-
envNameToSyspropName
In OTEL Java SDK there is a convention that the java property name for OTEL_FOO_BAR is otel.foo.bar- Parameters:
envName- the environmnet name to convert- Returns:
- the corresponding sysprop name
-
resetForTest
public static void resetForTest()
-