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
The Elastic Java APM automatically reports spans with http.response.status_code in the 4xx and 5xx ranges as errors in Kibana when using Spring Boot, which is extremely useful. Is this functionality something that could be incorporated into the OpenTelemetry (OTel) agent and/or APM server?
While it’s possible to manually record these errors (for instance, by using a ControllerAdvice and invoking Span#recordException()) it would be great to have behavior similar to the Elastic agent built-in.
The text was updated successfully, but these errors were encountered:
The Elastic Java APM automatically reports spans with http.response.status_code in the 4xx and 5xx ranges as errors in Kibana when using Spring Boot
The classic elastic APM agent doesn't automatically turn status codes into error-objects in the UI, at least to my knowledge.
The transaction is marked as failed for 5xx status codes automatically, but the same thing should be happening for for the opentelemetry agent.
I think the difference you are seeing come from exceptions raised by your controllers, which in turn are caught by spring and converted to corresponding status codes.
In the classic agent we have an instrumentation on spring level to preserve those exceptions from controllers and attach them to the transactions (which actually come from the Servlet-API instrumentation), this is why they appear as errors in the UI.
You can however achieve pretty much the same behaviour for the opentelemetry based agent:
By setting otel.instrumentation.common.experimental.controller-telemetry.enabled to true, you will get spans on the controller level in addition to the servlet-API root spans (= the transactions). If those spans (= the controller methods) end with exceptions, they will be recorded as errors.
Does this solve your problem already and give you the expected behaviour?
The Elastic Java APM automatically reports spans with
http.response.status_code
in the 4xx and 5xx ranges as errors inKibana
when usingSpring Boot
, which is extremely useful. Is this functionality something that could be incorporated into the OpenTelemetry (OTel) agent and/or APM server?While it’s possible to manually record these errors (for instance, by using a
ControllerAdvice
and invokingSpan#recordException()
) it would be great to have behavior similar to the Elastic agent built-in.The text was updated successfully, but these errors were encountered: