You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
OpenTelemetry client http span should contain the status_code attribute when an error response is returned.
Actual Behaviour
When either the low-level or the declarative Micronaut HTTP client call ends with an HttpClientResponseException, the client span will not contain any attributes derived from the HttpResponse, i.e. status code, content length, captured response headers or the error.type.
This happens because OpenTelemetryClientFilter passes null as response to the OpenTelemetry instrumenter when an exception was caught, even though the response object might be inside that exception in certain cases (HttpClientResponseException). In this case OpenTelemetry never sees the HttpResponse instance, thus cannot extract attributes from it.
Expected Behavior
OpenTelemetry client http span should contain the
status_code
attribute when an error response is returned.Actual Behaviour
When either the low-level or the declarative Micronaut HTTP client call ends with an
HttpClientResponseException
, the client span will not contain any attributes derived from the HttpResponse, i.e. status code, content length, captured response headers or theerror.type
.This happens because
OpenTelemetryClientFilter
passesnull
asresponse
to the OpenTelemetry instrumenter when an exception was caught, even though the response object might be inside that exception in certain cases (HttpClientResponseException
). In this case OpenTelemetry never sees theHttpResponse
instance, thus cannot extract attributes from it.Steps To Reproduce
Run the test added in this commit: lgathy@8a6b7db
Environment Information
Example Application
No response
Version
Micronaut Tracing 6.9.0
The text was updated successfully, but these errors were encountered: