Top Description Fields Constructors Methods
io.opentelemetry.api.internal

public final Class InstrumentationUtil

extends Object
Class Inheritance
Imports
io.opentelemetry.context.Context, .ContextKey, java.util.Objects

This class is internal and is hence not for public use. Its APIs are unstable and can change at any time.

Field Summary

Modifier and TypeField and Description
private static final ContextKey<Boolean>

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static boolean

Returns:

TRUE to suppress the automatic instrumentation, FALSE to continue with the instrumentation.
shouldSuppressInstrumentation
(Context context)

Checks if an automatic instrumentation should be suppressed with the provided Context.

public static void
suppressInstrumentation(Runnable runnable)

Adds a Context boolean key that will allow to identify HTTP calls coming from OTel exporters.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

SUPPRESS_INSTRUMENTATION_KEYback to summary
private static final ContextKey<Boolean> SUPPRESS_INSTRUMENTATION_KEY

Constructor Detail

InstrumentationUtilback to summary
private InstrumentationUtil()

Method Detail

shouldSuppressInstrumentationback to summary
public static boolean shouldSuppressInstrumentation(Context context)

Checks if an automatic instrumentation should be suppressed with the provided Context.

Returns:boolean

TRUE to suppress the automatic instrumentation, FALSE to continue with the instrumentation.

suppressInstrumentationback to summary
public static void suppressInstrumentation(Runnable runnable)

Adds a Context boolean key that will allow to identify HTTP calls coming from OTel exporters. The key later be checked by an automatic instrumentation to avoid tracing OTel exporter's calls.