Java Spring Boot Actuator Metrics system load average returning -1

ramon_cisco Source

I am a new user to Spring Boot Actuator Metrics, I need to determine the CPU utilization of the system. The /metrics url does give me rest of the details, however the systemload.average returns -1 (if load average is not available -1 is returned). Could you let me know where I went wrong and how do I correct it? I am using maven and Eclipse IDE (Mars). I am accessing metric details on localhost itself. the url is http://localhost:8080/details/metrics (details used for context path)

Here is my code: file package spring.boot.admin.actuator;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.PropertySource;

@PropertySource(value = "")
public class Application{

public static void main(final String[] args) {, args);

POM File"> 4.0.0







** file**


endpoints.server.enabled=true Actuator Example Actuator Working Examples

The enter image description here



answered 2 years ago Wim Deblauwe #1

The systemload.average returns what the JVM returns through the OperatingSystem MBean (Available in the java.lang tree node). Use JConsole or the VisualVM-Beans plugin in VisualVM to view what is returned there.

If the value of the SystemLoadAverage attribute is the same, it is no bug in Spring Boot or your usage of Spring Boot.

comments powered by Disqus