oscerd opened a new pull request, #1898:
URL: https://github.com/apache/camel-spring-boot/pull/1898

   Two spots in the actuator output emit more than the surrounding code 
intends. Independent root causes,
   same area.
   
   ### 1. Health details always carried a full stack trace
   
   `CamelHealthHelper.applyHealthDetail()` builds its detail map under an 
`exposureLevel` check, but the
   `getError()` block that appends `error.stacktrace` sat **outside** that 
check, so the trace was added at the
   `default` exposure level too.
   
   The trace is now only emitted at `full`. At the default level the entry is 
replaced with `error.type`
   (the exception class name), which alongside the existing `error.message` 
still identifies the failure —
   this is roughly what Spring Boot's own indicators expose. The full trace 
remains in the server log.
   
   ### 2. Route detail view bypassed the `route.start.exception` filter
   
   `RouteEndpointInfo` annotates its properties map:
   
   ```java
   @JsonIgnoreProperties(value = {"route.start.exception"})
   private final Map<String, Object> properties;
   ```
   
   `RouteDetailsEndpointInfo` extends it but re-declared the same field without 
the annotation, plus a
   `getProperties()` override, so the detail operation serialised the property 
the base view filters.
   
   Both the annotation and the shadowing field arrived in the same commit under 
CAMEL-20993 — the filter was
   clearly intended, and the subclass field simply escaped it. The shadow and 
its getter are removed; the
   annotated base-class property is used instead.
   
   `route.start.exception` holds the actual `Throwable` 
(`InternalRouteStartupManager` puts it there), so
   Jackson was serialising the whole object graph — nested causes, every stack 
frame with class/file/line,
   classloader names and the JDK version.
   
   **No public API change:** `RouteDetailsEndpointInfo.getProperties()` was an 
override of a method the public
   base class `RouteEndpointInfo` also declares, so it stays available on the 
subclass by inheritance — source
   and binary compatible.
   
   ### Tests
   
   - `CamelHealthHelperExposureTest` — 3 cases: `full` keeps the trace, 
`default` omits it but still reports
     the exception type, and `error.message` is reported at both levels.
   - `CamelRoutesEndpointStartExceptionTest` — 2 cases over the existing 
`controlled-bar` fixture (a route that
     fails to start): neither the info nor the detail view serialises 
`route.start.exception`.
   
   Verified meaningful — the 2 defect cases fail against the unpatched code and 
pass with it; the info-view case
   passes either way, which also confirms `@JsonIgnoreProperties` genuinely 
filters map entries, so removing the
   shadow is sufficient. Full `core/camel-spring-boot` suite: 141 tests, 0 
failures.
   
   ---
   _Filed by Claude Code on behalf of Andrea Cosentino._


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to