diff options
Diffstat (limited to 'core/core-engine')
2 files changed, 6 insertions, 5 deletions
diff --git a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/engine/impl/ApexEngineImpl.java b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/engine/impl/ApexEngineImpl.java index 7bd9087df..35139bfe4 100644 --- a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/engine/impl/ApexEngineImpl.java +++ b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/engine/impl/ApexEngineImpl.java @@ -56,6 +56,7 @@ import org.onap.policy.apex.model.policymodel.concepts.AxStateOutput; import org.onap.policy.apex.model.policymodel.concepts.AxStateTaskOutputType; import org.onap.policy.apex.model.policymodel.concepts.AxStateTaskReference; import org.onap.policy.apex.model.policymodel.concepts.AxTask; +import org.onap.policy.common.utils.resources.PrometheusUtils; import org.slf4j.ext.XLogger; import org.slf4j.ext.XLoggerFactory; @@ -74,9 +75,10 @@ public class ApexEngineImpl implements ApexEngine { private static final XLogger LOGGER = XLoggerFactory.getXLogger(ApexEngineImpl.class); // Register state changes with prometheus - static final Gauge ENGINE_STATE = Gauge.build().name("apex_engine_state").labelNames("engine_instance_id") - .help("State of the APEX engine as integers mapped as - 0:UNDEFINED, 1:STOPPED, 2:READY," - + " 3:EXECUTING, 4:STOPPING").register(); + static final Gauge ENGINE_STATE = Gauge.build().namespace(PrometheusUtils.PdpType.PDPA.getNamespace()) + .name("engine_state").labelNames("engine_instance_id") + .help("State of the APEX engine as integers mapped as - 0:UNDEFINED, 1:STOPPED, 2:READY," + + " 3:EXECUTING, 4:STOPPING").register(); // Recurring string constants private static final String UPDATE_MODEL = "updateModel()<-"; diff --git a/core/core-engine/src/test/java/org/onap/policy/apex/core/engine/engine/impl/ApexEngineImplTest.java b/core/core-engine/src/test/java/org/onap/policy/apex/core/engine/engine/impl/ApexEngineImplTest.java index 88602206d..3b682acd6 100644 --- a/core/core-engine/src/test/java/org/onap/policy/apex/core/engine/engine/impl/ApexEngineImplTest.java +++ b/core/core-engine/src/test/java/org/onap/policy/apex/core/engine/engine/impl/ApexEngineImplTest.java @@ -515,8 +515,7 @@ public class ApexEngineImplTest { private void checkAxEngineStateMetric(AxEngineState state) { Double stateMetric = CollectorRegistry.defaultRegistry - .getSampleValue("apex_engine_state", new String[]{"engine_instance_id"}, - new String[]{ENGINE_ID}); + .getSampleValue("pdpa_engine_state", new String[]{"engine_instance_id"}, new String[]{ENGINE_ID}); assertEquals(stateMetric.intValue(), state.getStateIdentifier()); } }
\ No newline at end of file |