Interface AgentExtension
-
- All Superinterfaces:
Ordered
public interface AgentExtension extends Ordered
AnAgentExtensionprovides a way to modify/enrich the OpenTelemetry Javaagent behavior. It can be anInstrumentationModuleor a completely custom implementation. Because an extension can heavily modify the javaagent's behavior extreme caution is advised.This is a service provider interface that requires implementations to be registered in a provider-configuration file stored in the
META-INF/servicesresource directory.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description net.bytebuddy.agent.builder.AgentBuilderextend(net.bytebuddy.agent.builder.AgentBuilder agentBuilder)Extend the passedagentBuilderwith custom logic (e.g. instrumentation).StringextensionName()Returns the name of the extension.
-
-
-
Method Detail
-
extend
net.bytebuddy.agent.builder.AgentBuilder extend(net.bytebuddy.agent.builder.AgentBuilder agentBuilder)
Extend the passedagentBuilderwith custom logic (e.g. instrumentation).- Returns:
- The customized agent. Note that this method MUST return a non-null
AgentBuilderinstance that contains all customizations defined in this extension.
-
extensionName
String extensionName()
Returns the name of the extension. It does not have to be unique, but it should be human-readable: javaagent uses the extension name in its logs.
-
-