@@ -3,6 +3,7 @@ local grafana = (import 'grafonnet/grafana.libsonnet');
3
3
local dashboard = grafana.dashboard;
4
4
local template = grafana.template;
5
5
local prometheus = grafana.prometheus;
6
+ local getMatcher(cfg) = '%(ibmmqSelector)s' % cfg;
6
7
7
8
local dashboardUid = 'ibm-mq-cluster-overview' ;
8
9
@@ -12,11 +13,11 @@ local promDatasource = {
12
13
uid: '${%s}' % promDatasourceName,
13
14
};
14
15
15
- local clustersPanel = {
16
+ local clustersPanel(matcher) = {
16
17
datasource: promDatasource,
17
18
targets: [
18
19
prometheus.target(
19
- 'count(count(ibmmq_qmgr_commit_count{job=~"$job" }) by (mq_cluster))' ,
20
+ 'count(count(ibmmq_qmgr_commit_count{' + matcher + ' }) by (mq_cluster))' ,
20
21
datasource=promDatasource,
21
22
legendFormat='{{job}} - {{mq_cluster}}' ,
22
23
format='time_series' ,
@@ -63,11 +64,11 @@ local clustersPanel = {
63
64
},
64
65
};
65
66
66
- local queueManagersPanel = {
67
+ local queueManagersPanel(matcher) = {
67
68
datasource: promDatasource,
68
69
targets: [
69
70
prometheus.target(
70
- 'count(count(ibmmq_qmgr_commit_count{job=~"$job" }) by (qmgr, mq_cluster))' ,
71
+ 'count(count(ibmmq_qmgr_commit_count{' + matcher + ' }) by (qmgr, mq_cluster))' ,
71
72
datasource=promDatasource,
72
73
legendFormat='' ,
73
74
format='time_series' ,
@@ -114,11 +115,11 @@ local queueManagersPanel = {
114
115
},
115
116
};
116
117
117
- local topicsPanel = {
118
+ local topicsPanel(matcher) = {
118
119
datasource: promDatasource,
119
120
targets: [
120
121
prometheus.target(
121
- 'count(count(ibmmq_topic_messages_received{job=~"$job" }) by (topic, mq_cluster))' ,
122
+ 'count(count(ibmmq_topic_messages_received{' + matcher + ' }) by (topic, mq_cluster))' ,
122
123
datasource=promDatasource,
123
124
legendFormat='{{job}} - {{mq_cluster}}' ,
124
125
format='time_series' ,
@@ -165,11 +166,11 @@ local topicsPanel = {
165
166
},
166
167
};
167
168
168
- local queuesPanel = {
169
+ local queuesPanel(matcher) = {
169
170
datasource: promDatasource,
170
171
targets: [
171
172
prometheus.target(
172
- 'count(count(ibmmq_queue_depth{job=~"$job" }) by (queue, mq_cluster))' ,
173
+ 'count(count(ibmmq_queue_depth{' + matcher + ' }) by (queue, mq_cluster))' ,
173
174
datasource=promDatasource,
174
175
legendFormat='' ,
175
176
format='time_series' ,
@@ -216,41 +217,41 @@ local queuesPanel = {
216
217
},
217
218
};
218
219
219
- local queueOperationsPanel = {
220
+ local queueOperationsPanel(matcher) = {
220
221
datasource: promDatasource,
221
222
targets: [
222
223
prometheus.target(
223
- 'sum by (mq_cluster) (ibmmq_queue_mqset_count{mq_cluster=~"$mq_cluster", job =~"$job "})' ,
224
+ 'sum by (mq_cluster) (ibmmq_queue_mqset_count{' + matcher + ', mq_cluster =~"$mq_cluster "})' ,
224
225
datasource=promDatasource,
225
226
legendFormat='MQSET' ,
226
227
format='time_series' ,
227
228
),
228
229
prometheus.target(
229
- 'sum by (mq_cluster) (ibmmq_queue_mqinq_count{mq_cluster=~"$mq_cluster", job =~"$job "})' ,
230
+ 'sum by (mq_cluster) (ibmmq_queue_mqinq_count{' + matcher + ', mq_cluster =~"$mq_cluster "})' ,
230
231
datasource=promDatasource,
231
232
legendFormat='MQINQ' ,
232
233
format='time_series' ,
233
234
),
234
235
prometheus.target(
235
- 'sum by (mq_cluster) (ibmmq_queue_mqget_count{mq_cluster=~"$mq_cluster", job =~"$job "})' ,
236
+ 'sum by (mq_cluster) (ibmmq_queue_mqget_count{' + matcher + ', mq_cluster =~"$mq_cluster "})' ,
236
237
datasource=promDatasource,
237
238
legendFormat='MQGET' ,
238
239
format='time_series' ,
239
240
),
240
241
prometheus.target(
241
- 'sum by (mq_cluster) (ibmmq_queue_mqopen_count{mq_cluster=~"$mq_cluster", job =~"$job "})' ,
242
+ 'sum by (mq_cluster) (ibmmq_queue_mqopen_count{' + matcher + ', mq_cluster =~"$mq_cluster "})' ,
242
243
datasource=promDatasource,
243
244
legendFormat='MQOPEN' ,
244
245
format='time_series' ,
245
246
),
246
247
prometheus.target(
247
- 'sum by (mq_cluster) (ibmmq_queue_mqclose_count{mq_cluster=~"$mq_cluster", job =~"$job "})' ,
248
+ 'sum by (mq_cluster) (ibmmq_queue_mqclose_count{' + matcher + ', mq_cluster =~"$mq_cluster "})' ,
248
249
datasource=promDatasource,
249
250
legendFormat='MQCLOSE' ,
250
251
format='time_series' ,
251
252
),
252
253
prometheus.target(
253
- 'sum by (mq_cluster) (ibmmq_queue_mqput_mqput1_count{mq_cluster=~"$mq_cluster", job =~"$job "})' ,
254
+ 'sum by (mq_cluster) (ibmmq_queue_mqput_mqput1_count{' + matcher + ', mq_cluster =~"$mq_cluster "})' ,
254
255
datasource=promDatasource,
255
256
legendFormat='MQPUT/MQPUT1' ,
256
257
format='time_series' ,
@@ -325,11 +326,11 @@ local queueOperationsPanel = {
325
326
},
326
327
};
327
328
328
- local clusterStatusPanel = {
329
+ local clusterStatusPanel(matcher) = {
329
330
datasource: promDatasource,
330
331
targets: [
331
332
prometheus.target(
332
- 'ibmmq_cluster_suspend{mq_cluster=~"$mq_cluster", job =~"$job "}' ,
333
+ 'ibmmq_cluster_suspend{' + matcher + ', mq_cluster =~"$mq_cluster "}' ,
333
334
datasource=promDatasource,
334
335
legendFormat='{{job}} - {{mq_cluster}}' ,
335
336
format='time_series' ,
@@ -434,11 +435,11 @@ local clusterStatusPanel = {
434
435
],
435
436
};
436
437
437
- local queueManagerStatusPanel = {
438
+ local queueManagerStatusPanel(matcher) = {
438
439
datasource: promDatasource,
439
440
targets: [
440
441
prometheus.target(
441
- 'ibmmq_qmgr_status{mq_cluster=~"$mq_cluster", job =~"$job "}' ,
442
+ 'ibmmq_qmgr_status{' + matcher + ', mq_cluster =~"$mq_cluster "}' ,
442
443
datasource=promDatasource,
443
444
legendFormat='' ,
444
445
format='time_series' ,
@@ -571,17 +572,17 @@ local queueManagerStatusPanel = {
571
572
],
572
573
};
573
574
574
- local transmissionQueueTimePanel = {
575
+ local transmissionQueueTimePanel(matcher) = {
575
576
datasource: promDatasource,
576
577
targets: [
577
578
prometheus.target(
578
- 'ibmmq_channel_xmitq_time_short{type="SENDER",job=~"$job" , mq_cluster=~"$mq_cluster"}' ,
579
+ 'ibmmq_channel_xmitq_time_short{type="SENDER", ' + matcher + ' , mq_cluster=~"$mq_cluster"}' ,
579
580
datasource=promDatasource,
580
581
legendFormat='{{channel}} - short' ,
581
582
format='time_series' ,
582
583
),
583
584
prometheus.target(
584
- 'ibmmq_channel_xmitq_time_long{type=~"SENDER", job=~"$job" , mq_cluster=~"$mq_cluster"}' ,
585
+ 'ibmmq_channel_xmitq_time_long{type=~"SENDER", ' + matcher + ' , mq_cluster=~"$mq_cluster"}' ,
585
586
datasource=promDatasource,
586
587
legendFormat='{{channel}} - long' ,
587
588
format='time_series' ,
@@ -701,6 +702,18 @@ local transmissionQueueTimePanel = {
701
702
allValues='' ,
702
703
sort=0
703
704
),
705
+ template.new(
706
+ 'cluster' ,
707
+ promDatasource,
708
+ 'label_values(ibmmq_qmgr_commit_count{job=~"$job"}, cluster)' ,
709
+ label='Cluster' ,
710
+ refresh=2 ,
711
+ includeAll=true ,
712
+ multi=true ,
713
+ allValues='' ,
714
+ hide=if $._config.enableMultiCluster then '' else 'variable' ,
715
+ sort=0
716
+ ),
704
717
]
705
718
)
706
719
.addLink(grafana.link.dashboards(
@@ -712,14 +725,14 @@ local transmissionQueueTimePanel = {
712
725
))
713
726
.addPanels(
714
727
[
715
- clustersPanel { gridPos: { h: 7 , w: 4 , x: 0 , y: 0 } },
716
- queueManagersPanel { gridPos: { h: 7 , w: 4 , x: 4 , y: 0 } },
717
- topicsPanel { gridPos: { h: 7 , w: 4 , x: 8 , y: 0 } },
718
- queuesPanel { gridPos: { h: 7 , w: 4 , x: 12 , y: 0 } },
719
- queueOperationsPanel { gridPos: { h: 15 , w: 8 , x: 16 , y: 0 } },
720
- clusterStatusPanel { gridPos: { h: 4 , w: 16 , x: 0 , y: 7 } },
721
- queueManagerStatusPanel { gridPos: { h: 4 , w: 16 , x: 0 , y: 11 } },
722
- transmissionQueueTimePanel { gridPos: { h: 8 , w: 24 , x: 0 , y: 15 } },
728
+ clustersPanel(getMatcher($._config)) { gridPos: { h: 7 , w: 4 , x: 0 , y: 0 } },
729
+ queueManagersPanel(getMatcher($._config)) { gridPos: { h: 7 , w: 4 , x: 4 , y: 0 } },
730
+ topicsPanel(getMatcher($._config)) { gridPos: { h: 7 , w: 4 , x: 8 , y: 0 } },
731
+ queuesPanel(getMatcher($._config)) { gridPos: { h: 7 , w: 4 , x: 12 , y: 0 } },
732
+ queueOperationsPanel(getMatcher($._config)) { gridPos: { h: 15 , w: 8 , x: 16 , y: 0 } },
733
+ clusterStatusPanel(getMatcher($._config)) { gridPos: { h: 4 , w: 16 , x: 0 , y: 7 } },
734
+ queueManagerStatusPanel(getMatcher($._config)) { gridPos: { h: 4 , w: 16 , x: 0 , y: 11 } },
735
+ transmissionQueueTimePanel(getMatcher($._config)) { gridPos: { h: 8 , w: 24 , x: 0 , y: 15 } },
723
736
]
724
737
),
725
738
0 commit comments