]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mgr/dashboard: Add 'Browse Dashboards' button in multi-cluster and ceph-cluster Grafa...
authorPiyush Agarwal <piyushagarwal@li-2594f2cc-21c0-11b2-a85c-ca0d78eaf758.ibm.com>
Wed, 2 Oct 2024 21:16:45 +0000 (02:46 +0530)
committerPiyush Agarwal <piyushagarwal14.pa@gmail.com>
Wed, 16 Oct 2024 12:15:09 +0000 (17:45 +0530)
Fixes: https://tracker.ceph.com/issues/68316
Signed-off-by: piyushagarwal1411 <piyushagarwal14.pa@gmail.com>
Signed-off-by: Piyush Agarwal <piyushagarwal14.pa@gmail.com>
monitoring/ceph-mixin/dashboards/multi-cluster.libsonnet
monitoring/ceph-mixin/dashboards/utils.libsonnet
monitoring/ceph-mixin/dashboards_out/ceph-cluster.json
monitoring/ceph-mixin/dashboards_out/multi-cluster-overview.json
src/pybind/mgr/dashboard/ci/check_grafana_dashboards.py

index 8185ebb253b973c48ecd39893d58ee5ade6277d2..6b07031920254370fca3f756bd66efa25faf37c2 100644 (file)
@@ -43,6 +43,21 @@ local g = import 'grafonnet/grafana.libsonnet';
       ),
     )
 
+    .addLinks([
+      $.addLinkSchema(
+        asDropdown=true,
+        icon='external link',
+        includeVars=true,
+        keepTime=true,
+        tags=[],
+        targetBlank=false,
+        title='Browse Dashboards',
+        tooltip='',
+        type='dashboards',
+        url=''
+      ),
+    ])
+
     .addPanels([
       $.addRowSchema(false, true, 'Clusters') + { gridPos: { x: 0, y: 1, w: 24, h: 1 } },
       $.addStatPanel(
index 333a444dda111442a0827d393dfd7e1d0790c4ab..50fa0027f28e6fbc7d9d7bb715d566f7494b0a31 100644 (file)
@@ -133,6 +133,29 @@ local timeSeries = import 'timeseries_panel.libsonnet';
                    allValues=allValues,
                    current=current),
 
+  addLinkSchema(asDropdown,
+                icon,
+                includeVars,
+                keepTime,
+                tags,
+                targetBlank,
+                title,
+                tooltip,
+                type,
+                url)::
+    {
+      asDropdown: asDropdown,
+      icon: icon,
+      includeVars: includeVars,
+      keepTime: keepTime,
+      tags: tags,
+      targetBlank: targetBlank,
+      title: title,
+      tooltip: tooltip,
+      type: type,
+      url: url,
+    },
+
   addAnnotationSchema(builtIn,
                       datasource,
                       enable,
index 1fd7821a6b6ff7677fbdba6deacebe2db9fa385f..0b5abd73d90b7097f0d396eefa01b14d60268c09 100644 (file)
   "hideControls": false,
   "id": null,
   "iteration": 1525415495309,
-  "links": [],
+  "links": [
+    {
+      "asDropdown": true,
+      "icon": "external link",
+      "includeVars": true,
+      "keepTime": true,
+      "tags": [],
+      "targetBlank": false,
+      "title": "Browse Dashboards",
+      "tooltip": "",
+      "type": "dashboards",
+      "url": ""
+    }
+  ],
   "panels": [
     {
       "cacheTimeout": null,
index 25648cc0abb6866e27ac7afa39f472b261fb4906..b9ccc453ac8bf14e5c53e81a206ae12042922735 100644 (file)
    "graphTooltip": 0,
    "hideControls": false,
    "id": null,
-   "links": [ ],
+   "links": [ 
+      {
+         "asDropdown": true,
+         "icon": "external link",
+         "includeVars": true,
+         "keepTime": true,
+         "tags": [],
+         "targetBlank": false,
+         "title": "Browse Dashboards",
+         "tooltip": "",
+         "type": "dashboards",
+         "url": ""
+      }
+   ],
    "panels": [
       {
          "collapse": false,
index 317dc45ce2efc12d5cd806534402527ec09e0725..95e1c3ffe0307d53bb5921b1141abf0617bb32b4 100644 (file)
@@ -103,8 +103,6 @@ def get_grafana_dashboards(base_dir):
                 title = dashboard_config['title']
                 assert len(title) > 0, \
                     "Title not found in '{}'".format(json_file)
-                assert len(dashboard_config.get('links', [])) == 0, \
-                    "Links found in '{}'".format(json_file)
                 if not uid:
                     continue
                 if uid in dashboards: