Class HttpClientMetrics
java.lang.Object
io.opentelemetry.instrumentation.api.semconv.http.HttpClientMetrics
- All Implemented Interfaces:
OperationListener
OperationListener which keeps track of HTTP
client metrics.- Since:
- 2.0.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic OperationMetricsget()Returns anOperationMetricsinstance which can be used to enable recording ofHttpClientMetrics.voidonEnd(io.opentelemetry.context.Context context, io.opentelemetry.api.common.Attributes endAttributes, long endNanos) Listener method that is called at the end of an instrumented operation.io.opentelemetry.context.ContextonStart(io.opentelemetry.context.Context context, io.opentelemetry.api.common.Attributes startAttributes, long startNanos) Listener method that is called at the start of an instrumented operation.
-
Method Details
-
get
Returns anOperationMetricsinstance which can be used to enable recording ofHttpClientMetrics.- See Also:
-
onStart
public io.opentelemetry.context.Context onStart(io.opentelemetry.context.Context context, io.opentelemetry.api.common.Attributes startAttributes, long startNanos) Description copied from interface:OperationListenerListener method that is called at the start of an instrumented operation. If any state needs to be kept between the start and end of the processing, e.g., an in-progress span, it should be added to the passed inContextand returned.- Specified by:
onStartin interfaceOperationListener- Parameters:
startNanos- The nanosecond timestamp marking the start of the operation. Can be used to compute the duration of the entire operation.
-
onEnd
public void onEnd(io.opentelemetry.context.Context context, io.opentelemetry.api.common.Attributes endAttributes, long endNanos) Description copied from interface:OperationListenerListener method that is called at the end of an instrumented operation.- Specified by:
onEndin interfaceOperationListener- Parameters:
endNanos- The nanosecond timestamp marking the end of the operation. Can be used to compute the duration of the entire operation.
-