Interface AgentExtension
-
- All Superinterfaces:
Ordered
public interface AgentExtension extends Ordered
AnAgentExtension
provides a way to modify/enrich the OpenTelemetry Javaagent behavior. It can be anInstrumentationModule
or 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/services
resource directory.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description net.bytebuddy.agent.builder.AgentBuilder
extend(net.bytebuddy.agent.builder.AgentBuilder agentBuilder)
Extend the passedagentBuilder
with custom logic (e.g. instrumentation).String
extensionName()
Returns the name of the extension.
-
-
-
Method Detail
-
extend
net.bytebuddy.agent.builder.AgentBuilder extend(net.bytebuddy.agent.builder.AgentBuilder agentBuilder)
Extend the passedagentBuilder
with custom logic (e.g. instrumentation).- Returns:
- The customized agent. Note that this method MUST return a non-null
AgentBuilder
instance 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.
-
-