From 05aaf7fd1583070f2c296abe7b3dfb901a56de33 Mon Sep 17 00:00:00 2001
From: stedif <stefano.difrischia@inaf.it>
Date: Tue, 20 Dec 2022 14:31:34 +0100
Subject: [PATCH] L2SS-1041: fix metrics

---
 dashboards/apspu.json | 32 ++++++++++++++++----------------
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/dashboards/apspu.json b/dashboards/apspu.json
index d8e8cc5..382d590 100644
--- a/dashboards/apspu.json
+++ b/dashboards/apspu.json
@@ -81,7 +81,7 @@
             "prefix": "FAN1",
             "prefixSize": 10,
             "selected": false,
-            "serie": "{__name__=\"device_attribute\", device=\"stat/apspu/1\", host=\"localhost\", idx=\"000\", instance=\"tango-prometheus-exporter:8000\", job=\"tango\", name=\"APSPU_FAN1_RPM_R\", station=\"DevStation\", type=\"float\", x=\"00\", y=\"00\"}",
+            "serie": "APSPU_FAN1_RPM_R",
             "suffix": " rpm",
             "suffixSize": 10,
             "symbol": "",
@@ -119,7 +119,7 @@
             "prefix": "FAN2",
             "prefixSize": 10,
             "selected": false,
-            "serie": "{__name__=\"device_attribute\", device=\"stat/apspu/1\", host=\"localhost\", idx=\"000\", instance=\"tango-prometheus-exporter:8000\", job=\"tango\", name=\"APSPU_FAN2_RPM_R\", station=\"DevStation\", type=\"float\", x=\"00\", y=\"00\"}",
+            "serie": "APSPU_FAN2_RPM_R",
             "suffix": " rpm",
             "suffixSize": 10,
             "symbol": "",
@@ -157,7 +157,7 @@
             "prefix": "FAN3",
             "prefixSize": 10,
             "selected": false,
-            "serie": "{__name__=\"device_attribute\", device=\"stat/apspu/1\", host=\"localhost\", idx=\"000\", instance=\"tango-prometheus-exporter:8000\", job=\"tango\", name=\"APSPU_FAN3_RPM_R\", station=\"DevStation\", type=\"float\", x=\"00\", y=\"00\"}",
+            "serie": "APSPU_FAN3_RPM_R",
             "suffix": " rpm",
             "suffixSize": 10,
             "symbol": "",
@@ -195,7 +195,7 @@
             "prefix": "LBA IOUT",
             "prefixSize": 10,
             "selected": false,
-            "serie": "{__name__=\"device_attribute\", device=\"stat/apspu/1\", host=\"localhost\", idx=\"000\", instance=\"tango-prometheus-exporter:8000\", job=\"tango\", name=\"APSPU_LBA_IOUT_R\", station=\"DevStation\", type=\"float\", x=\"00\", y=\"00\"}",
+            "serie": "APSPU_LBA_IOUT_R",
             "suffix": " A",
             "suffixSize": 10,
             "symbol": "",
@@ -233,7 +233,7 @@
             "prefix": "LBA VOUT",
             "prefixSize": 10,
             "selected": false,
-            "serie": "{__name__=\"device_attribute\", device=\"stat/apspu/1\", host=\"localhost\", idx=\"000\", instance=\"tango-prometheus-exporter:8000\", job=\"tango\", name=\"APSPU_LBA_VOUT_R\", station=\"DevStation\", type=\"float\", x=\"00\", y=\"00\"}",
+            "serie": "APSPU_LBA_VOUT_R",
             "suffix": " V",
             "suffixSize": 10,
             "symbol": "",
@@ -271,7 +271,7 @@
             "prefix": "LBA TEMP",
             "prefixSize": 10,
             "selected": false,
-            "serie": "{__name__=\"device_attribute\", device=\"stat/apspu/1\", host=\"localhost\", idx=\"000\", instance=\"tango-prometheus-exporter:8000\", job=\"tango\", name=\"APSPU_LBA_TEMP_R\", station=\"DevStation\", type=\"float\", x=\"00\", y=\"00\"}",
+            "serie": "APSPU_LBA_TEMP_R",
             "suffix": " °C",
             "suffixSize": 10,
             "symbol": "",
@@ -309,7 +309,7 @@
             "prefix": "RCU2a IOUT",
             "prefixSize": 10,
             "selected": false,
-            "serie": "{__name__=\"device_attribute\", device=\"stat/apspu/1\", host=\"localhost\", idx=\"000\", instance=\"tango-prometheus-exporter:8000\", job=\"tango\", name=\"APSPU_RCU2A_IOUT_R\", station=\"DevStation\", type=\"float\", x=\"00\", y=\"00\"}",
+            "serie": "APSPU_RCU2A_IOUT_R",
             "suffix": " A",
             "suffixSize": 10,
             "symbol": "",
@@ -347,7 +347,7 @@
             "prefix": "RCU2a VOUT",
             "prefixSize": 10,
             "selected": false,
-            "serie": "{__name__=\"device_attribute\", device=\"stat/apspu/1\", host=\"localhost\", idx=\"000\", instance=\"tango-prometheus-exporter:8000\", job=\"tango\", name=\"APSPU_RCU2A_VOUT_R\", station=\"DevStation\", type=\"float\", x=\"00\", y=\"00\"}",
+            "serie": "APSPU_RCU2A_VOUT_R",
             "suffix": " V",
             "suffixSize": 10,
             "symbol": "",
@@ -385,7 +385,7 @@
             "prefix": "RCU2a TEMP",
             "prefixSize": 10,
             "selected": false,
-            "serie": "{__name__=\"device_attribute\", device=\"stat/apspu/1\", host=\"localhost\", idx=\"000\", instance=\"tango-prometheus-exporter:8000\", job=\"tango\", name=\"APSPU_RCU2A_TEMP_R\", station=\"DevStation\", type=\"float\", x=\"00\", y=\"00\"}",
+            "serie": "APSPU_RCU2A_TEMP_R",
             "suffix": " °C",
             "suffixSize": 10,
             "symbol": "",
@@ -423,7 +423,7 @@
             "prefix": "RCU2D IOUT",
             "prefixSize": 10,
             "selected": false,
-            "serie": "{__name__=\"device_attribute\", device=\"stat/apspu/1\", host=\"localhost\", idx=\"000\", instance=\"tango-prometheus-exporter:8000\", job=\"tango\", name=\"APSPU_RCU2D_IOUT_R\", station=\"DevStation\", type=\"float\", x=\"00\", y=\"00\"}",
+            "serie": "APSPU_RCU2D_IOUT_R",
             "suffix": " A",
             "suffixSize": 10,
             "symbol": "",
@@ -461,7 +461,7 @@
             "prefix": "RCU2D VOUT",
             "prefixSize": 10,
             "selected": false,
-            "serie": "{__name__=\"device_attribute\", device=\"stat/apspu/1\", host=\"localhost\", idx=\"000\", instance=\"tango-prometheus-exporter:8000\", job=\"tango\", name=\"APSPU_RCU2D_VOUT_R\", station=\"DevStation\", type=\"float\", x=\"00\", y=\"00\"}",
+            "serie": "APSPU_RCU2D_VOUT_R",
             "suffix": " V",
             "suffixSize": 10,
             "symbol": "",
@@ -499,7 +499,7 @@
             "prefix": "RCU2D TEMP",
             "prefixSize": 10,
             "selected": false,
-            "serie": "{__name__=\"device_attribute\", device=\"stat/apspu/1\", host=\"localhost\", idx=\"000\", instance=\"tango-prometheus-exporter:8000\", job=\"tango\", name=\"APSPU_RCU2D_TEMP_R\", station=\"DevStation\", type=\"float\", x=\"00\", y=\"00\"}",
+            "serie": "APSPU_RCU2D_TEMP_R",
             "suffix": " °C",
             "suffixSize": 10,
             "symbol": "",
@@ -536,8 +536,8 @@
             "orbSize": 10,
             "prefix": "ID:",
             "prefixSize": 10,
-            "selected": true,
-            "serie": "{__name__=\"device_attribute\", device=\"stat/apspu/1\", host=\"localhost\", idx=\"000\", instance=\"tango-prometheus-exporter:8000\", job=\"tango\", name=\"APSPU_PCB_ID_R\", station=\"DevStation\", type=\"float\", x=\"00\", y=\"00\"}",
+            "selected": false,
+            "serie": "APSPU_PCB_ID_R",
             "suffix": "",
             "suffixSize": 10,
             "symbol": "",
@@ -575,7 +575,7 @@
             "prefix": "Version:",
             "prefixSize": 10,
             "selected": false,
-            "serie": "{__name__=\"device_attribute\", device=\"stat/apspu/1\", host=\"localhost\", idx=\"000\", instance=\"tango-prometheus-exporter:8000\", job=\"tango\", name=\"APSPU_PCB_version_R\", station=\"DevStation\", type=\"string\", x=\"00\", y=\"00\"}",
+            "serie": "APSPU_PCB_version_R",
             "suffix": "",
             "suffixSize": 10,
             "symbol": "",
@@ -601,7 +601,7 @@
           },
           "editorMode": "code",
           "expr": "device_attribute{host=\"$station\", device=\"stat/apspu/1\"}",
-          "legendFormat": "__auto",
+          "legendFormat": "{{name}}",
           "range": true,
           "refId": "APSPU_ATTR"
         }
-- 
GitLab