简体   繁体   中英

Spring Boot Actuator Return All Metrics In One Request

Is it possible to return all the actuator's metrics data in one request? When I make a GET request to /actuator/metrics it returns a list of variables.
I don't want to make a new request for every single variable each time.

When your application is booting, It tells you which all endpoints are available, Something like this.

 Mapped "{[/configprops || /configprops.json],
 Mapped "{[/health || /health.json],
 Mapped "{[/beans || /beans.json],

These all are the endpoints avalaible in Actuator. For more you can see the documentation. Check for section Endpoints , https://docs.spring.io/spring-boot/docs/current-SNAPSHOT/reference/htmlsingle/

If there is not any relevant endpoint available for your requirement, can always write a customize one.

First, permitting the Prometheus endpoint in the configuration file (this example is with application.yml ):

endpoint:
  prometheus:
    enabled: true

Then, you can get all the information about all the variables in one (huge) result (this example with local server):

http://localhost:7776/actuator/prometheus

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM