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.Gets the set of query parameter names that are allowed to be recorded in the URL.Class<? extends TracerProvider> Gets name of theTracerProviderimplementation that should be used to construct an instance ofTracer.booleanFlag indicating if distributed tracing should be enabled.setAllowedTracingQueryParamNames(Set<String> allowedQueryParamNames) Sets the set of query parameter names that are allowed to be recorded in the URL.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 is not set (ornull), then 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- TheConfigurationinstance containing tracing options. Ifnullis passed thenConfiguration.getGlobalConfiguration()will be used.- Returns:
- A
TracingOptionsreflecting updated 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.
-
getAllowedTracingQueryParamNames
Gets the set of query parameter names that are allowed to be recorded in the URL.- Returns:
- The set of query parameter names that are allowed to be recorded in the URL.
-
setAllowedTracingQueryParamNames
Sets the set of query parameter names that are allowed to be recorded in the URL.- Parameters:
allowedQueryParamNames- The set of query parameter names that are allowed to be recorded in the URL.- Returns:
- The updated
TracingOptionsobject.
-