Repository navigation
Expand file tree
/
Copy pathPresto.workbook
More file actions
410 lines (410 loc) · 19.7 KB
/
Copy pathPresto.workbook
File metadata and controls
410 lines (410 loc) · 19.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
{
"version": "Notebook/1.0",
"items": [
{
"type": 9,
"content": {
"version": "KqlParameterItem/1.0",
"parameters": [
{
"id": "a4b3932e-9ccf-4ffa-839a-ad3dc7137269",
"version": "KqlParameterItem/1.0",
"name": "timeRange",
"label": "Time Range",
"type": 4,
"description": "Filter data by time range",
"isRequired": true,
"value": {
"durationMs": 604800000
},
"typeSettings": {
"selectableValues": [
{
"durationMs": 300000
},
{
"durationMs": 900000
},
{
"durationMs": 1800000
},
{
"durationMs": 3600000
},
{
"durationMs": 14400000
},
{
"durationMs": 43200000
},
{
"durationMs": 86400000
},
{
"durationMs": 172800000
},
{
"durationMs": 259200000
},
{
"durationMs": 604800000
},
{
"durationMs": 1209600000
},
{
"durationMs": 2419200000
},
{
"durationMs": 2592000000
},
{
"durationMs": 5184000000
},
{
"durationMs": 7776000000
}
],
"allowCustom": true
},
"timeContext": {
"durationMs": 86400000
},
"timeContextFromParameter": "timeRange"
},
{
"id": "d2876cbd-26c1-4c51-9e4a-81995456ff0b",
"version": "KqlParameterItem/1.0",
"name": "clustername",
"label": "Cluster Name",
"type": 5,
"description": "Select desired cluster of this cluster pool",
"isRequired": true,
"multiSelect": true,
"quote": "'",
"delimiter": ",",
"query": "KubeNodeInventory \r\n| extend labels=parse_json(Labels)\r\n| extend agentpool=tostring(['labels'][0]['agentpool'])\r\n| distinct agentpool",
"typeSettings": {
"additionalResourceOptions": [
"value::all"
],
"showDefault": false
},
"timeContext": {
"durationMs": 0
},
"timeContextFromParameter": "timeRange",
"defaultValue": "value::all",
"queryType": 0,
"resourceType": "microsoft.containerservice/managedclusters"
}
],
"style": "above",
"queryType": 0,
"resourceType": "microsoft.containerservice/managedclusters"
},
"name": "parameters - 0"
},
{
"type": 11,
"content": {
"version": "LinkItem/1.0",
"style": "tabs",
"links": [
{
"id": "8555c972-5cfb-40fe-88fc-ddfe4cffd375",
"cellValue": "selectedTab",
"linkTarget": "parameter",
"linkLabel": "Cluster Overview",
"subTarget": "clusterOverview",
"style": "link"
},
{
"id": "aee16927-0441-4c69-83bd-ca252099589e",
"cellValue": "selectedTab",
"linkTarget": "parameter",
"linkLabel": "Presto Cluster",
"subTarget": "presto_cluster_group",
"style": "link"
}
]
},
"name": "allTabs"
},
{
"type": 12,
"content": {
"version": "NotebookGroup/1.0",
"groupType": "editable",
"items": [
{
"type": 12,
"content": {
"version": "NotebookGroup/1.0",
"groupType": "editable",
"items": [
{
"type": 3,
"content": {
"version": "KqlItem/1.0",
"query": "let trendBinSize = case(\r\n {timeRange:end}-{timeRange:start} <= 12h, 1m, \r\n {timeRange:end}-{timeRange:start} > 12h and {timeRange:end}-{timeRange:start} <= 24h, 5m,\r\n {timeRange:end}-{timeRange:start} > 24h and {timeRange:end}-{timeRange:start} <= 3d, 10m, \r\n {timeRange:end}-{timeRange:start} > 3d and {timeRange:end}-{timeRange:start} <= 5d, 30m,\r\n 1h); \r\nlet materializedPerfData =\r\nPerf \r\n| where ObjectName == 'K8SNode'\r\n| summarize arg_max(TimeGenerated, *) by CounterName, Computer, bin(TimeGenerated, trendBinSize) \r\n| where CounterName == 'cpuAllocatableNanoCores' or CounterName == 'cpuUsageNanoCores'// or CounterName == 'memoryRssBytes' or CounterName == 'memoryCapacityBytes' \r\n| project TimeGenerated, Computer, CounterName, CounterValue\r\n| summarize StoredValue = max(CounterValue) by Computer, CounterName, bin(TimeGenerated, trendBinSize);\r\n\r\nKubeNodeInventory\r\n| extend labels=parse_json(Labels)\r\n| extend agentpool=tostring(['labels'][0]['agentpool'])\r\n| where agentpool in ({clustername})\r\n| summarize arg_max(TimeGenerated, *) by Computer, bin(TimeGenerated, trendBinSize) \r\n| join( \r\nmaterializedPerfData \r\n| where CounterName == 'cpuAllocatableNanoCores' or CounterName == 'memoryCapacityBytes'\r\n| project Computer, CounterName = iif(CounterName == 'cpuAllocatableNanoCores', 'cpu', 'memory'), CapacityValue = StoredValue, TimeGenerated \r\n) on Computer, TimeGenerated \r\n| join kind=inner( \r\nmaterializedPerfData \r\n| where CounterName == 'cpuUsageNanoCores' or CounterName == 'memoryRssBytes' \r\n| project Computer, CounterName = iif(CounterName == 'cpuUsageNanoCores', 'cpu', 'memory'), UsageValue = StoredValue, TimeGenerated \r\n) on Computer, CounterName, TimeGenerated \r\n| project Computer, CounterName, TimeGenerated, UsagePercent = UsageValue * 100.0 / CapacityValue",
"size": 0,
"aggregation": 5,
"title": "Node CPU Utilization %",
"timeContext": {
"durationMs": 0
},
"timeContextFromParameter": "timeRange",
"queryType": 0,
"resourceType": "microsoft.containerservice/managedclusters",
"visualization": "timechart",
"gridSettings": {
"filter": true
},
"chartSettings": {
"showLegend": true,
"ySettings": {
"numberFormatSettings": {
"unit": 1,
"options": {
"style": "decimal",
"useGrouping": true,
"maximumSignificantDigits": 3
}
}
}
}
},
"name": "node_cpu_utilization_percent_query"
}
]
},
"customWidth": "50",
"name": "node_cpu_group",
"styleSettings": {
"margin": "10",
"padding": "10",
"maxWidth": "50",
"showBorder": true
}
},
{
"type": 12,
"content": {
"version": "NotebookGroup/1.0",
"groupType": "editable",
"items": [
{
"type": 3,
"content": {
"version": "KqlItem/1.0",
"query": "let trendBinSize = case(\r\n {timeRange:end}-{timeRange:start} <= 12h, 1m, \r\n {timeRange:end}-{timeRange:start} > 12h and {timeRange:end}-{timeRange:start} <= 24h, 5m,\r\n {timeRange:end}-{timeRange:start} > 24h and {timeRange:end}-{timeRange:start} <= 3d, 10m, \r\n {timeRange:end}-{timeRange:start} > 3d and {timeRange:end}-{timeRange:start} <= 5d, 30m,\r\n 1h);\r\nlet materializedPerfData =\r\nPerf \r\n| where ObjectName == 'K8SNode'\r\n| summarize arg_max(TimeGenerated, *) by CounterName, Computer, bin(TimeGenerated, trendBinSize) \r\n| where CounterName == 'memoryRssBytes' or CounterName == 'memoryCapacityBytes' \r\n| project TimeGenerated, Computer, CounterName, CounterValue\r\n| summarize StoredValue = max(CounterValue) by Computer, CounterName, bin(TimeGenerated, trendBinSize);\r\n\r\nKubeNodeInventory \r\n| extend labels=parse_json(Labels)\r\n| extend agentpool=tostring(['labels'][0]['agentpool'])\r\n| where agentpool in ({clustername})\r\n| summarize arg_max(TimeGenerated, *) by Computer, bin(TimeGenerated, trendBinSize) \r\n| join( \r\nmaterializedPerfData \r\n| where CounterName == 'cpuAllocatableNanoCores' or CounterName == 'memoryCapacityBytes'\r\n| project Computer, CounterName = iif(CounterName == 'cpuAllocatableNanoCores', 'cpu', 'memory'), CapacityValue = StoredValue, TimeGenerated \r\n) on Computer, TimeGenerated \r\n| join kind=inner( \r\nmaterializedPerfData \r\n| where CounterName == 'cpuUsageNanoCores' or CounterName == 'memoryRssBytes' \r\n| project Computer, CounterName = iif(CounterName == 'cpuUsageNanoCores', 'cpu', 'memory'), UsageValue = StoredValue, TimeGenerated \r\n) on Computer, CounterName, TimeGenerated \r\n| project Computer, CounterName, TimeGenerated, UsagePercent = UsageValue * 100.0 / CapacityValue",
"size": 0,
"aggregation": 5,
"title": "Node Memory Utilization %",
"timeContext": {
"durationMs": 0
},
"timeContextFromParameter": "timeRange",
"queryType": 0,
"resourceType": "microsoft.containerservice/managedclusters",
"visualization": "timechart",
"chartSettings": {
"yAxis": [
"UsagePercent"
],
"showLegend": true,
"ySettings": {
"numberFormatSettings": {
"unit": 1,
"options": {
"style": "decimal",
"useGrouping": true,
"maximumSignificantDigits": 3
}
}
}
}
},
"name": "node_memory_utilization_percent_query"
}
]
},
"customWidth": "50",
"name": "node_memory_group",
"styleSettings": {
"margin": "10",
"padding": "10",
"maxWidth": "50",
"showBorder": true
}
},
{
"type": 12,
"content": {
"version": "NotebookGroup/1.0",
"groupType": "editable",
"items": [
{
"type": 3,
"content": {
"version": "KqlItem/1.0",
"query": "let trendBinSize = case(\r\n {timeRange:end}-{timeRange:start} <= 12h, 1m, \r\n {timeRange:end}-{timeRange:start} > 12h and {timeRange:end}-{timeRange:start} <= 24h, 5m,\r\n {timeRange:end}-{timeRange:start} > 24h and {timeRange:end}-{timeRange:start} <= 3d, 10m, \r\n {timeRange:end}-{timeRange:start} > 3d and {timeRange:end}-{timeRange:start} <= 5d, 30m,\r\n 1h);\r\nlet rawData = \r\nKubeNodeInventory \r\n| extend labels=parse_json(Labels)\r\n| extend agentpool=tostring(['labels'][0]['agentpool'])\r\n| where agentpool in ({clustername})\r\n| distinct ClusterId, TimeGenerated \r\n| summarize ClusterSnapshotCount = count() by Timestamp = bin(TimeGenerated, trendBinSize), ClusterId \r\n| join hint.strategy=broadcast ( \r\n KubeNodeInventory\r\n | extend labels = parse_json(Labels)\r\n | extend agentpool=tostring(['labels'][0]['agentpool'])\r\n | where agentpool in ({clustername})\r\n | summarize TotalCount = count(), ReadyCount = sumif(1, Status contains ('Ready')) by ClusterId, Timestamp = bin(TimeGenerated, trendBinSize), agentpool\r\n | extend NotReadyCount = TotalCount - ReadyCount \r\n ) on ClusterId, Timestamp \r\n| project ClusterId, Timestamp, agentpool, \r\nTotalCount = todouble(TotalCount) / ClusterSnapshotCount, \r\nReadyCount = todouble(ReadyCount) / ClusterSnapshotCount, \r\nNotReadyCount = todouble(NotReadyCount) / ClusterSnapshotCount; \r\n\r\nrawData \r\n| order by Timestamp asc",
"size": 0,
"aggregation": 5,
"title": "Node Count",
"timeContext": {
"durationMs": 0
},
"timeContextFromParameter": "timeRange",
"queryType": 0,
"resourceType": "microsoft.containerservice/managedclusters",
"visualization": "timechart",
"gridSettings": {
"filter": true
},
"chartSettings": {
"showLegend": true
}
},
"name": "node_count_query"
}
]
},
"customWidth": "50",
"name": "node_count_group",
"styleSettings": {
"margin": "10",
"padding": "10",
"maxWidth": "50",
"showBorder": true
}
},
{
"type": 12,
"content": {
"version": "NotebookGroup/1.0",
"groupType": "editable",
"items": [
{
"type": 3,
"content": {
"version": "KqlItem/1.0",
"query": "let trendBinSize = case(\r\n {timeRange:end}-{timeRange:start} <= 12h, 1m, \r\n {timeRange:end}-{timeRange:start} > 12h and {timeRange:end}-{timeRange:start} <= 24h, 5m,\r\n {timeRange:end}-{timeRange:start} > 24h and {timeRange:end}-{timeRange:start} <= 3d, 10m, \r\n {timeRange:end}-{timeRange:start} > 3d and {timeRange:end}-{timeRange:start} <= 5d, 30m,\r\n 1h); \r\nKubePodInventory \r\n| distinct TimeGenerated, Namespace \r\n| summarize ClusterSnapshotCount = count() by bin(TimeGenerated, trendBinSize), Namespace \r\n| join hint.strategy=broadcast ( \r\nKubePodInventory\r\n| summarize PodStatus=any(PodStatus) by TimeGenerated, PodUid, Namespace \r\n| summarize Total = count(), \r\nPending = sumif(1, PodStatus =~ 'Pending'), \r\nRunning = sumif(1, PodStatus =~ 'Running'), \r\nSucceeded = sumif(1, PodStatus =~ 'Succeeded'), \r\nFailed = sumif(1, PodStatus =~ 'Failed'), \r\nTerminating = sumif(1, PodStatus =~ 'Terminating') \r\nby Namespace, bin(TimeGenerated, trendBinSize) \r\n) on Namespace, TimeGenerated\r\n| extend Unknown = Total - Pending - Running - Succeeded - Failed - Terminating \r\n| project Namespace, Timestamp = TimeGenerated, \r\nTotal = todouble(Total) / ClusterSnapshotCount, \r\nPending = todouble(Pending) / ClusterSnapshotCount, \r\nRunning = todouble(Running) / ClusterSnapshotCount, \r\nSucceeded = todouble(Succeeded) / ClusterSnapshotCount, \r\nFailed = todouble(Failed) / ClusterSnapshotCount, \r\nTerminating = todouble(Terminating) / ClusterSnapshotCount, \r\nUnknown = todouble(Unknown) / ClusterSnapshotCount",
"size": 0,
"aggregation": 5,
"title": "Active Pod Count",
"timeContext": {
"durationMs": 0
},
"timeContextFromParameter": "timeRange",
"queryType": 0,
"resourceType": "microsoft.containerservice/managedclusters",
"visualization": "timechart",
"gridSettings": {
"filter": true
},
"chartSettings": {
"showLegend": true
}
},
"name": "active_pod_count_query"
}
]
},
"customWidth": "50",
"name": "active_pod_group",
"styleSettings": {
"margin": "10",
"padding": "10",
"maxWidth": "50",
"showBorder": true
}
}
]
},
"conditionalVisibility": {
"parameterName": "selectedTab",
"comparison": "isEqualTo",
"value": "clusterOverview"
},
"name": "clusterOverview_group",
"styleSettings": {
"showBorder": true
}
},
{
"type": 12,
"content": {
"version": "NotebookGroup/1.0",
"groupType": "editable",
"items": [
{
"type": 9,
"content": {
"version": "KqlParameterItem/1.0",
"parameters": [
{
"id": "4bf91b5b-4406-4813-8cd2-eccb737f3a41",
"version": "KqlParameterItem/1.0",
"name": "namespace",
"label": "Presto Namespace",
"type": 2,
"description": "Select namespaces of this Presto cluster",
"isRequired": true,
"multiSelect": true,
"quote": "'",
"delimiter": ",",
"query": "KubePodInventory\r\n| distinct Namespace",
"typeSettings": {
"additionalResourceOptions": [
"value::all"
],
"showDefault": false
},
"timeContext": {
"durationMs": 604800000
},
"timeContextFromParameter": "timeRange",
"defaultValue": "value::all",
"queryType": 0,
"resourceType": "microsoft.containerservice/managedclusters"
}
],
"style": "above",
"queryType": 0,
"resourceType": "microsoft.containerservice/managedclusters"
},
"name": "parameters - 0 - Copy"
},
{
"type": 11,
"content": {
"version": "LinkItem/1.0",
"style": "tabs",
"links": [
{
"id": "ca80d8fd-e466-4915-b8ca-743ec007959d",
"cellValue": "selectedTab",
"linkTarget": "parameter",
"linkLabel": "Cluster Stats",
"subTarget": "llap_cluster_stats_group",
"style": "link"
}
]
},
"name": "flinkTabs"
}
]
},
"conditionalVisibility": {
"parameterName": "selectedTab",
"comparison": "isEqualTo",
"value": "presto_cluster_group"
},
"name": "presto_cluster_group"
}
],
"fallbackResourceIds": [],
"$schema": "https://github.com/Microsoft/Application-Insights-Workbooks/blob/master/schema/workbook.json"
}