diff --git a/integration-tests/opentelemetry/src/main/java/io/quarkus/it/opentelemetry/SimpleResource.java b/integration-tests/opentelemetry/src/main/java/io/quarkus/it/opentelemetry/SimpleResource.java index aa1ef41f604cd..5abc30290a410 100644 --- a/integration-tests/opentelemetry/src/main/java/io/quarkus/it/opentelemetry/SimpleResource.java +++ b/integration-tests/opentelemetry/src/main/java/io/quarkus/it/opentelemetry/SimpleResource.java @@ -144,6 +144,9 @@ public TraceData pathParameters(@PathParam("paramId") String paramId) { @Path("/exception") public String exception() { var exception = new RuntimeException("Exception!"); + StackTraceElement[] trimmedStackTrace = new StackTraceElement[2]; + System.arraycopy(exception.getStackTrace(), 0, trimmedStackTrace, 0, trimmedStackTrace.length); + exception.setStackTrace(trimmedStackTrace); LOG.error("Oh no {}", exception.getMessage(), exception); return "Oh no! An exception"; }