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.

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 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 isn't set or is an empty string 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 TracerProviderresolved 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 that is used to load proxy configurations from the environment. If null is passed then getGlobalConfiguration() will be used.

Returns:

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

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.

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