Class RpcRequest
- Direct Known Subclasses:
RpcClientRequest,RpcServerRequest
public abstract class RpcRequest extends Request
- Since:
- 5.8
- See Also:
RpcClientRequest,RpcServerRequest
-
Method Summary
Modifier and Type Method Description abstract Stringmethod()The unqualified, case-sensitive method name.booleanparseRemoteIpAndPort(Span span)Override and return true when it is possible to parse theremote IP and portfrom thedelegate.abstract Stringservice()The fully-qualified, case-sensitive service path.longstartTimestamp()The timestamp in epoch microseconds of the beginning of this request or zero to take this implicitly from the current clock.
-
Method Details
-
method
The unqualified, case-sensitive method name. Prefer the name defined in IDL to any mappedJava method name.Examples
- gRPC - full method "grpc.health.v1.Health/Check" returns "Check"
- Apache Dubbo - "demo.service.DemoService#sayHello()" command returns "sayHello"
- Apache Thrift - full method "scribe.Log" returns "Log"
Note: For IDL based services, such as Protocol Buffers, this may be different than the
Java method name, or in a different case format.- Returns:
- the RPC method name or null if unreadable.
- Since:
- 5.8
-
service
The fully-qualified, case-sensitive service path. Prefer the name defined in IDL to any mappedJava package name.Examples
- gRPC - full method "grpc.health.v1.Health/Check" returns "grpc.health.v1.Health"
- Apache Dubbo - "demo.service.DemoService#sayHello()" command returns "demo.service.DemoService"
- Apache Thrift - full method "scribe.Log" returns "scribe"
Note: For IDL based services, such as Protocol Buffers, this may be different than the
Java package name, or in a different case format. Also, this is the definition of the service, not its deploymentservice name.- Returns:
- the RPC namespace or null if unreadable.
- Since:
- 5.8
-
startTimestamp
public long startTimestamp()The timestamp in epoch microseconds of the beginning of this request or zero to take this implicitly from the current clock. Defaults to zero.This is helpful in two scenarios: late parsing and avoiding redundant timestamp overhead. If a server span, this helps reach the "original" beginning of the request, which is always prior to parsing.
Note: Overriding has the same problems as using
Span.start(long). For example, it can result in negative duration if the clock used is allowed to correct backwards. It can also result in misalignments in the trace, unlessTracing.Builder.clock(Clock)uses the same implementation.- Since:
- 5.12
- See Also:
RpcResponse.finishTimestamp(),Span.start(long),Tracing.clock(TraceContext)
-
parseRemoteIpAndPort
Override and return true when it is possible to parse theremote IP and portfrom thedelegate. Defaults to false.- Since:
- 5.12
-