Class ClientInstrumentation
java.lang.Object
com.vaadin.extension.instrumentation.client.ClientInstrumentation
- All Implemented Interfaces:
io.opentelemetry.javaagent.extension.instrumentation.TypeInstrumentation
public class ClientInstrumentation
extends Object
implements io.opentelemetry.javaagent.extension.instrumentation.TypeInstrumentation
This instrumentation is applied to the ObservabilityHandler constructor.
Because the agent and starter use different class loaders, the code
to construct SpanData instances and export them must reside entirely
within either the agent or the starter.
To achieve this, this injects a consumer into the ObservabilityHandler
class. The ObservabilityHandler converts the incoming JSON string into
a Map of objects that are only contained within the java.util and
java .lang packages. It then sends this to the consumer. This means that
there are no class loader issues.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classClass representing the code injected into the ObservabilityHandler constructor. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionnet.bytebuddy.matcher.ElementMatcher<ClassLoader>Returns an element matcher for the ObservabilityHandler class.voidtransform(io.opentelemetry.javaagent.extension.instrumentation.TypeTransformer transformer) Sets callbacks on the ConstructorAdvice class and applies this class to the constructor of an ObservabilityHandler instance.net.bytebuddy.matcher.ElementMatcher<net.bytebuddy.description.type.TypeDescription>Returns an element matcher for the ObservabilityHandler class.
-
Constructor Details
-
ClientInstrumentation
public ClientInstrumentation()
-
-
Method Details
-
classLoaderOptimization
Returns an element matcher for the ObservabilityHandler class.- Specified by:
classLoaderOptimizationin interfaceio.opentelemetry.javaagent.extension.instrumentation.TypeInstrumentation- Returns:
- an element matcher
-
typeMatcher
public net.bytebuddy.matcher.ElementMatcher<net.bytebuddy.description.type.TypeDescription> typeMatcher()Returns an element matcher for the ObservabilityHandler class.- Specified by:
typeMatcherin interfaceio.opentelemetry.javaagent.extension.instrumentation.TypeInstrumentation- Returns:
- an element matcher
-
transform
public void transform(io.opentelemetry.javaagent.extension.instrumentation.TypeTransformer transformer) Sets callbacks on the ConstructorAdvice class and applies this class to the constructor of an ObservabilityHandler instance.- Specified by:
transformin interfaceio.opentelemetry.javaagent.extension.instrumentation.TypeInstrumentation- Parameters:
transformer- the TypeTransformer
-