Croway opened a new pull request, #1929:
URL: https://github.com/apache/camel-spring-boot/pull/1929
## What
`CamelHealthHelper.applyHealthDetail` added the full stack trace of a failed
health check as
`error.stacktrace` to the per-check data at every exposure level except
`oneline`. With the default
`camel.health.exposure-level=default`, any DOWN check whose result carries
an exception — a consumer that
lost its broker, a pool that cannot connect — serialised the whole cause
chain into `/actuator/health`.
`error.stacktrace` is now emitted only when the exposure level is `full`.
## Why
* `error.message` is still reported at the `default` level, which is what
Spring Boot's own health
indicators expose (class and message, never a trace).
* It matches the other runtimes: camel-main's `ManagementHttpServer`
includes `error-stacktrace` only when
the caller asks for it with `?stackTrace=true`, and
camel-quarkus-microprofile-health never emits one.
* It matches the documented meaning of the levels: `full` is described as
including all details from all
the invoked health checks, and the stack trace is the most verbose detail
there is. The trace was added
in CAMEL-18832 to align the output with microprofile-health, but that
implementation does not carry one.
The trace is unchanged in the application log; no logging was added or
removed.
## Behaviour change and how to opt back in
At `camel.health.exposure-level=default` (the default) the actuator response
no longer contains
`<check-id>.data.error.stacktrace`. `error.message` is unchanged. To get the
trace back:
```properties
camel.health.exposure-level = full
```
Note that `full` also stops filtering health check metadata out of the
per-check data, so it is more
verbose than the previous default in other respects too. An upgrade guide
entry for this will be proposed
separately against `apache/camel`.
The diff is deliberately confined to the stack-trace gating, since
CAMEL-24512 changes the same method
(`error.message` overwritten when several checks are DOWN) under a different
assignee.
## Tests
New `CamelHealthHelperTest` builds a DOWN result carrying an exception plus
a detail and asserts:
* `default` — `error.message` present, `error.stacktrace` absent from the
check data;
* `full` — both present, the trace containing the exception message and
frames;
* `oneline` — no details at all.
`mvn test -pl core/camel-spring-boot
-Dtest='CamelHealthHelperTest,CamelHealthTest,CamelProbesTest'` →
Tests run: 5, Failures: 0, Errors: 0.
`core/camel-spring-boot/src/main/docs/spring-boot.json` was regenerated for
the clarified
`camel.health.exposure-level` description.
_Claude Code (Opus 5) on behalf of Federico Mariani_
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_018uGVoZ1upWLheUxbE4XfVy
--
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]