我有 Spring MVC Web 应用程序。我通过添加如下依赖项在其中使用了弹簧启动执行器。
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-actuator</artifactId>
<version>1.4.0.RELEASE</version>
</dependency>
在我的配置文件中,我导入了如下类。
@Configuration
@ComponentScan({"com.test.*"})
@Import({EndpointWebMvcAutoConfiguration.class,
ManagementServerPropertiesAutoConfiguration.class, EndpointAutoConfiguration.class,
HealthIndicatorAutoConfiguration.class,PublicMetricsAutoConfiguration.class})
@EnableWebMvc
@PropertySource("classpath:appconfig.properties")
public class SpringWebConfig extends WebMvcConfigurerAdapter {
}
现在,当我点击网址“ http://localhost:8080/health ”时,我得到了响应
{"status":"UP","diskSpace":{"status":"UP","total":493767094272,"free":417100754944,"threshold":10485760}}
所以,这很完美。现在我的问题是如何将此 Spring MVC Web 应用程序注册到 spring-boot-admin 服务器。
谁能帮我 ?