diff options
Diffstat (limited to 'participant/participant-impl/participant-impl-acelement/src/main')
3 files changed, 19 insertions, 9 deletions
diff --git a/participant/participant-impl/participant-impl-acelement/src/main/java/org/onap/policy/clamp/acm/element/config/MicrometerConfig.java b/participant/participant-impl/participant-impl-acelement/src/main/java/org/onap/policy/clamp/acm/element/config/MicrometerConfig.java index 8e83a7739..d34b34add 100644 --- a/participant/participant-impl/participant-impl-acelement/src/main/java/org/onap/policy/clamp/acm/element/config/MicrometerConfig.java +++ b/participant/participant-impl/participant-impl-acelement/src/main/java/org/onap/policy/clamp/acm/element/config/MicrometerConfig.java @@ -22,12 +22,23 @@ package org.onap.policy.clamp.acm.element.config; import io.micrometer.core.aop.TimedAspect; import io.micrometer.core.instrument.MeterRegistry; +import org.springframework.beans.factory.InitializingBean; +import org.springframework.beans.factory.config.BeanPostProcessor; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @Configuration public class MicrometerConfig { + /** + * Load up the metrics registry. + */ + @Bean + public InitializingBean forcePrometheusPostProcessor(BeanPostProcessor meterRegistryPostProcessor, + MeterRegistry registry) { + return () -> meterRegistryPostProcessor.postProcessAfterInitialization(registry, ""); + } + @Bean public TimedAspect timedAspect(MeterRegistry registry) { return new TimedAspect(registry); diff --git a/participant/participant-impl/participant-impl-acelement/src/main/java/org/onap/policy/clamp/acm/element/main/rest/AbstractRestController.java b/participant/participant-impl/participant-impl-acelement/src/main/java/org/onap/policy/clamp/acm/element/main/rest/AbstractRestController.java index 408458f99..7c963b6da 100644 --- a/participant/participant-impl/participant-impl-acelement/src/main/java/org/onap/policy/clamp/acm/element/main/rest/AbstractRestController.java +++ b/participant/participant-impl/participant-impl-acelement/src/main/java/org/onap/policy/clamp/acm/element/main/rest/AbstractRestController.java @@ -35,7 +35,7 @@ import org.springframework.web.bind.annotation.RequestMapping; */ // @formatter:off @RequestMapping( - value = "/v2", + value = "/onap/policy/clamp/acelement/v2", produces = { MediaType.APPLICATION_JSON, AbstractRestController.APPLICATION_YAML diff --git a/participant/participant-impl/participant-impl-acelement/src/main/resources/config/application.yaml b/participant/participant-impl/participant-impl-acelement/src/main/resources/config/application.yaml index 4a0f0d301..4d7710304 100644 --- a/participant/participant-impl/participant-impl-acelement/src/main/resources/config/application.yaml +++ b/participant/participant-impl/participant-impl-acelement/src/main/resources/config/application.yaml @@ -1,22 +1,21 @@ spring: security: user: - name: acmUser - password: zb!XztG34 + name: ${REST_USER:acmUser} + password: ${REST_PASSWORD:zb!XztG34} server: - port: 8084 - servlet: - context-path: /onap/policy/clamp/acelement/ + port: ${PORT:8084} error: path: /error element: elementId: - name: onap.policy.clamp.ac.element1 - version: 1.0.0 + name: ${ELEMENT_ID:onap.policy.clamp.ac.element1} + version: ${ELEMENT_VERSION:1.0.0} management: endpoints: web: + base-path: / exposure: - include: health, metrics, prometheus
\ No newline at end of file + include: health, metrics, prometheus |