diff --git a/spring-bootstrap-service/src/main/java/org/springframework/bootstrap/service/properties/EndpointsProperties.java b/spring-bootstrap-service/src/main/java/org/springframework/bootstrap/service/properties/EndpointsProperties.java index ff11ad0a63..608cc8f3a2 100644 --- a/spring-bootstrap-service/src/main/java/org/springframework/bootstrap/service/properties/EndpointsProperties.java +++ b/spring-bootstrap-service/src/main/java/org/springframework/bootstrap/service/properties/EndpointsProperties.java @@ -45,6 +45,9 @@ public class EndpointsProperties { @Valid private Endpoint trace = new Endpoint("/trace"); + @Valid + private Endpoint dump = new Endpoint("/dump"); + public Endpoint getVarz() { return this.varz; } @@ -65,6 +68,10 @@ public class EndpointsProperties { return this.trace; } + public Endpoint getDump() { + return this.dump; + } + public static class Endpoint { @NotNull diff --git a/spring-bootstrap-service/src/main/java/org/springframework/bootstrap/service/trace/TraceEndpoint.java b/spring-bootstrap-service/src/main/java/org/springframework/bootstrap/service/trace/TraceEndpoint.java index 79059b3f23..2e54d2594e 100644 --- a/spring-bootstrap-service/src/main/java/org/springframework/bootstrap/service/trace/TraceEndpoint.java +++ b/spring-bootstrap-service/src/main/java/org/springframework/bootstrap/service/trace/TraceEndpoint.java @@ -16,6 +16,9 @@ package org.springframework.bootstrap.service.trace; +import java.lang.management.ManagementFactory; +import java.lang.management.ThreadInfo; +import java.util.Arrays; import java.util.List; import org.springframework.stereotype.Controller; @@ -44,4 +47,11 @@ public class TraceEndpoint { return this.tracer.traces(); } + @RequestMapping("${endpoints.dump.path:/dump}") + @ResponseBody + public List dump() { + return Arrays.asList(ManagementFactory.getThreadMXBean().dumpAllThreads(true, + true)); + } + }