springBoot2.0的actuator配置

springboot2.0版本默认不会将所有断点暴露,需要以下配置:

#actuator端口
management.server.port=8310
 
#修改访问路径,2.0之前默认是/,2.0默认是/actuator
management.endpoints.web.base-path=/actuator
 
#开放所有页面节点 ,默认只开启了health、info两个节点
management.endpoints.web.exposure.include=*
 
#显示健康具体信息,默认不会显示详细信息  

management.endpoint.health.show-details=always

配置后日志信息如下:

Exposing 14 endpoint(s) beneath base path '/actuator'
Mapped "{[/actuator/auditevents],methods=[GET]
Mapped "{[/actuator/beans],methods=[GET]
Mapped "{[/actuator/health],methods=[GET]
Mapped "{[/actuator/conditions],methods=[GET]
Mapped "{[/actuator/configprops],methods=[GET]
Mapped "{[/actuator/env],methods=[GET]
Mapped "{[/actuator/env/{toMatch}],methods=[GET]
Mapped "{[/actuator/info],methods=[GET]
Mapped "{[/actuator/loggers],methods=[GET]
Mapped "{[/actuator/loggers/{name}],methods=[GET]
Mapped "{[/actuator/loggers/{name}],methods=[POST]
Mapped "{[/actuator/heapdump],methods=[GET]
Mapped "{[/actuator/threaddump],methods=[GET]
Mapped "{[/actuator/metrics],methods=[GET]
Mapped "{[/actuator/metrics/{requiredMetricName}],methods=[GET]
Mapped "{[/actuator/scheduledtasks],methods=[GET]
Mapped "{[/actuator/httptrace],methods=[GET]
Mapped "{[/actuator/mappings],methods=[GET]
Mapped "{[/actuator],methods=[GET]

所有断点都暴露出来了。

猜你喜欢

转载自blog.csdn.net/qq_28060549/article/details/88355488