我试图在我的spring boot应用程序中公开/actuator/healthendpoint,但我的日志表明没有公开任何endpoint。我看过一些文档,其中指出健康endpoint是默认启用的唯一endpoint,但它为我返回404。
从应用程序启动的日志:
{"@timestamp":"2022-06-29T09:50:59.441+02:00","@version":1,"message":"Exposing 0 endpoint(s) beneath base path '/actuator'","logger_name":"org.springframework.boot.actuate.endpoint.web.EndpointLinksResolver","thread_name":"main","level":"INFO","level_value":20000,"caller_class_name":"org.springframework.boot.actuate.endpoint.web.EndpointLinksResolver","caller_method_name":"<init>","caller_file_name":"EndpointLinksResolver.java","caller_line_number":58}
访问 /actuator 还显示未公开任何endpoint:
{"_links":{"self":{"href":"http://localhost:8000/actuator","templated":false}}}
我看了其他几个类似的帖子,但是没有一个补丁对我有效。我在@RestController中也有自己的endpoint,我认为它可能会造成干扰,但是将其Post/Get-mappings注释掉也没有帮助。
我的pom.xml如下:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.6.6</version>
<relativePath />
</parent>
...
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
在我的application.yaml中,我尝试了以下方法:
server:
port: 8000
management:
health:
probes:
enabled: true
livenessstate:
enabled: true
readinessstate:
enabled: true
endpoint:
health:
probes:
enabled: true
show-details: always
enabled: true
endpoints:
web:
exposure:
include: '*'
enabled-by-default: true
application.yaml中的其他设置(如更改端口)工作正常,所以我知道application.yaml至少正在被使用。
有什么想法吗?
由于spring-boot 2x,这些endpoint被禁用,您需要启用它们。您可以尝试将以下内容添加到属性中:
endpoints:
enabled: false
health:
enabled: true
我也试过通过
management:
endpoint:
health:
enabled: true
但这在我部署它的平台上不起作用(WebLogic)
我正在使用spring Boot2.0.4,并希望公开我的执行器endpoint。当向application.yml仅添加以下信息时,健康状况将被公开。 当我运行http://localhost:8080/acturet时,我会得到
对于一些老客户,我们希望公开一些用于运行状况监视的指标。正在查看Spring启动应用程序,其中它公开了来自本地JVM的许多有用指标。如果我在服务器中单独安装冲刺 (sprint) 引导执行器应用程序,它是否可能从远程 JVM 公开所有这些信息?还有其他建议//替代路径是值得赞赏的吗?
此外,我还使用Hystrix进行断路。 我的问题是如何使Hystrix流暴露在执行器端口上? 目前,我仅通过以下代码在标准端口上公开它: 这些是我的一些依靠: 我不想使用Spring Cloud,因为这里有@EnableHystrix,它在执行器端口上提供流。
我在库中公开了一个方法,该方法返回一个CompletableFuture。该方法的计算发生在单线程执行器上,这是我的瓶颈,因此我不希望任何后续工作发生在同一个线程上 如果我使用返回“SupplySync”结果的简单方法,我将向调用者公开我宝贵的线程,调用者可能会添加同步操作(例如通过Accept),这可能会在该线程上花费一些CPU时间 复制如下: 这确实打印出: 我发现的一个解决方案是引入另一个执
问题内容: 我一直在研究Spring / Spring MVC应用程序,并且希望添加性能指标。我遇到过Spring Boot Actuator,它看起来是一个不错的解决方案。但是我的应用程序不是Spring Boot应用程序。我的应用程序在传统容器Tomcat 8中运行。 我添加了以下依赖 我创建了以下配置类。 我什至可以按照StackOverflow另一篇文章的建议在每个配置类上添加 问题答案:
基于48.3定制管理服务器端口 使用默认HTTP端口公开管理endpoint对于基于云的部署是一个明智的选择。但是,如果您的应用程序在您自己的数据中心内运行,您可能更愿意使用不同的HTTP端口公开endpoint。 有一个不同的端口让执行器健康endpoint运行的价值是什么?在什么样的场景下? 通常,一个端口用于所有服务endpoint是否足够好?在另一个上实现设置健康endpoint是否为标准