CAMEL-24592: camel-microprofile-health - only expose health check stack traces in full exposure level - #26046
Conversation
…ck traces in full exposure level CamelMicroProfileHealthHelper.applyHealthDetail added the full stack trace of a failed health check as error.stacktrace at every exposure level except oneline, so a DOWN check whose result carries an exception serialised the whole cause chain into the health response at the default level. error.stacktrace is now added only when the exposure level is full, matching the documented meaning of the levels, where full is the level that includes all details from the invoked health checks. error.message is still reported at the default level and the trace is unchanged in the application log. The same gating is applied to the Spring Boot actuator in camel-spring-boot so the runtimes stay aligned; Camel Quarkus builds its health responses through this module and inherits the change. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
gnodet
left a comment
There was a problem hiding this comment.
Clean, minimal behavior change that gates error.stacktrace in MicroProfile health responses behind the full exposure level, aligning it with both HealthDevConsole (which already gates stack traces behind "full" at line 87) and the documented meaning of the levels. Well-tested and properly documented in the upgrade guide.
The resulting exposure-level ladder is clean and intuitive: oneline = no details; default = error message + non-meta details, no stack trace; full = everything including stack trace.
📋 PR Metadata
| Aspect | Current | Suggested |
|---|---|---|
| Labels | components, docs |
+ enhancement |
| Milestone | (none) | 4.23.0 |
This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.
Claude Code on behalf of Guillaume Nodet
|
🧪 CI tested the following changed modules:
🔬 Scalpel shadow comparison — Scalpel: 10 tested, 26 compile-only — current: 9 all testedMaveniverse Scalpel detected 36 affected modules (current approach: 9).
|
CamelMicroProfileHealthHelper.applyHealthDetailadds the full stack trace of a failed health check aserror.stacktraceat every exposure level exceptoneline, so a DOWN check whose result carries an exception serialises the whole cause chain into the health response at the default level.error.stacktraceis now only added whencamel.health.exposure-levelisfull.error.messageis still reported at thedefaultlevel. The trace is unchanged in the application log.Why
fullis the level that includes all details from the invoked health checks, and the stack trace is the most verbose detail there is.error-stacktraceonly when the caller asks for it with?stackTrace=true.Behaviour change
At the default exposure level the response no longer contains
error.stacktrace. Documented in the 4.23 upgrade guide;camel.health.exposure-level = fullrestores it.Tests
testHealthCheckCheckedExceptionandtestExposureLevelDefaultnow assert the trace is absent at the default level;testExposureLevelFullkeeps asserting it is present.mvn test -pl components/camel-microprofile/camel-microprofile-healthis green.Claude Code on behalf of Croway