Change metric name for LCM state gauge 92/140292/2
authoremaclee <lee.anjella.macabuhay@est.tech>
Tue, 25 Feb 2025 07:37:52 +0000 (07:37 +0000)
committeremaclee <lee.anjella.macabuhay@est.tech>
Tue, 25 Feb 2025 10:09:40 +0000 (10:09 +0000)
- change gauge name from cmHandlesByState to cps_ncmp_inventory_cm_handles_by_state

Issue-id: CPS-2662
Change-Id: I97a036b155b638cd6ed94a739e3dffb7b6f00172
Signed-off-by: emaclee <lee.anjella.macabuhay@est.tech>
cps-application/src/main/java/org/onap/cps/config/MicroMeterConfig.java
cps-application/src/test/groovy/org/onap/cps/config/MicroMeterConfigSpec.groovy
docker-compose/config/grafana/inventory-dashboard.json

index b85f391..6782669 100644 (file)
@@ -37,7 +37,7 @@ import org.springframework.context.annotation.Configuration;
 public class MicroMeterConfig {
 
     private static final String STATE_TAG = "state";
-    private static final String CM_HANDLE_STATE_GAUGE = "cmHandlesByState";
+    private static final String CM_HANDLE_STATE_GAUGE = "cps_ncmp_inventory_cm_handles_by_state";
     final IMap<String, Integer> cmHandlesByState;
 
     @Bean
index b9302cc..faef32b 100644 (file)
@@ -53,7 +53,7 @@ class MicroMeterConfigSpec extends Specification {
              objectUnderTest.deletedCmHandles(simpleMeterRegistry)
         then: 'each state has the correct value when queried'
             ['ADVISED', 'READY', 'LOCKED', 'DELETING', 'DELETED'].each { state ->
-                def gaugeValue = simpleMeterRegistry.get('cmHandlesByState').tag('state',state).gauge().value()
+                def gaugeValue = simpleMeterRegistry.get(objectUnderTest.CM_HANDLE_STATE_GAUGE).tag('state',state).gauge().value()
                 assert gaugeValue == 1
             }
     }
index 959995f..d4046b8 100644 (file)
         {
           "disableTextWrap": false,
           "editorMode": "builder",
-          "expr": "cmHandlesByState{instance=\"$Instance\", job=\"$Job\"}",
+          "expr": "cps_ncmp_inventory_cm_handles_by_state{instance=\"$Instance\", job=\"$Job\"}",
           "fullMetaSearch": false,
           "includeNullMetadata": true,
           "legendFormat": "__auto",