【问题标题】:How to expose /actuator/startup endpoint?如何暴露 /actuator/startup 端点?
【发布时间】:2021-11-17 19:41:21
【问题描述】:

我正在尝试公开 3 个端点:

  1. actuator/health/liveness
  2. actuator/health/readiness
  3. actuator/startup

添加management.endpoint.health.probes.enabled=true 我的application.properties 适用于 1. 和 2。在这种情况下,我收到信息消息““在基本路径 '/actuator' 下暴露 2 个端点”。

仅使用 management.endpoints.web.exposure.include=startup 也不起作用。我收到信息消息“”在基本路径'/执行器'下暴露 1 个端点”。

如何公开 3r 端点?

我已经将BufferingApplicationStartup 用作ApplicationStartup,并在测试时同时使用GET 和POST 来请求执行器/启动。

【问题讨论】:

    标签: spring spring-boot-actuator health-check


    【解决方案1】:

    下面的配置应该可以做到:

    management.endpoint.health.probes.enabled=true
    management.endpoints.web.exposure.include=health,startup
    

    假设您的主要课程如下所示:

    @SpringBootApplication
    public class ActuatorEndpointApplication {
        public static void main(String[] args) {
                SpringApplication app = new SpringApplication(ActuatorEndpointApplication.class);
                app.setApplicationStartup(new BufferingApplicationStartup(2048));
                app.run(args);
        }
    }
    

    【讨论】:

    • 应该,但没有
    • 您使用的是哪个 Spring Boot 版本?
    猜你喜欢
    • 2018-08-11
    • 2012-04-26
    • 1970-01-01
    • 2013-02-22
    • 2020-01-15
    • 2016-02-07
    • 2019-07-09
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多