@@ -5,7 +5,7 @@ local dashboardUid = 'oracledb-overview';
5
5
6
6
local prometheus = grafana.prometheus;
7
7
local promDatasourceName = 'prometheus_datasource' ;
8
- local matcher = 'job=~"$job" , instance=~"$instance"' ;
8
+ local getMatcher(cfg) = '%(oracledbSelector)s , instance=~"$instance"' % cfg ;
9
9
10
10
local promDatasource = {
11
11
uid: '${%s}' % promDatasourceName,
@@ -15,7 +15,7 @@ local lokiDatasource = {
15
15
uid: '$loki_datasource' ,
16
16
};
17
17
18
- local databaseStatusPanel = {
18
+ local databaseStatusPanel(matcher) = {
19
19
description: 'Database status either Up or Down. Colored to be green when Up or red when Down' ,
20
20
fieldConfig: {
21
21
defaults: {
@@ -81,7 +81,7 @@ local databaseStatusPanel = {
81
81
type: 'stat' ,
82
82
};
83
83
84
- local sessionsPanel = {
84
+ local sessionsPanel(matcher) = {
85
85
datasource: promDatasource,
86
86
description: 'Number of sessions and the limit overtime.' ,
87
87
fieldConfig: {
@@ -171,7 +171,7 @@ local sessionsPanel = {
171
171
type: 'timeseries' ,
172
172
};
173
173
174
- local processPanel = {
174
+ local processPanel(matcher) = {
175
175
datasource: promDatasource,
176
176
description: 'Number of processes and the limit overtime.' ,
177
177
fieldConfig: {
@@ -261,7 +261,7 @@ local processPanel = {
261
261
type: 'timeseries' ,
262
262
};
263
263
264
- local alertLogPanel = {
264
+ local alertLogPanel(matcher) = {
265
265
datasource: lokiDatasource,
266
266
description: 'Recent logs from alert log file' ,
267
267
options: {
@@ -279,7 +279,7 @@ local alertLogPanel = {
279
279
{
280
280
datasource: lokiDatasource,
281
281
editorMode: 'builder' ,
282
- expr: '{filename=~"/u01/base /diag/rdbms/.*/.*/trace/alert_.*log",' + matcher + '}' ,
282
+ expr: '{filename=~"/.*/.* /diag/rdbms/.*/.*/trace/alert_.*log",' + matcher + '}' ,
283
283
queryType: 'range' ,
284
284
refId: 'A' ,
285
285
},
@@ -294,7 +294,7 @@ local waitTimerow = {
294
294
type: 'row' ,
295
295
};
296
296
297
- local applicationWaitTimePanel = {
297
+ local applicationWaitTimePanel(matcher) = {
298
298
datasource: promDatasource,
299
299
description: 'Application wait time, in seconds, waiting for wait events.' ,
300
300
fieldConfig: {
@@ -375,7 +375,7 @@ local applicationWaitTimePanel = {
375
375
type: 'timeseries' ,
376
376
};
377
377
378
- local commitTimePanel = {
378
+ local commitTimePanel(matcher) = {
379
379
datasource: promDatasource,
380
380
description: 'Commit wait time, in seconds, waiting for wait events.' ,
381
381
fieldConfig: {
@@ -456,7 +456,7 @@ local commitTimePanel = {
456
456
type: 'timeseries' ,
457
457
};
458
458
459
- local concurrencyWaitTime = {
459
+ local concurrencyWaitTime(matcher) = {
460
460
datasource: promDatasource,
461
461
description: 'Concurrency wait time, in seconds, waiting for wait events.' ,
462
462
fieldConfig: {
@@ -537,7 +537,7 @@ local concurrencyWaitTime = {
537
537
type: 'timeseries' ,
538
538
};
539
539
540
- local configurationWaitTime = {
540
+ local configurationWaitTime(matcher) = {
541
541
datasource: promDatasource,
542
542
description: 'Configuration wait time, in seconds waiting for wait events.' ,
543
543
fieldConfig: {
@@ -618,7 +618,7 @@ local configurationWaitTime = {
618
618
type: 'timeseries' ,
619
619
};
620
620
621
- local networkWaitTime = {
621
+ local networkWaitTime(matcher) = {
622
622
datasource: promDatasource,
623
623
description: 'Network wait time, in seconds, waiting for wait events.' ,
624
624
fieldConfig: {
@@ -699,7 +699,7 @@ local networkWaitTime = {
699
699
type: 'timeseries' ,
700
700
};
701
701
702
- local schedulerWaitTime = {
702
+ local schedulerWaitTime(matcher) = {
703
703
datasource: promDatasource,
704
704
description: 'Scheduler wait time, in seconds, waiting for wait events.' ,
705
705
fieldConfig: {
@@ -780,7 +780,7 @@ local schedulerWaitTime = {
780
780
type: 'timeseries' ,
781
781
};
782
782
783
- local systemIOWaitTime = {
783
+ local systemIOWaitTime(matcher) = {
784
784
datasource: promDatasource,
785
785
description: 'System I/O wait time, in seconds, waiting for wait events.' ,
786
786
fieldConfig: {
@@ -861,7 +861,7 @@ local systemIOWaitTime = {
861
861
type: 'timeseries' ,
862
862
};
863
863
864
- local userIOWaitTime = {
864
+ local userIOWaitTime(matcher) = {
865
865
datasource: promDatasource,
866
866
description: 'User I/O wait time, in seconds, waiting for wait events.' ,
867
867
fieldConfig: {
@@ -948,7 +948,7 @@ local tablespaceRow = {
948
948
type: 'row' ,
949
949
};
950
950
951
- local tablespaceSizePanel = {
951
+ local tablespaceSizePanel(matcher) = {
952
952
datasource: promDatasource,
953
953
description: 'Shows the size overtime for the tablespace.' ,
954
954
fieldConfig: {
@@ -1113,7 +1113,7 @@ local tablespaceSizePanel = {
1113
1113
template.new(
1114
1114
'tablespace' ,
1115
1115
promDatasource,
1116
- query='label_values(oracledb_tablespace_bytes{' + matcher + ' }, tablespace)' ,
1116
+ query='label_values(oracledb_tablespace_bytes{%(oracledbSelector)s, instance=~"$instance" }, tablespace)' % $._config ,
1117
1117
label='Tablespace' ,
1118
1118
refresh='time' ,
1119
1119
includeAll=true ,
@@ -1128,33 +1128,33 @@ local tablespaceSizePanel = {
1128
1128
.addPanels(
1129
1129
std.flattenArrays ([
1130
1130
[
1131
- databaseStatusPanel { gridPos: { h: 6 , w: 4 , x: 0 , y: 0 } },
1132
- sessionsPanel { gridPos: { h: 6 , w: 10 , x: 4 , y: 0 } },
1133
- processPanel { gridPos: { h: 6 , w: 10 , x: 14 , y: 0 } },
1131
+ databaseStatusPanel(getMatcher($._config)) { gridPos: { h: 6 , w: 4 , x: 0 , y: 0 } },
1132
+ sessionsPanel(getMatcher($._config)) { gridPos: { h: 6 , w: 10 , x: 4 , y: 0 } },
1133
+ processPanel(getMatcher($._config)) { gridPos: { h: 6 , w: 10 , x: 14 , y: 0 } },
1134
1134
],
1135
1135
if $._config.enableLokiLogs then [
1136
- alertLogPanel { gridPos: { h: 7 , w: 24 , x: 0 , y: 6 } },
1136
+ alertLogPanel(getMatcher($._config)) { gridPos: { h: 7 , w: 24 , x: 0 , y: 6 } },
1137
1137
] else [],
1138
1138
[
1139
1139
waitTimerow { gridPos: { h: 1 , w: 24 , x: 0 , y: 13 } },
1140
1140
],
1141
1141
[
1142
- applicationWaitTimePanel { gridPos: { h: 6 , w: 6 , x: 0 , y: 14 } },
1143
- commitTimePanel { gridPos: { h: 6 , w: 6 , x: 6 , y: 14 } },
1144
- concurrencyWaitTime { gridPos: { h: 6 , w: 6 , x: 12 , y: 14 } },
1145
- configurationWaitTime { gridPos: { h: 6 , w: 6 , x: 18 , y: 14 } },
1142
+ applicationWaitTimePanel(getMatcher($._config)) { gridPos: { h: 6 , w: 6 , x: 0 , y: 14 } },
1143
+ commitTimePanel(getMatcher($._config)) { gridPos: { h: 6 , w: 6 , x: 6 , y: 14 } },
1144
+ concurrencyWaitTime(getMatcher($._config)) { gridPos: { h: 6 , w: 6 , x: 12 , y: 14 } },
1145
+ configurationWaitTime(getMatcher($._config)) { gridPos: { h: 6 , w: 6 , x: 18 , y: 14 } },
1146
1146
],
1147
1147
[
1148
- networkWaitTime { gridPos: { h: 6 , w: 6 , x: 0 , y: 20 } },
1149
- schedulerWaitTime { gridPos: { h: 6 , w: 6 , x: 6 , y: 20 } },
1150
- systemIOWaitTime { gridPos: { h: 6 , w: 6 , x: 12 , y: 20 } },
1151
- userIOWaitTime { gridPos: { h: 6 , w: 6 , x: 18 , y: 20 } },
1148
+ networkWaitTime(getMatcher($._config)) { gridPos: { h: 6 , w: 6 , x: 0 , y: 20 } },
1149
+ schedulerWaitTime(getMatcher($._config)) { gridPos: { h: 6 , w: 6 , x: 6 , y: 20 } },
1150
+ systemIOWaitTime(getMatcher($._config)) { gridPos: { h: 6 , w: 6 , x: 12 , y: 20 } },
1151
+ userIOWaitTime(getMatcher($._config)) { gridPos: { h: 6 , w: 6 , x: 18 , y: 20 } },
1152
1152
],
1153
1153
[
1154
1154
tablespaceRow { gridPos: { h: 1 , w: 24 , x: 0 , y: 26 } },
1155
1155
],
1156
1156
[
1157
- tablespaceSizePanel { gridPos: { h: 6 , w: 24 , x: 0 , y: 27 } },
1157
+ tablespaceSizePanel(getMatcher($._config)) { gridPos: { h: 6 , w: 24 , x: 0 , y: 27 } },
1158
1158
],
1159
1159
])
1160
1160
),
0 commit comments