Skip to content

Commit

Permalink
Enable ProcessInfoContributor
Browse files Browse the repository at this point in the history
  • Loading branch information
jonatan-ivanov committed Aug 20, 2024
1 parent 47116df commit d9331d8
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ public void contribute(Builder builder) {

builder.withDetail("runtime", ImmutableMap.builder()
.put("memory", memoryInfo())
.put("cpu", cpuInfo())
.put("java", javaInfo())
.put("gcs", gcInfo())
.put("user", userInfo())
.put("network", networkInfo())
Expand All @@ -59,22 +57,6 @@ private Map<String, Object> memoryInfo() {
.build();
}

private Map<String, Object> cpuInfo() {
return ImmutableMap.<String, Object>builder()
.put("availableProcessors", Runtime.getRuntime().availableProcessors())
.build();
}

private Map<String, Object> javaInfo() {
return ImmutableMap.<String, Object>builder()
.put("class.version", System.getProperty("java.class.version"))
.put("version", System.getProperty("java.version"))
.put("version.date", System.getProperty("java.version.date"))
.put("compilation.name", ManagementFactory.getCompilationMXBean().getName())
.put("file.encoding", System.getProperty("file.encoding"))
.build();
}

private List<Map<String, Object>> gcInfo() {
return ManagementFactory.getGarbageCollectorMXBeans().stream()
.map(this::toInfoObject).toList();
Expand Down
1 change: 1 addition & 0 deletions eureka/src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ management.endpoint.env.show-values=always
management.info.env.enabled=true
management.info.java.enabled=true
management.info.os.enabled=true
management.info.process.enabled=true

spring.cloud.discovery.client.composite-indicator.enabled=false

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ management.endpoint.env.show-values=always
management.info.env.enabled=true
management.info.java.enabled=true
management.info.os.enabled=true
management.info.process.enabled=true

spring.cloud.discovery.client.composite-indicator.enabled=false

Expand Down
1 change: 1 addition & 0 deletions tea-service/src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ management.endpoint.env.show-values=always
management.info.env.enabled=true
management.info.java.enabled=true
management.info.os.enabled=true
management.info.process.enabled=true

spring.cloud.discovery.client.composite-indicator.enabled=false

Expand Down
1 change: 1 addition & 0 deletions tealeaf-service/src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ management.endpoint.env.show-values=always
management.info.env.enabled=true
management.info.java.enabled=true
management.info.os.enabled=true
management.info.process.enabled=true

spring.cloud.discovery.client.composite-indicator.enabled=false

Expand Down
1 change: 1 addition & 0 deletions water-service/src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ management.endpoint.env.show-values=always
management.info.env.enabled=true
management.info.java.enabled=true
management.info.os.enabled=true
management.info.process.enabled=true

spring.cloud.discovery.client.composite-indicator.enabled=false

Expand Down

0 comments on commit d9331d8

Please sign in to comment.