如何启用在自定义启动器/库中设置的执行器端点?

问题描述

我有一个定制的启动器应用程序(库),该应用程序具有执行器和Prometheus依赖项

<dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
</dependency>

<dependency>
            <groupId>io.micrometer</groupId>
            <artifactId>micrometer-registry-prometheus</artifactId>
            <version>1.5.2</version>
</dependency>

在application.properties中

management.endpoints.web.exposure.include=health,info,metrics,prometheus

我正在其他应用程序中使用此启动程序,并且我也希望通过启动程序传递端点的此说明。 执行器和Prometheus依赖关系在应用程序中有效,但在启动器中未显示选定的端点。我也可以在应用程序中添加management.endpoints.web.exposure.include=health,prometheus一致的行,但是对于使用此启动程序的多个应用程序,我想全部传递一次,并且仅在需要时才在启动程序中更改端点。

您是否知道如何在我的应用中公开那些由启动器设置的端点?

Spring Boot v2.3.2 / Maven 3.6.3

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)