Package com.azure.core.util
Class TracingOptions
java.lang.Object
com.azure.core.util.TracingOptions
Tracing configuration options for clients.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionCreates new instance ofTracingOptionsprotectedTracingOptions(Class<? extends TracerProvider> tracerProvider) Creates new instance ofTracingOptions -
Method Summary
Modifier and TypeMethodDescriptionstatic TracingOptionsfromConfiguration(Configuration configuration) Loads tracing options from the configuration.Class<? extends TracerProvider>Gets name of theTracerProviderimplementation that should be used to construct an instance ofTracer.booleanFlag indicating if distributed tracing should be enabled.setEnabled(boolean enabled) Enables or disables distributed tracing.
-
Constructor Details
-
TracingOptions
public TracingOptions()Creates new instance ofTracingOptions -
TracingOptions
Creates new instance ofTracingOptions- Parameters:
tracerProvider- The type of theTracerProviderimplementation that should be used to construct an instance ofTracer. If the value isn't set or is an empty string the firstTracerProviderresolved byServiceLoaderwill be used to create an instance ofTracer. If the value is set and doesn't match anyTracerProviderresolved byServiceLoaderanIllegalStateExceptionwill be thrown when attempting to create an instance ofTracer.
-
-
Method Details
-
fromConfiguration
Loads tracing options from the configuration.- Parameters:
configuration- TheConfigurationthat is used to load proxy configurations from the environment. Ifnullis passed thenConfiguration.getGlobalConfiguration()will be used.- Returns:
- A
TracingOptionsreflecting a tracing options loaded from the configuration, if no tracing options are found, default (enabled) tracing options will be returned.
-
isEnabled
public boolean isEnabled()Flag indicating if distributed tracing should be enabled.- Returns:
trueif tracing is enabled,falseotherwise.
-
setEnabled
Enables or disables distributed tracing. By default, tracing is enabled if and only if tracing implementation is detected.- Parameters:
enabled- passtrueto enable tracing.- Returns:
- the updated
TracingOptionsobject.
-
getTracerProvider
Gets name of theTracerProviderimplementation that should be used to construct an instance ofTracer.- Returns:
- The
TracerProviderimplementation used to create an instance ofTracer.
-