Delen via


TracingOptions Class

  • java.lang.Object
    • com.azure.core.util.TracingOptions

public class TracingOptions

Tracing configuration options for clients.

Constructor Summary

Modifier Constructor Description
TracingOptions()

Creates new instance of TracingOptions

protected TracingOptions(Class<? extends TracerProvider> tracerProvider)

Creates new instance of TracingOptions

Method Summary

Modifier and Type Method and Description
static TracingOptions fromConfiguration(Configuration configuration)

Loads tracing options from the configuration.

Set<String> getAllowedTracingQueryParamNames()

Gets the set of query parameter names that are allowed to be recorded in the URL.

Class<> getTracerProvider()

Gets name of the TracerProvider implementation that should be used to construct an instance of Tracer.

boolean isEnabled()

Flag indicating if distributed tracing should be enabled.

TracingOptions setAllowedTracingQueryParamNames(Set<String> allowedQueryParamNames)

Sets the set of query parameter names that are allowed to be recorded in the URL.

TracingOptions setEnabled(boolean enabled)

Enables or disables distributed tracing.

Methods inherited from java.lang.Object

Constructor Details

TracingOptions

public TracingOptions()

Creates new instance of TracingOptions

TracingOptions

protected TracingOptions(Class tracerProvider)

Creates new instance of TracingOptions

Parameters:

tracerProvider - The type of the TracerProvider implementation that should be used to construct an instance of Tracer. If the value is not set (or null), then the first TracerProvider resolved by ServiceLoader will be used to create an instance of Tracer. If the value is set and doesn't match any TracerProvider resolved by ServiceLoader an IllegalStateException will be thrown when attempting to create an instance of Tracer.

Method Details

fromConfiguration

public static TracingOptions fromConfiguration(Configuration configuration)

Loads tracing options from the configuration.

Parameters:

configuration - The Configuration instance containing tracing options. If null is passed then getGlobalConfiguration() will be used.

Returns:

A TracingOptions reflecting updated tracing options loaded from the configuration, if no tracing options are found, default (enabled) tracing options will be returned.

getAllowedTracingQueryParamNames

public Set 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.

getTracerProvider

public Class getTracerProvider()

Gets name of the TracerProvider implementation that should be used to construct an instance of Tracer.

Returns:

The TracerProvider implementation used to create an instance of Tracer.

isEnabled

public boolean isEnabled()

Flag indicating if distributed tracing should be enabled.

Returns:

true if tracing is enabled, false otherwise.

setAllowedTracingQueryParamNames

public TracingOptions setAllowedTracingQueryParamNames(Set allowedQueryParamNames)

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 TracingOptions object.

setEnabled

public TracingOptions setEnabled(boolean enabled)

Enables or disables distributed tracing. By default, tracing is enabled if and only if tracing implementation is detected.

Parameters:

enabled - pass true to enable tracing.

Returns:

the updated TracingOptions object.

Applies to