Skip to content

CAMEL-24592: camel-microprofile-health - only expose health check stack traces in full exposure level - #26046

Merged
Croway merged 1 commit into
apache:mainfrom
Croway:CAMEL-24592-microprofile-health-stacktrace
Sep 2, 2026
Merged

CAMEL-24592: camel-microprofile-health - only expose health check stack traces in full exposure level#26046
Croway merged 1 commit into
apache:mainfrom
Croway:CAMEL-24592-microprofile-health-stacktrace

Conversation

@Croway

@Croway Croway commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

CamelMicroProfileHealthHelper.applyHealthDetail adds 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 serialises the whole cause chain into the health response at the default level.

error.stacktrace is now only added when camel.health.exposure-level is full. error.message is still reported at the default level. The trace is unchanged in the application log.

Why

  • It matches the documented meaning of the levels: full is the level that includes all details from the invoked health checks, and the stack trace is the most verbose detail there is.
  • It keeps the MicroProfile output aligned with the Spring Boot actuator, where the same gating is applied in CAMEL-24592: only expose health check stack traces in full exposure level camel-spring-boot#1929 (CAMEL-18832 originally aligned the two). Camel Quarkus builds its health responses through this module, so it inherits the change with no separate work.
  • camel-main's management endpoint is stricter still and includes error-stacktrace only 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 = full restores it.

Tests

testHealthCheckCheckedException and testExposureLevelDefault now assert the trace is absent at the default level; testExposureLevelFull keeps asserting it is present. mvn test -pl components/camel-microprofile/camel-microprofile-health is green.

Claude Code on behalf of Croway

…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>
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

🌟 Thank you for your contribution to the Apache Camel project! 🌟
🤖 CI automation will test this PR automatically.

🐫 Apache Camel Committers, please review the following items:

  • First-time contributors require MANUAL approval for the GitHub Actions to run
  • You can use the command /component-test (camel-)component-name1 (camel-)component-name2.. to request a test from the test bot although they are normally detected and executed by CI.
  • You can label PRs using skip-tests and test-dependents to fine-tune the checks executed by this PR.
  • Build and test logs are available in the summary page. Only Apache Camel committers have access to the summary.

⚠️ Be careful when sharing logs. Review their contents before sharing them publicly.

@gnodet gnodet left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

🧪 CI tested the following changed modules:

  • components/camel-microprofile/camel-microprofile-health
  • docs

🔬 Scalpel shadow comparison — Scalpel: 10 tested, 26 compile-only — current: 9 all tested

Maveniverse Scalpel detected 36 affected modules (current approach: 9).

⚠️ Modules only in Scalpel (27)
  • apache-camel
  • camel-allcomponents
  • camel-catalog
  • camel-catalog-console
  • camel-catalog-maven
  • camel-catalog-suggest
  • camel-componentdsl
  • camel-endpointdsl
  • camel-endpointdsl-support
  • camel-itest
  • camel-jbang-core
  • camel-jbang-it
  • camel-jbang-main
  • camel-jbang-plugin-edit
  • camel-jbang-plugin-generate
  • camel-jbang-plugin-kubernetes
  • camel-jbang-plugin-test
  • camel-kamelet-main
  • camel-launcher
  • camel-report-maven-plugin
  • camel-route-parser
  • camel-yaml-dsl
  • camel-yaml-dsl-deserializers
  • camel-yaml-dsl-maven-plugin
  • coverage
  • docs
  • dummy-component

Skip-tests mode would test 10 modules (2 direct + 8 downstream), skip tests for 26 (generated code, meta-modules)

Modules Scalpel would test (10)
  • camel-jbang-mcp
  • camel-jbang-plugin-mcp
  • camel-jbang-plugin-route-parser
  • camel-jbang-plugin-tui
  • camel-jbang-plugin-validate
  • camel-launcher-container
  • camel-microprofile-health
  • camel-yaml-dsl-validator
  • camel-yaml-dsl-validator-maven-plugin
  • docs
Modules with tests skipped (26)
  • apache-camel
  • camel-allcomponents
  • camel-catalog
  • camel-catalog-console
  • camel-catalog-maven
  • camel-catalog-suggest
  • camel-componentdsl
  • camel-endpointdsl
  • camel-endpointdsl-support
  • camel-itest
  • camel-jbang-core
  • camel-jbang-it
  • camel-jbang-main
  • camel-jbang-plugin-edit
  • camel-jbang-plugin-generate
  • camel-jbang-plugin-kubernetes
  • camel-jbang-plugin-test
  • camel-kamelet-main
  • camel-launcher
  • camel-report-maven-plugin
  • camel-route-parser
  • camel-yaml-dsl
  • camel-yaml-dsl-deserializers
  • camel-yaml-dsl-maven-plugin
  • coverage
  • dummy-component

ℹ️ Shadow mode — Scalpel observes but does not affect test execution. Learn more

All tested modules (36 modules)
  • Camel :: All Components Sync point
  • Camel :: Assembly
  • Camel :: Catalog :: Camel Catalog
  • Camel :: Catalog :: Camel Report Maven Plugin
  • Camel :: Catalog :: Camel Route Parser
  • Camel :: Catalog :: Console
  • Camel :: Catalog :: Dummy Component
  • Camel :: Catalog :: Maven
  • Camel :: Catalog :: Suggest
  • Camel :: Component DSL
  • Camel :: Coverage
  • Camel :: Docs
  • Camel :: Endpoint DSL
  • Camel :: Endpoint DSL :: Support
  • Camel :: Integration Tests
  • Camel :: JBang :: Core
  • Camel :: JBang :: Integration tests
  • Camel :: JBang :: MCP
  • Camel :: JBang :: Main
  • Camel :: JBang :: Plugin :: Edit
  • Camel :: JBang :: Plugin :: Generate
  • Camel :: JBang :: Plugin :: Kubernetes
  • Camel :: JBang :: Plugin :: MCP
  • Camel :: JBang :: Plugin :: Route Parser
  • Camel :: JBang :: Plugin :: TUI
  • Camel :: JBang :: Plugin :: Testing
  • Camel :: JBang :: Plugin :: Validate
  • Camel :: Kamelet Main
  • Camel :: Launcher
  • Camel :: Launcher :: Container
  • Camel :: MicroProfile :: Health
  • Camel :: YAML DSL
  • Camel :: YAML DSL :: Deserializers
  • Camel :: YAML DSL :: Maven Plugins
  • Camel :: YAML DSL :: Validator
  • Camel :: YAML DSL :: Validator Maven Plugin

⚙️ View full build and test results

@Croway
Croway merged commit 4bb91e7 into apache:main Sep 2, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants