- 前言
- 如何添加内容
- 如何配置动态数据
如何控制info端点。
info端点未显示任何内容。
配info 端点的内容
spring:
boot:
admin:
client:
url: http://127.0.0.1:18080
management:
endpoint:
health:
show-details: always
info:
enabled: true
endpoints:
web:
exposure:
include: "*"
enabled-by-default: true
info: #配置info信息
author: hello
version: @project.version@
appName: @project.artifactId@
group: it2
重启之后显示
实现InfoContributor的接口
@Component
public class InfoConfig implements InfoContributor {
@Override
public void contribute(Info.Builder builder) {
//单条信息
builder.withDetail("runtime:",System.currentTimeMillis());
//多条信息
Map map = new HashMap();
map.put("age","18");
map.put("name","小王");
builder.withDetails(map);
}
}
启动测试,可以看到自己设定的数据。



