Class HttpRequestAndChannel

java.lang.Object
io.opentelemetry.instrumentation.netty.v4.common.HttpRequestAndChannel

public abstract class HttpRequestAndChannel extends Object
A tuple of an HttpRequest and a Channel.
  • Constructor Details

    • HttpRequestAndChannel

      public HttpRequestAndChannel()
  • Method Details

    • create

      public static HttpRequestAndChannel create(io.netty.handler.codec.http.HttpRequest request, io.netty.channel.Channel channel)
      Create a new HttpRequestAndChannel.
    • request

      public abstract io.netty.handler.codec.http.HttpRequest request()
      Returns the HttpRequest.
    • channel

      public abstract io.netty.channel.Channel channel()
      Returns the Channel.
    • remoteAddress

      @Nullable public abstract SocketAddress remoteAddress()
      Return the Channel.remoteAddress() present when this HttpRequestAndChannel was created.

      We capture the remote address early because netty may return null when calling Channel.remoteAddress() at the end of processing in cases of timeouts or other connection issues.