Class NettyClientTelemetry
java.lang.Object
io.opentelemetry.instrumentation.netty.v4_1.NettyClientTelemetry
Entrypoint for instrumenting Netty HTTP clients.
-
Method Summary
Modifier and TypeMethodDescriptionstatic NettyClientTelemetryBuilderbuilder(io.opentelemetry.api.OpenTelemetry openTelemetry) Returns a newNettyClientTelemetryBuilderconfigured with the givenOpenTelemetry.static NettyClientTelemetrycreate(io.opentelemetry.api.OpenTelemetry openTelemetry) Returns a newNettyClientTelemetryconfigured with the givenOpenTelemetry.io.netty.channel.CombinedChannelDuplexHandler<? extends io.netty.channel.ChannelInboundHandlerAdapter,? extends io.netty.channel.ChannelOutboundHandlerAdapter> Returns a newCombinedChannelDuplexHandlerthat generates telemetry for outgoing HTTP requests and incoming responses in a single handler.io.netty.channel.ChannelOutboundHandlerAdapter/** Returns a newChannelOutboundHandlerAdapterthat generates telemetry for outgoing HTTP requests.io.netty.channel.ChannelInboundHandlerAdapterReturns a newChannelInboundHandlerAdapterthat generates telemetry for incoming HTTP responses.static voidsetChannelContext(io.netty.channel.Channel channel, io.opentelemetry.context.Context context) Propagate theContextto theChannel.
-
Method Details
-
create
Returns a newNettyClientTelemetryconfigured with the givenOpenTelemetry. -
builder
Returns a newNettyClientTelemetryBuilderconfigured with the givenOpenTelemetry. -
createRequestHandler
public io.netty.channel.ChannelOutboundHandlerAdapter createRequestHandler()/** Returns a newChannelOutboundHandlerAdapterthat generates telemetry for outgoing HTTP requests. Must be paired withcreateResponseHandler(). -
createResponseHandler
public io.netty.channel.ChannelInboundHandlerAdapter createResponseHandler()Returns a newChannelInboundHandlerAdapterthat generates telemetry for incoming HTTP responses. Must be paired withcreateRequestHandler(). -
createCombinedHandler
public io.netty.channel.CombinedChannelDuplexHandler<? extends io.netty.channel.ChannelInboundHandlerAdapter,? extends io.netty.channel.ChannelOutboundHandlerAdapter> createCombinedHandler()Returns a newCombinedChannelDuplexHandlerthat generates telemetry for outgoing HTTP requests and incoming responses in a single handler. -
setChannelContext
public static void setChannelContext(io.netty.channel.Channel channel, io.opentelemetry.context.Context context) Propagate theContextto theChannel. This MUST be called before each HTTP request executed on aChannel.
-