You can choose to manage and monitor your application by using HTTP endpoints or with JMX. Auditing, health, and metrics gathering can also be automatically applied to your application
1 | <dependencies> |
exposing endpoints
1 | management.endpoints.web.exposure.include=* |
注意有JMX和web的两种不同类型
CORS Support
1 | management.endpoints.web.cors.allowed-origins=http://example.com |
实现一些自定义的endpoints
You can also write technology-specific endpoints by using @JmxEndpoint
or @WebEndpoint
. These endpoints are restricted to their respective technologies. For example, @WebEndpoint
is exposed only over HTTP and not over JMX.
You can write technology-specific extensions by using @EndpointWebExtension
and @EndpointJmxExtension
. These annotations let you provide technology-specific operations to augment an existing endpoint.
To provide custom health information, you can register Spring beans that implement the HealthIndicator
interface. You need to provide an implementation of the health()
method and return a Health
response.
1 | import org.springframework.boot.actuate.health.Health; |
引出来一个reactive health indicators部分,如何监控
1 |
|
类似流式的方式
http的management配置
1 | management.server.port=8081 |
Jmx的配置
1 | spring.jmx.unique-names=true |