summaryrefslogtreecommitdiffstats
path: root/runtime-controlloop/src/main
diff options
context:
space:
mode:
authorFrancescoFioraEst <francesco.fiora@est.tech>2021-08-24 12:55:16 +0100
committerFrancescoFioraEst <francesco.fiora@est.tech>2021-08-30 13:53:56 +0100
commit13533270bb8498fce76a3d7b685b1a0f6d057d71 (patch)
treebb5de2568d3642e1529920b8040f248af25ab468 /runtime-controlloop/src/main
parente1d67de22d0bf9fe50c16ee6bc1e50310e74d4fa (diff)
Export basic prometheus metrics from clamp
POLICY-3557: Export basic prometheus metrics from clamp Change-Id: Ica71d089255e2a8881f668ceeb578993996f9a38 Signed-off-by: FrancescoFioraEst <francesco.fiora@est.tech>
Diffstat (limited to 'runtime-controlloop/src/main')
-rw-r--r--runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/config/ConverterConfiguration.java7
-rw-r--r--runtime-controlloop/src/main/resources/application.yaml6
2 files changed, 13 insertions, 0 deletions
diff --git a/runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/config/ConverterConfiguration.java b/runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/config/ConverterConfiguration.java
index ee0461994..b14c675df 100644
--- a/runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/config/ConverterConfiguration.java
+++ b/runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/config/ConverterConfiguration.java
@@ -20,9 +20,12 @@
package org.onap.policy.clamp.controlloop.runtime.config;
+import java.util.Arrays;
import java.util.List;
import org.springframework.context.annotation.Configuration;
+import org.springframework.http.MediaType;
import org.springframework.http.converter.HttpMessageConverter;
+import org.springframework.http.converter.StringHttpMessageConverter;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Configuration
@@ -32,5 +35,9 @@ public class ConverterConfiguration implements WebMvcConfigurer {
public void extendMessageConverters(List<HttpMessageConverter<?>> converters) {
converters.add(new CoderHttpMesageConverter<>("yaml"));
converters.add(new CoderHttpMesageConverter<>("json"));
+
+ StringHttpMessageConverter converter = new StringHttpMessageConverter();
+ converter.setSupportedMediaTypes(Arrays.asList(MediaType.TEXT_PLAIN));
+ converters.add(converter);
}
}
diff --git a/runtime-controlloop/src/main/resources/application.yaml b/runtime-controlloop/src/main/resources/application.yaml
index ea98aaa8c..cddb3d0fb 100644
--- a/runtime-controlloop/src/main/resources/application.yaml
+++ b/runtime-controlloop/src/main/resources/application.yaml
@@ -50,3 +50,9 @@ runtime:
servers:
- ${topicServer:localhost}
topicCommInfrastructure: dmaap
+
+management:
+ endpoints:
+ web:
+ exposure:
+ include: health, metrics, prometheus