diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/SystemPublicMetrics.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/SystemPublicMetrics.java index 7e5f90f0c8..4713124287 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/SystemPublicMetrics.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/SystemPublicMetrics.java @@ -119,6 +119,8 @@ public class SystemPublicMetrics implements PublicMetrics, Ordered { (long) threadMxBean.getPeakThreadCount())); result.add(new Metric("threads.daemon", (long) threadMxBean.getDaemonThreadCount())); + result.add(new Metric("threads.totalStarted", + threadMxBean.getTotalStartedThreadCount())); result.add(new Metric("threads", (long) threadMxBean.getThreadCount())); } diff --git a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/SystemPublicMetricsTests.java b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/SystemPublicMetricsTests.java index 048db5c0d8..9c2ae63695 100644 --- a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/SystemPublicMetricsTests.java +++ b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/SystemPublicMetricsTests.java @@ -52,6 +52,7 @@ public class SystemPublicMetricsTests { assertTrue(results.containsKey("threads.peak")); assertTrue(results.containsKey("threads.daemon")); + assertTrue(results.containsKey("threads.totalStarted")); assertTrue(results.containsKey("threads")); assertTrue(results.containsKey("classes.loaded"));