mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-11-18 15:43:10 +08:00
297c74d29c
Prior to this commit, exceptions recorded on the `ServerRequestObservationContext` by resolvers and exception handlers were present in metrics, but never called `Observation.error`, so tracing handlers left the server span unmarked. This adds `recordHandledException` on `ServerHttpObservationFilter` and `ServerRequestObservationContext`. It stores the exception on the request or exchange and the filter, or `HttpWebHandlerAdapter`, reports it once when the exchange completes. Spring MVC and WebFlux handlers and the documentation snippets now use it. Closes gh-37658