Class NettyClientTelemetry

java.lang.Object
io.opentelemetry.instrumentation.netty.v4_1.NettyClientTelemetry

public final class NettyClientTelemetry extends Object
Entrypoint for instrumenting Netty HTTP clients.
  • Method Summary

    Modifier and Type
    Method
    Description
    builder(io.opentelemetry.api.OpenTelemetry openTelemetry)
    Returns a new NettyClientTelemetryBuilder configured with the given OpenTelemetry.
    create(io.opentelemetry.api.OpenTelemetry openTelemetry)
    Returns a new NettyClientTelemetry configured with the given OpenTelemetry.
    io.netty.channel.CombinedChannelDuplexHandler<? extends io.netty.channel.ChannelInboundHandlerAdapter,? extends io.netty.channel.ChannelOutboundHandlerAdapter>
    Returns a new CombinedChannelDuplexHandler that generates telemetry for outgoing HTTP requests and incoming responses in a single handler.
    io.netty.channel.ChannelOutboundHandlerAdapter
    /** Returns a new ChannelOutboundHandlerAdapter that generates telemetry for outgoing HTTP requests.
    io.netty.channel.ChannelInboundHandlerAdapter
    Returns a new ChannelInboundHandlerAdapter that generates telemetry for incoming HTTP responses.
    static void
    setChannelContext(io.netty.channel.Channel channel, io.opentelemetry.context.Context context)
    Propagate the Context to the Channel.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • create

      public static NettyClientTelemetry create(io.opentelemetry.api.OpenTelemetry openTelemetry)
      Returns a new NettyClientTelemetry configured with the given OpenTelemetry.
    • builder

      public static NettyClientTelemetryBuilder builder(io.opentelemetry.api.OpenTelemetry openTelemetry)
      Returns a new NettyClientTelemetryBuilder configured with the given OpenTelemetry.
    • createRequestHandler

      public io.netty.channel.ChannelOutboundHandlerAdapter createRequestHandler()
      /** Returns a new ChannelOutboundHandlerAdapter that generates telemetry for outgoing HTTP requests. Must be paired with createResponseHandler().
    • createResponseHandler

      public io.netty.channel.ChannelInboundHandlerAdapter createResponseHandler()
      Returns a new ChannelInboundHandlerAdapter that generates telemetry for incoming HTTP responses. Must be paired with createRequestHandler().
    • createCombinedHandler

      public io.netty.channel.CombinedChannelDuplexHandler<? extends io.netty.channel.ChannelInboundHandlerAdapter,? extends io.netty.channel.ChannelOutboundHandlerAdapter> createCombinedHandler()
      Returns a new CombinedChannelDuplexHandler that 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 the Context to the Channel. This MUST be called before each HTTP request executed on a Channel.