Skip to content

Commit

Permalink
Merge pull request #60100 from piyushagarwal1411/fix-68316-main
Browse files Browse the repository at this point in the history
mgr/dashboard: Add 'Browse Dashboards' button in multi-cluster and ceph-cluster Grafana dashboards

Reviewed-by: Aashish Sharma <[email protected]>
  • Loading branch information
aaSharma14 authored Nov 5, 2024
2 parents 66e6a86 + 10d4f30 commit 9eaff51
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 4 deletions.
15 changes: 15 additions & 0 deletions monitoring/ceph-mixin/dashboards/multi-cluster.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
23 changes: 23 additions & 0 deletions monitoring/ceph-mixin/dashboards/utils.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
15 changes: 14 additions & 1 deletion monitoring/ceph-mixin/dashboards_out/ceph-cluster.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,20 @@
"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,
Expand Down
15 changes: 14 additions & 1 deletion monitoring/ceph-mixin/dashboards_out/multi-cluster-overview.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,20 @@
"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,
Expand Down
2 changes: 0 additions & 2 deletions src/pybind/mgr/dashboard/ci/check_grafana_dashboards.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 9eaff51

Please sign in to comment.