Package brave
Class Request
- java.lang.Object
-
- brave.Request
-
public abstract class Request extends Object
Abstract request type used for parsing and sampling. When implemented, it will be the parameter ofSamplerFunctionorTraceContext.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.- Since:
- 5.9
- See Also:
SamplerFunction,TraceContext.Extractor,TraceContext.Injector,Response
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedRequest()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract Span.KindspanKind()The remoteSpan.Kinddescribing the direction and type of the request.StringtoString()abstract Objectunwrap()Returns the underlying request object ornullif there is none.
-
-
-
Method Detail
-
spanKind
public abstract Span.Kind spanKind()
The remoteSpan.Kinddescribing the direction and type of the request.
-
unwrap
public abstract Object unwrap()
Returns the underlying request object ornullif 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.- Since:
- 5.9
-
-