Interface RequestListener
-
- All Known Implementing Classes:
HttpClientMetrics,HttpServerMetrics,RpcClientMetrics,RpcServerMetrics
public interface RequestListenerA listener of the start and end of a request. Instrumented libraries will callstart(Context, Attributes, long)as early as possible in the processing of a request andend(Context, Attributes, long)as late as possible when finishing the request. These correspond to the start and end of a span when tracing.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidend(io.opentelemetry.context.Context context, io.opentelemetry.api.common.Attributes endAttributes, long endNanos)Listener method that is called at the end of a request.io.opentelemetry.context.Contextstart(io.opentelemetry.context.Context context, io.opentelemetry.api.common.Attributes startAttributes, long startNanos)Listener method that is called at the start of a request.
-
-
-
Method Detail
-
start
io.opentelemetry.context.Context start(io.opentelemetry.context.Context context, io.opentelemetry.api.common.Attributes startAttributes, long startNanos)Listener method that is called at the start of a request. If any state needs to be kept between the start and end of the request, e.g., an in-progress span, it should be added to the passed inContextand returned.- Parameters:
startNanos- The nanosecond timestamp marking the start of the request. Can be used to compute the duration of the entire operation.
-
end
void end(io.opentelemetry.context.Context context, io.opentelemetry.api.common.Attributes endAttributes, long endNanos)Listener method that is called at the end of a request.- Parameters:
endNanos- The nanosecond timestamp marking the end of the request. Can be used to compute the duration of the entire operation.
-
-