aboutsummaryrefslogtreecommitdiffstats
path: root/cps-application/src/main/java/org/onap
diff options
context:
space:
mode:
authordanielhanrahan <daniel.hanrahan@est.tech>2025-01-23 15:07:06 +0000
committerdanielhanrahan <daniel.hanrahan@est.tech>2025-01-23 15:59:20 +0000
commit6f9ecc5cfc8ca48df55e4893b403e0d75f4cfc07 (patch)
treeb7c65c91167100fd927d3e7c3e7fdeda36436177 /cps-application/src/main/java/org/onap
parent31d8f390389b9078a2f0cddca3f4b4b1cd63753a (diff)
Expose JVM process metrics
Currently, Grafana only shows memory used inside the JVM, but not including memory used by the JVM process itself. These metrics are needed for determining real memory usage. Issue-ID: CPS-2583 Signed-off-by: danielhanrahan <daniel.hanrahan@est.tech> Change-Id: Ib77f9057c7301ea5afc2a621526736213ddd817a
Diffstat (limited to 'cps-application/src/main/java/org/onap')
-rw-r--r--cps-application/src/main/java/org/onap/cps/config/MicroMeterConfig.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/cps-application/src/main/java/org/onap/cps/config/MicroMeterConfig.java b/cps-application/src/main/java/org/onap/cps/config/MicroMeterConfig.java
index d169c61ad6..8481eadf1b 100644
--- a/cps-application/src/main/java/org/onap/cps/config/MicroMeterConfig.java
+++ b/cps-application/src/main/java/org/onap/cps/config/MicroMeterConfig.java
@@ -21,9 +21,12 @@
package org.onap.cps.config;
import com.hazelcast.map.IMap;
+import io.github.mweirauch.micrometer.jvm.extras.ProcessMemoryMetrics;
+import io.github.mweirauch.micrometer.jvm.extras.ProcessThreadMetrics;
import io.micrometer.core.aop.TimedAspect;
import io.micrometer.core.instrument.Gauge;
import io.micrometer.core.instrument.MeterRegistry;
+import io.micrometer.core.instrument.binder.MeterBinder;
import lombok.RequiredArgsConstructor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@@ -41,6 +44,16 @@ public class MicroMeterConfig {
return new TimedAspect(meterRegistry);
}
+ @Bean
+ public MeterBinder processMemoryMetrics() {
+ return new ProcessMemoryMetrics();
+ }
+
+ @Bean
+ public MeterBinder processThreadMetrics() {
+ return new ProcessThreadMetrics();
+ }
+
/**
* Register gauge metric for cm handles with state 'advised'.
*