From 512ea6b73d3b5b98f9fd9af87670b201e3b0fc61 Mon Sep 17 00:00:00 2001 From: Yadnesh Kulkarni Date: Tue, 12 Dec 2023 08:51:03 -0500 Subject: [PATCH] `project` field can now list project names If `CeilometerEnableTenantDiscovery` is enabled, ceilometer samples will contain `project_name` field, values from which are populated in `project` field. This change affects 2 dashboards, 'Cloud View' and 'Virtual Machine View', only these allow switching between openstack projects. If samples are missing `project_name` field, the regex for `project` variable allows fallback to `project` field --- roles/servicetelemetry/files/rhos-cloud-dashboard.json | 6 +++--- roles/servicetelemetry/files/virtual-machine-view.json | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/roles/servicetelemetry/files/rhos-cloud-dashboard.json b/roles/servicetelemetry/files/rhos-cloud-dashboard.json index 47525b043..251c8f938 100644 --- a/roles/servicetelemetry/files/rhos-cloud-dashboard.json +++ b/roles/servicetelemetry/files/rhos-cloud-dashboard.json @@ -1462,7 +1462,7 @@ "value": "$__all" }, "datasource": "STFPrometheus", - "definition": "label_values(ceilometer_cpu{service=~\".+-$clouds-.+\"},project)", + "definition": "ceilometer_cpu{service=~\".+-$clouds-.+\"}", "description": null, "error": null, "hide": 2, @@ -1472,11 +1472,11 @@ "name": "projects", "options": [], "query": { - "query": "label_values(ceilometer_cpu{service=~\".+-$clouds-.+\"},project)", + "query": "ceilometer_cpu{service=~\".+-$clouds-.+\"}", "refId": "StandardVariableQuery" }, "refresh": 2, - "regex": "", + "regex": "/project_name=\"(?[^\"]+)|project=\"(?[^\"]+)/g", "skipUrlSync": false, "sort": 0, "tagValuesQuery": "", diff --git a/roles/servicetelemetry/files/virtual-machine-view.json b/roles/servicetelemetry/files/virtual-machine-view.json index 0d5b4a191..39e59b798 100644 --- a/roles/servicetelemetry/files/virtual-machine-view.json +++ b/roles/servicetelemetry/files/virtual-machine-view.json @@ -1062,7 +1062,7 @@ { "allValue": null, "datasource": null, - "definition": "label_values(ceilometer_cpu{service=~\".+-$clouds-.+\"}, project)", + "definition": "ceilometer_cpu{service=~\".+-$clouds-.+\"}", "description": null, "error": null, "hide": 0, @@ -1072,11 +1072,11 @@ "name": "project", "options": [], "query": { - "query": "label_values(ceilometer_cpu{service=~\".+-$clouds-.+\"}, project)", + "query": "ceilometer_cpu{service=~\".+-$clouds-.+\"}", "refId": "StandardVariableQuery" }, "refresh": 1, - "regex": "", + "regex": "/project_name=\"(?[^\"]+)|project=\"(?[^\"]+)/g", "skipUrlSync": false, "sort": 0, "tagValuesQuery": "",