Package brave

Class Request


public abstract class Request
extends Object
Abstract request type used for parsing and sampling. When implemented, it will be the parameter of SamplerFunction or TraceContext.Extractor.

No extensions outside Brave

While this is an abstract type, it should not be subclassed outside the Brave repository. In other words, subtypes are sealed within this source tree.
See Also:
SamplerFunction, TraceContext.Extractor, TraceContext.Injector, Response
  • Constructor Details

  • Method Details

    • spanKind

      public abstract Span.Kind spanKind()
      The remote Span.Kind describing the direction and type of the request.
    • unwrap

      public abstract Object unwrap()
      Returns the underlying request object or null if there is none. Here are some request objects: org.apache.http.HttpRequest, org.apache.dubbo.rpc.Invocation, org.apache.kafka.clients.consumer.ConsumerRecord.

      Note: Some implementations are composed of multiple types, such as a request and a socket address of the client. Moreover, an implementation may change the type returned due to refactoring. Unless you control the implementation, cast carefully (ex using instanceof) instead of presuming a specific type will always be returned.

    • toString

      public String toString()
      toString in class Object