Interface HttpClientHandler


public interface HttpClientHandler
This API is taken from OpenZipkin Brave. This standardizes a way to instrument http clients, particularly in a way that encourages use of portable customizations via HttpRequestParser and HttpResponseParser.
Since:
1.0.0
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    handleReceive(io.micrometer.observation.transport.http.HttpClientResponse response, Span span)
    Finishes the client span after assigning it tags according to the response or error.
    handleSend(io.micrometer.observation.transport.http.HttpClientRequest request)
    Starts the client span after assigning it a name and tags.
    handleSend(io.micrometer.observation.transport.http.HttpClientRequest request, TraceContext parent)
    Same as handleSend(HttpClientRequest) but with an explicit parent TraceContext.
  • Method Details

    • handleSend

      Span handleSend(io.micrometer.observation.transport.http.HttpClientRequest request)
      Starts the client span after assigning it a name and tags. This injects the trace context onto the request before returning. Call this before sending the request on the wire.
      Parameters:
      request - to inject the tracing context with
      Returns:
      client side span
    • handleSend

      Span handleSend(io.micrometer.observation.transport.http.HttpClientRequest request, @Nullable TraceContext parent)
      Same as handleSend(HttpClientRequest) but with an explicit parent TraceContext.
      Parameters:
      request - to inject the tracing context with
      parent - TraceContext that is to be the client side span's parent
      Returns:
      client side span
    • handleReceive

      void handleReceive(io.micrometer.observation.transport.http.HttpClientResponse response, Span span)
      Finishes the client span after assigning it tags according to the response or error.
      Parameters:
      response - the HTTP response
      span - span to be ended