【发布时间】:2021-08-25 18:26:47
【问题描述】:
我正在尝试在我的 grails 3.3.11 rest-api 应用程序中配置 Spring boot actuator,以便获得有关它的运行状况信息。但是当我访问 {base_url}/cmbid/actuator/health 时,我会收到这样的 404 响应
2021-08-25 15:13:18.980 WARN --- [nio-8081-exec-1] o.s.web.servlet.PageNotFound : No mapping found for HTTP request with URI [/cmbid/actuator/health] in DispatcherServlet with name 'grailsDispatcherServlet'
下面,我可以向您展示一些相关信息。 Grails 版本 3.3.11 这是一个rest-api配置文件应用程序
在我的 build.gradle 文件中我是这样配置的
dependencies {
compile "org.springframework.boot:spring-boot-starter-actuator"
}
在我的 application.yml 文件中我是这样配置的。
endpoints:
health:
enabled: true
web:
exposure:
include: health
jmx:
enabled: true
unique-names: true
我不知道问题出在哪里,但在我的 grails 4.0.3 中它按预期工作。唯一的区别是,在 Grails 4.0.3 中,application.yml 有一个管理条目,就像这样。
management:
endpoints:
enabled-by-default: true
endpoint:
health:
show-details : always
我从 grails 3.3.11 应用程序中删除了管理条目,因为它不起作用,而且我在 Internet 文档中看到,如果您将端点条目放在 application.yml 的根目录中,它将起作用。
很遗憾,我不知道发生了什么。
你能帮帮我吗?
【问题讨论】:
标签: spring-boot grails spring-boot-actuator