File tree 5 files changed +26
-15
lines changed
lab-34/lab-34-actuator-demo-info
java/cn/iocoder/springboot/lab34/actuatordemo
5 files changed +26
-15
lines changed Original file line number Diff line number Diff line change 1
1
package cn .iocoder .springboot .lab34 .actuatordemo .config ;
2
2
3
3
import org .springframework .boot .actuate .info .InfoContributor ;
4
+ import org .springframework .boot .actuate .info .MapInfoContributor ;
4
5
import org .springframework .boot .actuate .info .SimpleInfoContributor ;
5
6
import org .springframework .context .annotation .Bean ;
7
+ import org .springframework .context .annotation .Configuration ;
6
8
7
9
import java .util .Collections ;
8
10
9
- // @Configuration
11
+ @ Configuration
10
12
public class ActuateConfig {
11
13
12
14
@ Bean
@@ -15,4 +17,9 @@ public InfoContributor exampleInfo() {
15
17
Collections .singletonMap ("key" , "value" ));
16
18
}
17
19
20
+ @ Bean
21
+ public InfoContributor exampleInfo02 () {
22
+ return new MapInfoContributor (Collections .singletonMap ("example02" , "nicai" ));
23
+ }
24
+
18
25
}
Original file line number Diff line number Diff line change 2
2
3
3
import org .springframework .boot .actuate .info .Info ;
4
4
import org .springframework .boot .actuate .info .InfoContributor ;
5
+ import org .springframework .stereotype .Component ;
5
6
6
7
import java .util .Collections ;
7
8
8
- // @Component
9
+ @ Component
9
10
public class DemoInfoContributor implements InfoContributor {
10
11
11
12
@ Override
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -4,14 +4,16 @@ management:
4
4
info :
5
5
enabled : true # 是否开启。默认为 true 开启。
6
6
info :
7
- #
8
- git :
7
+ # EnvironmentInfoContributor 的配置项
8
+ env :
9
9
enabled : true
10
- mode : full
10
+ # BuildInfoContributor 的配置属性
11
11
build :
12
12
enabled : true
13
- env :
13
+ # GitInfoContributor 的配置属性
14
+ git :
14
15
enabled : true
16
+ mode : SIMPLE # Git 信息展示模式。SIMPLE 默认,只展示精简的 Git 版本信息;FULL 模式,展示完整的 Git 版本信息。
15
17
16
18
endpoints :
17
19
# Actuator HTTP 配置项,对应 WebEndpointProperties 配置类
@@ -20,12 +22,12 @@ management:
20
22
exposure :
21
23
include : ' *' # 需要开放的端点。默认值只打开 health 和 info 两个端点。通过设置 * ,可以开放所有端点。
22
24
exclude : # 在 include 的基础上,需要排除的端点。通过设置 * ,可以排除所有端点。
23
- #
25
+
26
+ # info 配置项
24
27
info :
25
28
app :
26
29
java :
27
30
source : @java.version@
28
31
target : @java.version@
29
32
encoding : UTF-8
30
33
version : @project.version@
31
-
Original file line number Diff line number Diff line change @@ -4,14 +4,16 @@ management:
4
4
info :
5
5
enabled : true # 是否开启。默认为 true 开启。
6
6
info :
7
- #
8
- git :
7
+ # EnvironmentInfoContributor 的配置项
8
+ env :
9
9
enabled : true
10
- mode : full
10
+ # BuildInfoContributor 的配置属性
11
11
build :
12
12
enabled : true
13
- env :
13
+ # GitInfoContributor 的配置属性
14
+ git :
14
15
enabled : true
16
+ mode : SIMPLE # Git 信息展示模式。SIMPLE 默认,只展示精简的 Git 版本信息;FULL 模式,展示完整的 Git 版本信息。
15
17
16
18
endpoints :
17
19
# Actuator HTTP 配置项,对应 WebEndpointProperties 配置类
@@ -20,12 +22,12 @@ management:
20
22
exposure :
21
23
include : ' *' # 需要开放的端点。默认值只打开 health 和 info 两个端点。通过设置 * ,可以开放所有端点。
22
24
exclude : # 在 include 的基础上,需要排除的端点。通过设置 * ,可以排除所有端点。
23
- #
25
+
26
+ # info 配置项
24
27
info :
25
28
app :
26
29
java :
27
30
source : 1.8.0_144
28
31
target : 1.8.0_144
29
32
encoding : UTF-8
30
33
version : 2.2.2.RELEASE
31
-
You can’t perform that action at this time.
0 commit comments