summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorLiam Fallon <liam.fallon@est.tech>2022-02-10 13:18:43 +0000
committerGerrit Code Review <gerrit@onap.org>2022-02-10 13:18:43 +0000
commit2f2c5465cd23c8c3300a5c3d185806bb3e7d73c1 (patch)
tree8dc32111bc837459be7e61b048e3fd073e3bc5a8 /core
parentc9da04cc4ff4b133edd68ceee77f5bb5128d6574 (diff)
parentd71f322fa9eb51967527b14c1eeeba49838464be (diff)
Merge "rename metrics as per global constants for prometheus"
Diffstat (limited to 'core')
-rw-r--r--core/core-engine/src/main/java/org/onap/policy/apex/core/engine/engine/impl/ApexEngineImpl.java8
-rw-r--r--core/core-engine/src/test/java/org/onap/policy/apex/core/engine/engine/impl/ApexEngineImplTest.java3
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