由于spirng boot2(或者叫spring cloud的版本)问题,现在弃用了之前1.5版本的配置写法,下面是新的配置方法
# 设置路由端点,查看json
#actuator 启用所有的监控端点 “*”号代表启用所有的监控端点,可以单独启用,例如,health,info,metrics
# spring boot 升为 2.0 后,为了安全,默认 Actuator 只暴露了2个端点,heath 和 info
management:
endpoints:
web:
exposure:
include: "*"
endpoint:
health:
show-details: ALWAYS
访问查看路由映射信息(端口是你项目的端口,启动类注解@SpringBootApplication
@EnableZuulProxy不要忘了):
http://localhost:8080/actuator/routes
http://localhost:8080/actuator/filters