When I use the new MetricsFeature introduced in
CXF-8213, the metrics look like this in positive cases:
In this case, Message.RESPONSE_CODE is null when the MetricsMessageOutInterceptor is called.
In success cases, this Message attribute is set in the MessageSenderEndingInterceptor when AbstractHTTPDestination.getResponseCodeFromMessage() is called.
MetricsMessageOutInterceptor is called before that interceptor, that's why Message.RESPONSE_CODE is not set.
There are 2 solution options, as far as I understand:
- Move the MetricsMessageOutInterceptor after the MessageSenderEndingInterceptor (the consequences of that are unknown to me)
- Adjust the StandardTags.status() method to treat null values as 200
There's also another problem of the faultCode being LOGICAL_RUNTIME_FAULT in my success cases. This is because the MAPAggregatorImpl always calls exchange.setOutFaultMessage(). The code inside of JaxwsFaultCodeProvider.getFaultCode() assumes that ex.getOutFaultMessage() != null indicates a Fault.