Class GlobalConfigProvider
java.lang.Object
io.opentelemetry.api.incubator.config.GlobalConfigProvider
This class provides a temporary global accessor for
ConfigProvider until the
instrumentation config API is marked stable. It will eventually be merged into GlobalOpenTelemetry.-
Method Summary
Modifier and TypeMethodDescriptionstatic ConfigProviderget()Returns the globally registeredConfigProvider.static voidUnsets the globalConfigProvider.static voidset(ConfigProvider configProvider) Sets the globalConfigProvider.
-
Method Details
-
get
Returns the globally registeredConfigProvider. -
set
Sets the globalConfigProvider. Future calls toget()will return the providedConfigProviderinstance. This should be called once as early as possible in your application initialization logic.- Throws:
IllegalStateException- when called more than once
-
resetForTest
public static void resetForTest()Unsets the globalConfigProvider. This is only meant to be used from tests which need to reconfigureConfigProvider.
-