Apache HTTP async client metrics use HttpContext in weird way, NPE is thrown (original) (raw)

Describe the bug
I am getting a NPE when using properly (I think, as I follow the javadoc in that class) MicrometerHttpClientInterceptor.

See #1886 (comment) for all the details; I was initially thinking it was just a weird design decision and therefore just commented there, but now I am convinced it's a bug (after reviewing the different implementations of HttpContext interface in apache httpcomponents client 4.x, I am not sure it can be safely used as a map key).

Environment
JDK 17
MacOS
Apache httpcomponents async client 4.x

To Reproduce
use the interceptor exactly as described.

Additional context
all the details are in #1886 (comment)