-
Notifications
You must be signed in to change notification settings - Fork 1k
Closed
Labels
enhancementA general enhancementA general enhancementinstrumentationAn issue that is related to instrumenting a componentAn issue that is related to instrumenting a componentmodule: micrometer-coreAn issue that is related to our core moduleAn issue that is related to our core module
Milestone
Description
Describe the bug
ObservationExecChainHandler does not report "target.host", "target.port",.... in case of HttpHostConnectException
Environment
- Micrometer version 1.13.6
- Java version: 21
- Apache httpclient5 version 5.3.1
To Reproduce
How to reproduce the bug:
public class Main {
public static void main(String[] args) throws IOException {
SimpleMeterRegistry meterRegistry = new SimpleMeterRegistry();
ObservationRegistry registry = ObservationRegistry.create();
registry.observationConfig().observationHandler(new DefaultMeterObservationHandler(meterRegistry));
CloseableHttpClient client = HttpClientBuilder.create()
.addExecInterceptorAfter(ChainElement.PROTOCOL.name(), "micrometer", new ObservationExecChainHandler(registry))
.build();
ClassicHttpRequest request = new HttpGet("http://localhost:777/123");
try {
client.execute(request, response -> {
return null;
});
} catch (Exception e) {
e.printStackTrace();
}
System.out.println(meterRegistry.getMetersAsString());
}
}
Output:
httpcomponents.httpclient.request(TIMER)[error='HttpHostConnectException', exception='HttpHostConnectException', method='GET', outcome='UNKNOWN', status='IO_ERROR', target.host='UNKNOWN', target.port='UNKNOWN', target.scheme='UNKNOWN', uri='UNKNOWN']; count=1.0, total_time=0.0480618 seconds, max=0.0480618 seconds
httpcomponents.httpclient.request.active(LONG_TASK_TIMER)[exception='none', method='GET', outcome='UNKNOWN', status='CLIENT_ERROR', target.host='UNKNOWN', target.port='UNKNOWN', target.scheme='UNKNOWN', uri='UNKNOWN']; active_tasks=0.0, duration=0.0 seconds
Expected behavior
"target.host", "target.port",.... should be reported correctly
Metadata
Metadata
Assignees
Labels
enhancementA general enhancementA general enhancementinstrumentationAn issue that is related to instrumenting a componentAn issue that is related to instrumenting a componentmodule: micrometer-coreAn issue that is related to our core moduleAn issue that is related to our core module