Class HttpClientMetrics
- java.lang.Object
-
- io.opentelemetry.instrumentation.api.instrumenter.http.HttpClientMetrics
-
- All Implemented Interfaces:
RequestListener
@UnstableApi public final class HttpClientMetrics extends Object implements RequestListener
RequestListenerwhich keeps track of HTTP client metrics.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete 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.static RequestMetricsget()Returns aRequestMetricswhich can be used to enable recording ofHttpClientMetricson anInstrumenterBuilder.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
-
get
@UnstableApi public static RequestMetrics get()
Returns aRequestMetricswhich can be used to enable recording ofHttpClientMetricson anInstrumenterBuilder.
-
start
public io.opentelemetry.context.Context start(io.opentelemetry.context.Context context, io.opentelemetry.api.common.Attributes startAttributes, long startNanos)Description copied from interface:RequestListenerListener 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.- Specified by:
startin interfaceRequestListenerstartNanos- The nanosecond timestamp marking the start of the request. Can be used to compute the duration of the entire operation.
-
end
public void end(io.opentelemetry.context.Context context, io.opentelemetry.api.common.Attributes endAttributes, long endNanos)Description copied from interface:RequestListenerListener method that is called at the end of a request.- Specified by:
endin interfaceRequestListenerendNanos- The nanosecond timestamp marking the end of the request. Can be used to compute the duration of the entire operation.
-
-