Instrumentations for Apache HttpComponents do not meter errors and leak memory (original) (raw)
Describe the bug
An HttpAsyncClient instrumented with MicrometerHttpClientInterceptor does not meter IO errors.
For example, requests resulting in a ConnectTimeoutException, SocketTimeoutException are not metered.
MicrometerHttpRequestExecutor however does meter IO errors by setting the status key to IO_ERROR.
Environment
- Micrometer version [1.11.0-RC1]
- Micrometer registry [prometheus]
- Java version: [17]
To Reproduce
How to reproduce the bug:
Make an instrumented client to run into some sort of IO Exception, ConnectTimeoutException, SocketTimeoutException, etc.
Expected behavior
- The request is counted, and elapsed time is measured.
- The Tag status has the value IO_ERROR
- The Tag outcome is UNKNOWN.
Additional context
The Apache Http Components instrumentation does not support the tag exception, which is quite commonly used by other http client instrumentations.