spring boot 之 actuator

依赖

<dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-actuator</artifactId>
</dependency>

actuator插件提供的端点汇总

端点 描述
autoconfig 获取自动配置信息
beans 获取spring bean基本信息
configprops 配置项信息
threaddump 获取当前线程基本信息
env 获取环境变量信息
health 获取健康检查信息
info 获取应用基本信息
metrics 获取性能指标信息
mappings 获取请求映射信息
trace 获取请求调用信息

使用http://{{host}}:{{port}}/actuator/{{endpoints}}即可访问相应端点下的信息

修改actuator插件默认端点的配置

主要是 endpoints 属性
例:

添加 spring-boot-starter-hateoas 依赖
<dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-hateoas</artifactId>
</dependency>

使用http://localhost:8762/actuator即可查看应用提供的端点列表,就不用记住有哪些端点

添加
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容