From 8e3b1e773ee4a58115d25be8016546ef1bd44f02 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Al=C5=BEbeta=20Hajn=C3=A1?= <xhajna@fi.muni.cz>
Date: Mon, 1 May 2023 11:23:36 +0200
Subject: [PATCH] feat: actuator info + env

---
 .../muni/pa165/actuator/CustomInfoContributor.java  | 13 +++++++++++++
 core/src/main/resources/application.properties      |  9 +++++++--
 2 files changed, 20 insertions(+), 2 deletions(-)
 create mode 100644 core/src/main/java/cz/muni/pa165/actuator/CustomInfoContributor.java

diff --git a/core/src/main/java/cz/muni/pa165/actuator/CustomInfoContributor.java b/core/src/main/java/cz/muni/pa165/actuator/CustomInfoContributor.java
new file mode 100644
index 0000000..7977bb3
--- /dev/null
+++ b/core/src/main/java/cz/muni/pa165/actuator/CustomInfoContributor.java
@@ -0,0 +1,13 @@
+package cz.muni.pa165.actuator;
+
+import org.springframework.boot.actuate.info.Info;
+import org.springframework.boot.actuate.info.InfoContributor;
+import org.springframework.stereotype.Component;
+
+@Component
+public class CustomInfoContributor implements InfoContributor {
+    @Override
+    public void contribute(Info.Builder builder) {
+        builder.withDetail("course", "PA165").withDetail("module", "core").build();
+    }
+}
diff --git a/core/src/main/resources/application.properties b/core/src/main/resources/application.properties
index bc2a344..cd1c97b 100644
--- a/core/src/main/resources/application.properties
+++ b/core/src/main/resources/application.properties
@@ -13,7 +13,12 @@ spring.cache.type=NONE
 spring.profiles.active=dev
 appconfig.enablecache=false
 
-management.endpoints.web.exposure.include=info,health,metrics,loggers,beans
+management.endpoints.web.exposure.include=info,health,metrics,loggers,beans,env
 management.endpoint.health.show-details=always
 management.endpoint.health.show-components=always
-management.endpoint.health.probes.enabled=true
\ No newline at end of file
+management.endpoint.health.probes.enabled=true
+
+management.info.env.enabled=true
+info.app.encoding=UTF-8
+info.app.java.source=17
+info.app.java.target=17
\ No newline at end of file
-- 
GitLab