Skip to content

Commit 9eaff51

Browse files
authored
Merge pull request ceph#60100 from piyushagarwal1411/fix-68316-main
mgr/dashboard: Add 'Browse Dashboards' button in multi-cluster and ceph-cluster Grafana dashboards Reviewed-by: Aashish Sharma <[email protected]>
2 parents 66e6a86 + 10d4f30 commit 9eaff51

File tree

5 files changed

+66
-4
lines changed

5 files changed

+66
-4
lines changed

monitoring/ceph-mixin/dashboards/multi-cluster.libsonnet

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,21 @@ local g = import 'grafonnet/grafana.libsonnet';
4343
),
4444
)
4545

46+
.addLinks([
47+
$.addLinkSchema(
48+
asDropdown=true,
49+
icon='external link',
50+
includeVars=true,
51+
keepTime=true,
52+
tags=[],
53+
targetBlank=false,
54+
title='Browse Dashboards',
55+
tooltip='',
56+
type='dashboards',
57+
url=''
58+
),
59+
])
60+
4661
.addPanels([
4762
$.addRowSchema(false, true, 'Clusters') + { gridPos: { x: 0, y: 1, w: 24, h: 1 } },
4863
$.addStatPanel(

monitoring/ceph-mixin/dashboards/utils.libsonnet

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,29 @@ local timeSeries = import 'timeseries_panel.libsonnet';
133133
allValues=allValues,
134134
current=current),
135135

136+
addLinkSchema(asDropdown,
137+
icon,
138+
includeVars,
139+
keepTime,
140+
tags,
141+
targetBlank,
142+
title,
143+
tooltip,
144+
type,
145+
url)::
146+
{
147+
asDropdown: asDropdown,
148+
icon: icon,
149+
includeVars: includeVars,
150+
keepTime: keepTime,
151+
tags: tags,
152+
targetBlank: targetBlank,
153+
title: title,
154+
tooltip: tooltip,
155+
type: type,
156+
url: url,
157+
},
158+
136159
addAnnotationSchema(builtIn,
137160
datasource,
138161
enable,

monitoring/ceph-mixin/dashboards_out/ceph-cluster.json

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,20 @@
3535
"hideControls": false,
3636
"id": null,
3737
"iteration": 1525415495309,
38-
"links": [],
38+
"links": [
39+
{
40+
"asDropdown": true,
41+
"icon": "external link",
42+
"includeVars": true,
43+
"keepTime": true,
44+
"tags": [],
45+
"targetBlank": false,
46+
"title": "Browse Dashboards",
47+
"tooltip": "",
48+
"type": "dashboards",
49+
"url": ""
50+
}
51+
],
3952
"panels": [
4053
{
4154
"cacheTimeout": null,

monitoring/ceph-mixin/dashboards_out/multi-cluster-overview.json

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,20 @@
2222
"graphTooltip": 0,
2323
"hideControls": false,
2424
"id": null,
25-
"links": [ ],
25+
"links": [
26+
{
27+
"asDropdown": true,
28+
"icon": "external link",
29+
"includeVars": true,
30+
"keepTime": true,
31+
"tags": [],
32+
"targetBlank": false,
33+
"title": "Browse Dashboards",
34+
"tooltip": "",
35+
"type": "dashboards",
36+
"url": ""
37+
}
38+
],
2639
"panels": [
2740
{
2841
"collapse": false,

src/pybind/mgr/dashboard/ci/check_grafana_dashboards.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,6 @@ def get_grafana_dashboards(base_dir):
103103
title = dashboard_config['title']
104104
assert len(title) > 0, \
105105
"Title not found in '{}'".format(json_file)
106-
assert len(dashboard_config.get('links', [])) == 0, \
107-
"Links found in '{}'".format(json_file)
108106
if not uid:
109107
continue
110108
if uid in dashboards:

0 commit comments

Comments
 (0)