Skip to content

Commit 1cd457c

Browse files
committed
add static dashboard ids
Signed-off-by: Vitaly Zhuravlev <[email protected]>
1 parent 4386b5f commit 1cd457c

File tree

3 files changed

+36
-18
lines changed

3 files changed

+36
-18
lines changed

mysqld-mixin/config.libsonnet

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
{
22
_config+:: {
3+
// Grafana dashboard IDs are necessary for stable links for dashboards
4+
grafanaDashboardIDs: {
5+
'mysql-overview.json': '549c2bf8936f7767ea6ac47c47b00f2a',
6+
'mysql-logs.json': 'DlHAFwE7z',
7+
},
8+
39
enableLokiLogs: false,
410
},
511
}

mysqld-mixin/dashboards/dashboards.libsonnet

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,40 @@ local grafana = import 'github.com/grafana/grafonnet-lib/grafonnet/grafana.libso
1919
title: 'MySQL Logs',
2020
tooltip: '',
2121
type: 'link',
22-
url: 'd/DlHAFwE7z',
22+
url: 'd/%s' % $._config.grafanaDashboardIDs['mysql-logs.json'],
2323
},
2424
],
25+
uid: $._config.grafanaDashboardIDs['mysql-overview.json'],
26+
},
27+
'mysql-logs.json':
28+
(import 'mysql-logs.json')
29+
+
30+
{
31+
32+
links+: [
33+
{
34+
asDropdown: false,
35+
icon: 'dashboard',
36+
includeVars: true,
37+
keepTime: true,
38+
tags: [],
39+
targetBlank: false,
40+
title: 'MySQL Overview',
41+
tooltip: '',
42+
type: 'link',
43+
url: 'd/%s' % $._config.grafanaDashboardIDs['mysql-overview.json'],
44+
},
45+
],
46+
47+
48+
uid: $._config.grafanaDashboardIDs['mysql-logs.json'],
49+
2550
},
26-
'mysql-logs.json': (import 'mysql-logs.json'),
2751
}
2852
else {
29-
'mysql-overview.json': (import 'mysql-overview.json'),
53+
'mysql-overview.json':
54+
(import 'mysql-overview.json')
55+
+
56+
{ uid: $._config.grafanaDashboardIDs['mysql-overview.json'] },
3057
},
3158
}

mysqld-mixin/dashboards/mysql-logs.json

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,6 @@
2525
"graphTooltip": 1,
2626
"id": 3,
2727
"iteration": 1647879063849,
28-
"links": [
29-
{
30-
"asDropdown": false,
31-
"icon": "dashboard",
32-
"includeVars": true,
33-
"keepTime": true,
34-
"tags": [],
35-
"targetBlank": false,
36-
"title": "MySQL Overview",
37-
"tooltip": "",
38-
"type": "link",
39-
"url": "d/549c2bf8936f7767ea6ac47c47b00f2a"
40-
}
41-
],
4228
"liveNow": false,
4329
"panels": [
4430
{
@@ -374,7 +360,6 @@
374360
"definition": "label_values(mysql_up, instance)",
375361
"hide": 0,
376362
"includeAll": true,
377-
"label": false,
378363
"multi": true,
379364
"name": "instance",
380365
"options": [],

0 commit comments

Comments
 (0)