通过 http 监控 spring 使用执行器启动
Monitor spring boot with actuator over http
当我使用默认服务器地址时,我可以从localhost:8080/metrics
获取数据。
然而,当我在 application.properties 中设置 server.address=172.20.7.24
时,我无法从 172.20.7.24:8080/metrics
.
获得响应
尝试将以下内容添加到您的属性中:
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.
当我使用默认服务器地址时,我可以从localhost:8080/metrics
获取数据。
然而,当我在 application.properties 中设置 server.address=172.20.7.24
时,我无法从 172.20.7.24:8080/metrics
.
尝试将以下内容添加到您的属性中:
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 setmanagement.address
to a valid IP address that the server is able to bind to.