Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,11 @@ public static void applyHealthDetail(HealthCheckResponseBuilder builder, Result
result.getError().ifPresent(error -> {
builder.withData("error.message", error.getMessage());

final String s = ExceptionHelper.stackTraceToString(error);
builder.withData("error.stacktrace", s);
// the stack trace is the most verbose detail there is, so only expose it in the full level
if (exposureLevel.equals("full")) {
final String s = ExceptionHelper.stackTraceToString(error);
builder.withData("error.stacktrace", s);
}
});
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,8 @@ protected void doCall(HealthCheckResultBuilder builder, Map<String, Object> opti

assertHealthCheckOutput("exception-check", Status.DOWN, checks.getJsonObject(0), jsonObject -> {
assertEquals(errorMessage, jsonObject.getString("error.message"));
assertNotNull(jsonObject.getString("error.stacktrace"));
// the stack trace is only exposed in the full level
assertFalse(jsonObject.containsKey("error.stacktrace"));
});
}

Expand Down Expand Up @@ -359,7 +360,8 @@ protected void doCall(HealthCheckResultBuilder builder, Map<String, Object> opti
assertHealthCheckOutput("failing-check", HealthCheckResponse.Status.DOWN, failedCheck, result -> {
assertNotNull(result);
assertEquals("Forced exception", result.getString("error.message"));
assertNotNull(result.getString("error.stacktrace"));
// the stack trace is only exposed in the full level
assertFalse(result.containsKey("error.stacktrace"));
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1145,6 +1145,22 @@ A custom `CamelSagaService` that relies on the header to join sagas started by a
override the new method. Everything else is unaffected: the header is still set on the exchange, and
routes reading it continue to work.

=== camel-microprofile-health

The `error.stacktrace` entry of a failed health check is now only included in the response when
`camel.health.exposure-level` is `full`. At the `default` level the check still reports `error.message`, but no
longer serialises the whole cause chain of the exception into the health response. The trace is unchanged in the
application log.

This aligns the MicroProfile health output (and therefore Camel Quarkus, which builds its health responses through
this module) with the Spring Boot actuator and with the documented meaning of the levels, where `full` is the
level that includes all details from the invoked health checks. To get the trace back in the response:

[source,properties]
----
camel.health.exposure-level = full
----

=== camel-spring-boot

A set of starter defaults changed in this release. Each is a deliberate change to what an application gets
Expand Down