SongZhang SongZhang - 2 months ago 35
HTTP Question

Monitor spring boot with actuator over http

When I use the default server address, I can get data from

localhost:8080/metrics
.

However when I set
server.address=172.20.7.24
in my application.properties, I can't get response from
172.20.7.24:8080/metrics
.

Answer

Try adding the following to your properties:

management.address=172.20.7.24

howto-change-the-http-port-or-address-of-the-actuator-endpoints:

78.1 Change the HTTP port or address of the actuator endpoints

In a standalone application the Actuator HTTP port defaults to the same as the main HTTP port. To make the application listen on a different port set the external property management.port. To listen on a completely different network address (e.g. if you have an internal network for management and an external one for user applications) you can also set management.address to a valid IP address that the server is able to bind to.