-
Notifications
You must be signed in to change notification settings - Fork 27
/
metrics.json
738 lines (738 loc) · 36.7 KB
/
metrics.json
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
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
{
"SELECT host, ROUND(SUM(memory_size_in_total)/1024/1024) column_tables_used_mb FROM sys.m_cs_tables GROUP BY host;":
{
"enabled": true,
"hana_version_range": ["1.0.0", "3.0.0"],
"metrics": [
{
"name": "hanadb_column_tables_used_memory",
"description": "Column tables total memory used in MB",
"labels": ["HOST"],
"value": "COLUMN_TABLES_USED_MB",
"unit": "mb",
"type": "gauge"
}
]
},
"SELECT host, schema_name, ROUND(SUM(memory_size_in_total)/1024/1024) schema_memory_used_mb FROM sys.m_cs_tables GROUP BY host, schema_name;":
{
"enabled": true,
"hana_version_range": ["1.0.0"],
"metrics": [
{
"name": "hanadb_schema_used_memory",
"description": "Total used memory by schema in MB",
"labels": ["HOST", "SCHEMA_NAME"],
"value": "SCHEMA_MEMORY_USED_MB",
"unit": "mb",
"type": "gauge"
}
]
},
"SELECT MAX(TIMESTAMP) TIMESTAMP, HOST, MEASURED_ELEMENT_NAME CORE, SUM(MAP(CAPTION, 'User Time', TO_NUMBER(VALUE), 0)) USER_PCT, SUM(MAP(CAPTION, 'System Time', TO_NUMBER(VALUE), 0)) SYSTEM_PCT, SUM(MAP(CAPTION, 'Wait Time', TO_NUMBER(VALUE), 0)) WAITIO_PCT, SUM(MAP(CAPTION, 'Idle Time', 0, TO_NUMBER(VALUE))) BUSY_PCT, SUM(MAP(CAPTION, 'Idle Time', TO_NUMBER(VALUE), 0)) IDLE_PCT FROM sys.M_HOST_AGENT_METRICS WHERE MEASURED_ELEMENT_TYPE = 'Processor' GROUP BY HOST, MEASURED_ELEMENT_NAME;":
{
"enabled": true,
"metrics": [
{
"name": "hanadb_cpu_user",
"description": "Percentage of CPU time spent by HANA DB in user space, over the last minute (in seconds)",
"labels": ["HOST", "CORE"],
"value": "USER_PCT",
"unit": "percent",
"type": "gauge"
},
{
"name": "hanadb_cpu_system",
"description": "Percentage of CPU time spent by HANA DB in Kernel space, over the last minute (in seconds)",
"labels": ["HOST", "CORE"],
"value": "SYSTEM_PCT",
"unit": "percent",
"type": "gauge"
},
{
"name": "hanadb_cpu_waitio",
"description": "Percentage of CPU time spent by HANA DB in IO mode, over the last minute (in seconds)",
"labels": ["HOST", "CORE"],
"value": "WAITIO_PCT",
"unit": "percent",
"type": "gauge"
},
{
"name": "hanadb_cpu_busy",
"description": "Percentage of CPU time spent by HANA DB, over the last minute (in seconds)",
"labels": ["HOST", "CORE"],
"value": "BUSY_PCT",
"unit": "percent",
"type": "gauge"
},
{
"name": "hanadb_cpu_idle",
"description": "Percentage of CPU time not spent by HANA DB, over the last minute (in seconds)",
"labels": ["HOST", "CORE"],
"value": "IDLE_PCT",
"unit": "percent",
"type": "gauge"
}
]
},
"SELECT MAX(timestamp) timestamp, host, measured_element_name interface, MAX(MAP(caption, 'Collision Rate', TO_NUMBER(value), 0)) coll_per_s, MAX(MAP(caption, 'Receive Rate', TO_NUMBER(value), 0)) recv_kb_per_s, MAX(MAP(caption, 'Transmit Rate', TO_NUMBER(value), 0)) trans_kb_per_s,MAX(MAP(caption, 'Packet Receive Rate', TO_NUMBER(value), 0)) recv_pack_per_s, MAX(MAP(caption, 'Packet Transmit Rate', TO_NUMBER(value), 0)) trans_pack_per_s, MAX(MAP(caption, 'Receive Error Rate', TO_NUMBER(value), 0)) recv_err_per_s, MAX(MAP(caption, 'Transmit Error Rate', TO_NUMBER(value), 0)) trans_err_per_s FROM sys.m_host_agent_metrics WHERE measured_element_type = 'NetworkPort' GROUP BY host, measured_element_name;":
{
"enabled": true,
"metrics": [
{
"name": "hanadb_network_collisions_per",
"description": "Network collisions per second",
"labels": ["HOST", "INTERFACE"],
"value": "COLL_PER_S",
"unit": "seconds",
"type": "gauge"
},
{
"name": "hanadb_network_receive_rate_kb_per",
"description": "Network received rate in kilobytes per seconds",
"labels": ["HOST", "INTERFACE"],
"value": "RECV_KB_PER_S",
"unit": "seconds",
"type": "gauge"
},
{
"name": "hanadb_network_transmission_rate_kb_per",
"description": "Network transmission rate in kilobytes per seconds",
"labels": ["HOST", "INTERFACE"],
"value": "TRANS_KB_PER_S",
"unit": "seconds",
"type": "gauge"
},
{
"name": "hanadb_network_receive_requests_per",
"description": "Network receive rate in requests (packets) per seconds",
"labels": ["HOST", "INTERFACE"],
"value": "RECV_PACK_PER_S",
"unit": "seconds",
"type": "gauge"
},
{
"name": "hanadb_network_transmission_rate_requests_per",
"description": "Network transmission rate in requests (packets) per seconds",
"labels": ["HOST", "INTERFACE"],
"value": "TRANS_PACK_PER_S",
"unit": "seconds",
"type": "gauge"
},
{
"name": "hanadb_network_receive_rate_errors_per",
"description": "Network receive rate of errors per seconds",
"labels": ["HOST", "INTERFACE"],
"value": "RECV_ERR_PER_S",
"unit": "seconds",
"type": "gauge"
},
{
"name": "hanadb_network_transmission_rate_errors_per",
"description": "Network tramission rate of errors per seconds",
"labels": ["HOST", "INTERFACE"],
"value": "TRANS_ERR_PER_S",
"unit": "seconds",
"type": "gauge"
}
]
},
"SELECT host, LPAD(port,5) port, file_name, file_type, used_size/1024/1024 used_size_mb, total_size/1024/1024 total_size_mb, (total_size - used_size)/1024/1024 available_size_mb, LPAD(TO_DECIMAL(MAP(total_size, 0, 0, ( 1 - used_size / total_size ) * 100), 10, 2), 8) frag_pct FROM sys.m_volume_files WHERE file_type = 'DATA';":
{
"enabled": true,
"metrics": [
{
"name": "hanadb_disk_data_files_used_size",
"description": "Used space per file and file type (in MB)",
"labels": ["HOST", "PORT", "FILE_NAME", "FILE_TYPE"],
"value": "USED_SIZE_MB",
"unit": "mb",
"type": "gauge"
},
{
"name": "hanadb_disk_data_files_total_size",
"description": "Total space per file and file type (in MB)",
"labels": ["HOST", "PORT", "FILE_NAME", "FILE_TYPE"],
"value": "TOTAL_SIZE_MB",
"unit": "mb",
"type": "gauge"
},
{
"name": "hanadb_disk_data_files_available_size",
"description": "Available space per file and file type (in MB)",
"labels": ["HOST", "PORT", "FILE_NAME", "FILE_TYPE"],
"value": "AVAILABLE_SIZE_MB",
"unit": "mb",
"type": "gauge"
},
{
"name": "hanadb_disk_data_files_fragmentation",
"description": "Percentage of unused space compared to total space in file",
"labels": ["HOST", "PORT", "FILE_NAME", "FILE_TYPE"],
"value": "FRAG_PCT",
"unit": "percent",
"type": "gauge"
}
]
},
"SELECT md.host, md.usage_type, md.path, md.filesystem_type, TO_DECIMAL(md.total_device_size / 1024 / 1024, 10, 2) total_device_size_mb, TO_DECIMAL(md.total_size / 1024 / 1024, 10, 2) total_size_mb, TO_DECIMAL(md.used_size / 1024 / 1024, 10, 2) total_used_size_mb, TO_DECIMAL(du.used_size / 1024 / 1024, 10, 2) used_size_mb FROM sys.m_disk_usage du, sys.m_disks md WHERE du.host = md.host AND du.usage_type = md.usage_type;":
{
"enabled": true,
"metrics": [
{
"name": "hanadb_disk_total_device_size",
"description": "Total device size returned by the operating system (in MB). It will be repeated if the device is shared between usages_types.",
"labels": ["HOST", "USAGE_TYPE", "PATH", "FILESYSTEM_TYPE"],
"value": "TOTAL_DEVICE_SIZE_MB",
"unit": "mb",
"type": "gauge"
},
{
"name": "hanadb_disk_total_size",
"description": "Specifies the volume size in MB. It will be repeated if the volume is shared between usages_types.",
"labels": ["HOST", "USAGE_TYPE", "PATH", "FILESYSTEM_TYPE"],
"value": "TOTAL_SIZE_MB",
"unit": "mb",
"type": "gauge"
},
{
"name": "hanadb_disk_total_used_size",
"description": "Specifies the used volume size in MB. It will be repeated if the volume is shared between usages_types.",
"labels": ["HOST", "USAGE_TYPE", "PATH", "FILESYSTEM_TYPE"],
"value": "TOTAL_USED_SIZE_MB",
"unit": "mb",
"type": "gauge"
},
{
"name": "hanadb_disk_used_size",
"description": "Size of used disk space in MB based on usage_type",
"labels": ["HOST", "USAGE_TYPE", "PATH", "FILESYSTEM_TYPE"],
"value": "USED_SIZE_MB",
"unit": "mb",
"type": "gauge"
}
]
},
"SELECT host, disk, queue_length, srv_ms + wait_ms latency_ms, srv_ms, wait_ms, io_per_s, tp_kbps FROM( SELECT MAX(TIMESTAMP) timestamp, host, measured_element_name disk, MAX(MAP(caption, 'Queue Length', TO_NUMBER(value), 0)) queue_length, MAX(MAP(caption, 'Service Time', TO_NUMBER(value), 0)) srv_ms, MAX(MAP(caption, 'Wait Time', TO_NUMBER(value), 0)) wait_ms, MAX(MAP(caption, 'I/O Rate', TO_NUMBER(value), 0)) io_per_s, MAX(MAP(caption, 'Total Throughput', TO_NUMBER(value), 0)) tp_kbps FROM sys.m_host_agent_metrics WHERE measured_element_type = 'Disk' GROUP BY host, measured_element_name);":
{
"enabled": true,
"metrics": [
{
"name": "hanadb_disk_io_queue_length",
"description": "I/O queue length (average queue length of the requests that were issued to the Disk Device)",
"labels": ["HOST", "DISK"],
"value": "QUEUE_LENGTH",
"unit": "requests",
"type": "gauge"
},
{
"name": "hanadb_disk_io_latency",
"description": "Total I/O latency (ms), calculated from the sum of service and wait time",
"labels": ["HOST", "DISK"],
"value": "LATENCY_MS",
"unit": "ms",
"type": "gauge"
},
{
"name": "hanadb_disk_io_service_time",
"description": "I/O service time in ms",
"labels": ["HOST", "DISK"],
"value": "SRV_MS",
"unit": "ms",
"type": "gauge"
},
{
"name": "hanadb_disk_io_wait_time",
"description": "I/O service time in ms",
"labels": ["HOST", "DISK"],
"value": "WAIT_MS",
"unit": "ms",
"type": "gauge"
},
{
"name": "hanadb_disk_io_requests_per",
"description": "I/O requests per second",
"labels": ["HOST", "DISK"],
"value": "IO_PER_S",
"unit": "second",
"type": "gauge"
},
{
"name": "hanadb_disk_io_throughput",
"description": "I/O throughput in KB/seconds",
"labels": ["HOST", "DISK"],
"value": "TP_KBPS",
"unit": "kb_second",
"type": "gauge"
}
]
},
"SELECT m.host, LPAD(m.port, 5) port, m.service_name service, TO_DECIMAL(m.shared_memory_allocated_size / 1024 / 1024, 10, 2) shm_alloc_mb, TO_DECIMAL(m.shared_memory_used_size / 1024 / 1024, 10, 2) shm_used_mb, TO_DECIMAL(MAP(m.shared_memory_allocated_size, 0, 0, m.shared_memory_used_size / m.shared_memory_allocated_size * 100), 10, 2) shm_used_pct, TO_DECIMAL(m.heap_memory_allocated_size / 1024 / 1024, 10, 2) heap_alloc_mb, TO_DECIMAL(m.heap_memory_used_size / 1024 / 1024, 10, 2) heap_used_mb, TO_DECIMAL(MAP(m.heap_memory_allocated_size, 0, 0, m.heap_memory_used_size / m.heap_memory_allocated_size * 100), 10, 2) heap_used_pct, TO_DECIMAL(m.total_memory_used_size / 1024 / 1024, 10, 2) total_memory_used_mb, TO_DECIMAL(m.physical_memory_size / 1024 / 1024, 10, 2) total_phys_mem_mb, TO_DECIMAL(m.logical_memory_size / 1024 / 1024, 10, 2) total_logical_mem_mb, TO_DECIMAL(m.code_size / 1024 / 1024, 10, 2) code_size_mem_mb, TO_DECIMAL(m.stack_size / 1024 / 1024, 10, 2) stack_size_mem_mb, TO_DECIMAL(m.compactors_freeable_size / 1024 / 1024, 10, 2) compactors_freeable_size_mem_mb, TO_DECIMAL(m.compactors_allocated_size / 1024 / 1024, 10, 2) compactors_allocated_size_mem_mb, TO_DECIMAL(m.allocation_limit / 1024 / 1024, 10, 2) process_alloc_limit_mb, TO_DECIMAL(m.effective_allocation_limit / 1024 / 1024, 10, 2) effective_proc_alloc_limit_mb FROM sys.m_service_memory m;":
{
"enabled": true,
"metrics": [
{
"name": "hanadb_memory_service_shared_allocated",
"description": "Allocated Shared Memory part of the memory pool per service in MB",
"labels": ["HOST", "PORT", "SERVICE"],
"value": "SHM_ALLOC_MB",
"unit": "mb",
"type": "gauge"
},
{
"name": "hanadb_memory_service_shared_used",
"description": "Used Shared Memory part of the memory pool per service in MB",
"labels": ["HOST", "PORT", "SERVICE"],
"value": "SHM_USED_MB",
"unit": "mb",
"type": "gauge"
},
{
"name": "hanadb_memory_service_shared_used",
"description": "Percentage of used Shared Memory from the memory pool per service",
"labels": ["HOST", "PORT", "SERVICE"],
"value": "SHM_USED_PCT",
"unit": "percent",
"type": "gauge"
},
{
"name": "hanadb_memory_service_heap_allocated",
"description": "Allocated Heap Memory part of the memory pool per service in MB",
"labels": ["HOST", "PORT", "SERVICE"],
"value": "HEAP_ALLOC_MB",
"unit": "mb",
"type": "gauge"
},
{
"name": "hanadb_memory_service_heap_used",
"description": "Used Heap Memory part of the memory pool per service in MB",
"labels": ["HOST", "PORT", "SERVICE"],
"value": "HEAP_USED_MB",
"unit": "mb",
"type": "gauge"
},
{
"name": "hanadb_memory_service_heap_used",
"description": "Percentage of used Heap Memory part of the memory pool per service",
"labels": ["HOST", "PORT", "SERVICE"],
"value": "HEAP_USED_PCT",
"unit": "percent",
"type": "gauge"
},
{
"name": "hanadb_memory_service_total_used",
"description": "Total memory from the memory pool used per services in MB",
"labels": ["HOST", "PORT", "SERVICE"],
"value": "TOTAL_MEMORY_USED_MB",
"unit": "mb",
"type": "gauge"
},
{
"name": "hanadb_memory_service_physical_total",
"description": "Total physical resident memory size (operating system perspective) per service in MB",
"labels": ["HOST", "PORT", "SERVICE"],
"value": "TOTAL_PHYS_MEM_MB",
"unit": "mb",
"type": "gauge"
},
{
"name": "hanadb_memory_service_virtual_total",
"description": "Total Virtual memory size (operating system perspective) per service in MB",
"labels": ["HOST", "PORT", "SERVICE"],
"value": "TOTAL_LOGICAL_MEM_MB",
"unit": "mb",
"type": "gauge"
},
{
"name": "hanadb_memory_service_code_size",
"description": "Code size, including shared libraries, per service in MB",
"labels": ["HOST", "PORT", "SERVICE"],
"value": "CODE_SIZE_MEM_MB",
"unit": "mb",
"type": "gauge"
},
{
"name": "hanadb_memory_service_stack_size",
"description": "Stack size per service in MB",
"labels": ["HOST", "PORT", "SERVICE"],
"value": "STACK_SIZE_MEM_MB",
"unit": "mb",
"type": "gauge"
},
{
"name": "hanadb_memory_service_compactors_freeable_size",
"description": "Memory that can be freed during a memory shortage per service in MB",
"labels": ["HOST", "PORT", "SERVICE"],
"value": "COMPACTORS_FREEABLE_SIZE_MEM_MB",
"unit": "mb",
"type": "gauge"
},
{
"name": "hanadb_memory_service_compactors_allocated_size",
"description": "Part of the memory pool that can potentially (if unpinned) be freed during a memory shortage per service in MB",
"labels": ["HOST", "PORT", "SERVICE"],
"value": "COMPACTORS_ALLOCATED_SIZE_MEM_MB",
"unit": "mb",
"type": "gauge"
},
{
"name": "hanadb_memory_service_alloc_limit",
"description": "Maximum memory pool size (configurable value) per service in MB",
"labels": ["HOST", "PORT", "SERVICE"],
"value": "PROCESS_ALLOC_LIMIT_MB",
"unit": "mb",
"type": "gauge"
},
{
"name": "hanadb_memory_service_effective_alloc_limit",
"description": "Effective maximum memory pool size, considering the pool sizes of other processes (computed value) per service in MB",
"labels": ["HOST", "PORT", "SERVICE"],
"value": "PROCESS_ALLOC_LIMIT_MB",
"unit": "mb",
"type": "gauge"
}
]
},
"SELECT host, ROUND((used_physical_memory + free_physical_memory) / 1024 / 1024, 2) host_physical_mem_mb, ROUND(used_physical_memory / 1024 / 1024, 2) host_resident_mem_mb, ROUND(free_physical_memory / 1024 / 1024, 2) host_free_physical_mem_mb, ROUND(free_swap_space / 1024 / 1024, 2) host_free_swap_mb, ROUND(used_swap_space / 1024 / 1024, 2) host_used_swap_mb, ROUND(allocation_limit / 1024 / 1024, 2) host_alloc_limit_mb, ROUND(instance_total_memory_used_size / 1024 / 1024, 2) host_total_used_mem_mb, ROUND(instance_total_memory_peak_used_size / 1024 / 1024, 2) host_total_peak_used_mem_mb, ROUND(instance_total_memory_allocated_size / 1024 / 1024, 2) host_total_alloc_mem_mb, ROUND(instance_code_size / 1024 / 1024, 2) host_code_size_mb, ROUND(instance_shared_memory_allocated_size / 1024 / 1024, 2) host_shr_mem_alloc_mb FROM sys.m_host_resource_utilization;":
{
"enabled": true,
"metrics": [
{
"name": "hanadb_host_memory_physical_total",
"description": "Total physical memory per host in MB",
"labels": ["HOST"],
"value": "HOST_PHYSICAL_MEM_MB",
"unit": "mb",
"type": "gauge"
},
{
"name": "hanadb_host_memory_resident",
"description": "Total resident (used physical) memory per host in MB",
"labels": ["HOST"],
"value": "HOST_RESIDENT_MEM_MB",
"unit": "mb",
"type": "gauge"
},
{
"name": "hanadb_host_memory_physical_free",
"description": "Free physical memory per host in MB",
"labels": ["HOST"],
"value": "HOST_FREE_PHYSICAL_MEM_MB",
"unit": "mb",
"type": "gauge"
},
{
"name": "hanadb_host_memory_swap_free",
"description": "Free swap memory per host in MB",
"labels": ["HOST"],
"value": "HOST_FREE_SWAP_MB",
"unit": "mb",
"type": "gauge"
},
{
"name": "hanadb_host_memory_swap_used",
"description": "Used swap memory per host in MB",
"labels": ["HOST"],
"value": "HOST_USED_SWAP_MB",
"unit": "mb",
"type": "gauge"
},
{
"name": "hanadb_host_memory_alloc_limit",
"description": "Memory allocation limit for all process per host in MB",
"labels": ["HOST"],
"value": "HOST_ALLOC_LIMIT_MB",
"unit": "mb",
"type": "gauge"
},
{
"name": "hanadb_host_memory_used_total",
"description": "Amount of memory from the memory pool that is currently being used by SAP HANA processes per host in MB",
"labels": ["HOST"],
"value": "HOST_TOTAL_USED_MEM_MB",
"unit": "mb",
"type": "gauge"
},
{
"name": "hanadb_host_memory_used_peak",
"description": "Peak memory from the memory pool used by SAP HANA processes since the instance started (this is a sample-based value) per host in MB",
"labels": ["HOST"],
"value": "HOST_TOTAL_PEAK_USED_MEM_MB",
"unit": "mb",
"type": "gauge"
},
{
"name": "hanadb_host_memory_pool_size",
"description": "Size of the memory pool for all SAP HANA processes per host in MB",
"labels": ["HOST"],
"value": "HOST_TOTAL_ALLOC_MEM_MB",
"unit": "mb",
"type": "gauge"
},
{
"name": "hanadb_host_memory_code_size",
"description": "Code size, including shared libraries of SAP HANA processes per host in MB",
"labels": ["HOST"],
"value": "HOST_CODE_SIZE_MB",
"unit": "mb",
"type": "gauge"
},
{
"name": "hanadb_host_memory_shared_alloc",
"description": "Shared memory size of SAP HANA processes per host in MB",
"labels": ["HOST"],
"value": "HOST_SHR_MEM_ALLOC_MB",
"unit": "mb",
"type": "gauge"
}
]
},
"SELECT HOST, LPAD(PORT, 5) PORT, SERVICE_NAME SERVICE, SQL_TYPE, EXECUTIONS EXECUTIONS, ROUND(ELAPSED_MS) ELAPSED_MS, TO_DECIMAL(ELA_PER_EXEC_MS, 10, 2) ELA_PER_EXEC_MS, TO_DECIMAL(LOCK_PER_EXEC_MS, 10, 2) LOCK_PER_EXEC_MS, ROUND(MAX_ELA_MS) MAX_ELA_MS FROM( SELECT S.HOST, S.PORT, S.SERVICE_NAME, L.SQL_TYPE, CASE L.SQL_TYPE WHEN 'SELECT' THEN SUM(C.SELECT_EXECUTION_COUNT) WHEN 'SELECT FOR UPDATE' THEN SUM(C.SELECT_FOR_UPDATE_COUNT) WHEN 'INSERT/UPDATE/DELETE' THEN SUM(C.UPDATE_COUNT) WHEN 'READ ONLY TRANSACTION' THEN SUM(C.READ_ONLY_TRANSACTION_COUNT) WHEN 'UPDATE TRANSACTION' THEN SUM(C.UPDATE_TRANSACTION_COUNT) WHEN 'ROLLBACK' THEN SUM(C.ROLLBACK_COUNT) WHEN 'OTHERS' THEN SUM(C.OTHERS_COUNT) WHEN 'PREPARE' THEN SUM(C.TOTAL_PREPARATION_COUNT) END EXECUTIONS, CASE L.SQL_TYPE WHEN 'SELECT' THEN SUM(C.SELECT_TOTAL_EXECUTION_TIME) / 1000 WHEN 'SELECT FOR UPDATE' THEN SUM(C.SELECT_FOR_UPDATE_TOTAL_EXECUTION_TIME) / 1000 WHEN 'INSERT/UPDATE/DELETE' THEN SUM(C.UPDATE_TOTAL_EXECUTION_TIME) / 1000 WHEN 'READ ONLY TRANSACTION' THEN SUM(C.READ_ONLY_TRANSACTION_TOTAL_EXECUTION_TIME) / 1000 WHEN 'UPDATE TRANSACTION' THEN SUM(C.UPDATE_TRANSACTION_TOTAL_EXECUTION_TIME) / 1000 WHEN 'ROLLBACK' THEN SUM(C.ROLLBACK_TOTAL_EXECUTION_TIME) / 1000 WHEN 'OTHERS' THEN SUM(C.OTHERS_TOTAL_EXECUTION_TIME) / 1000 WHEN 'PREPARE' THEN SUM(C.TOTAL_PREPARATION_TIME) / 1000 END ELAPSED_MS, CASE L.SQL_TYPE WHEN 'SELECT' THEN MAP(SUM(C.SELECT_EXECUTION_COUNT), 0, 0, SUM(C.SELECT_TOTAL_EXECUTION_TIME) / 1000 / SUM(C.SELECT_EXECUTION_COUNT)) WHEN 'SELECT FOR UPDATE' THEN MAP(SUM(C.SELECT_FOR_UPDATE_COUNT), 0, 0, SUM(C.SELECT_FOR_UPDATE_TOTAL_EXECUTION_TIME) / 1000 / SUM(C.SELECT_FOR_UPDATE_COUNT)) WHEN 'INSERT/UPDATE/DELETE' THEN MAP(SUM(C.UPDATE_COUNT), 0, 0, SUM(C.UPDATE_TOTAL_EXECUTION_TIME) / 1000 / SUM(C.UPDATE_COUNT)) WHEN 'READ ONLY TRANSACTION' THEN MAP(SUM(C.READ_ONLY_TRANSACTION_COUNT), 0, 0, SUM(C.READ_ONLY_TRANSACTION_TOTAL_EXECUTION_TIME) / 1000 / SUM(C.READ_ONLY_TRANSACTION_COUNT)) WHEN 'UPDATE TRANSACTION' THEN MAP(SUM(C.UPDATE_TRANSACTION_COUNT), 0, 0, SUM(C.UPDATE_TRANSACTION_TOTAL_EXECUTION_TIME) / 1000 / SUM(C.UPDATE_TRANSACTION_COUNT)) WHEN 'ROLLBACK' THEN MAP(SUM(C.ROLLBACK_COUNT), 0, 0, SUM(C.ROLLBACK_TOTAL_EXECUTION_TIME) / 1000 / SUM(C.ROLLBACK_COUNT)) WHEN 'OTHERS' THEN MAP(SUM(C.OTHERS_COUNT), 0, 0, SUM(C.OTHERS_TOTAL_EXECUTION_TIME) / 1000 / SUM(C.OTHERS_COUNT)) WHEN 'PREPARE' THEN MAP(SUM(C.TOTAL_PREPARATION_COUNT), 0, 0, SUM(C.TOTAL_PREPARATION_TIME) / 1000 / SUM(C.TOTAL_PREPARATION_COUNT)) END ELA_PER_EXEC_MS, CASE L.SQL_TYPE WHEN 'SELECT' THEN 0 WHEN 'SELECT FOR UPDATE' THEN MAP(SUM(C.SELECT_FOR_UPDATE_COUNT), 0, 0, SUM(C.SELECT_FOR_UPDATE_TOTAL_LOCK_WAIT_TIME) / 1000 / SUM(C.SELECT_FOR_UPDATE_COUNT)) WHEN 'INSERT/UPDATE/DELETE' THEN MAP(SUM(C.UPDATE_COUNT), 0, 0, SUM(C.UPDATE_TOTAL_LOCK_WAIT_TIME) / 1000 / SUM(C.UPDATE_COUNT)) WHEN 'READ ONLY TRANSACTION' THEN 0 WHEN 'UPDATE TRANSACTION' THEN 0 WHEN 'ROLLBACK' THEN 0 WHEN 'OTHERS' THEN MAP(SUM(C.OTHERS_COUNT), 0, 0, SUM(C.OTHERS_TOTAL_LOCK_WAIT_TIME) / 1000 / SUM(C.OTHERS_COUNT)) WHEN 'PREPARE' THEN 0 END LOCK_PER_EXEC_MS, CASE L.SQL_TYPE WHEN 'SELECT' THEN MAX(C.SELECT_MAX_EXECUTION_TIME) / 1000 WHEN 'SELECT FOR UPDATE' THEN MAX(C.SELECT_FOR_UPDATE_MAX_EXECUTION_TIME) / 1000 WHEN 'INSERT/UPDATE/DELETE' THEN MAX(C.UPDATE_MAX_EXECUTION_TIME) / 1000 WHEN 'READ ONLY TRANSACTION' THEN MAX(C.READ_ONLY_TRANSACTION_MAX_EXECUTION_TIME) / 1000 WHEN 'UPDATE TRANSACTION' THEN MAX(C.UPDATE_TRANSACTION_MAX_EXECUTION_TIME) / 1000 WHEN 'ROLLBACK' THEN MAX(C.ROLLBACK_MAX_EXECUTION_TIME) / 1000 WHEN 'OTHERS' THEN MAX(C.OTHERS_MAX_EXECUTION_TIME) / 1000 WHEN 'PREPARE' THEN MAX(C.MAX_PREPARATION_TIME) / 1000 END MAX_ELA_MS FROM SYS.M_SERVICES S, ( SELECT 1 LINE_NO, 'SELECT' SQL_TYPE FROM DUMMY UNION ALL ( SELECT 2, 'SELECT FOR UPDATE' FROM DUMMY ) UNION ALL ( SELECT 3, 'INSERT/UPDATE/DELETE' FROM DUMMY ) UNION ALL ( SELECT 4, 'READ ONLY TRANSACTION' FROM DUMMY ) UNION ALL ( SELECT 5, 'UPDATE TRANSACTION' FROM DUMMY ) UNION ALL ( SELECT 6, 'ROLLBACK' FROM DUMMY ) UNION ALL ( SELECT 7, 'OTHERS' FROM DUMMY ) UNION ALL ( SELECT 8, 'PREPARE' FROM DUMMY ) ) L, SYS.M_CONNECTION_STATISTICS C WHERE C.HOST = S.HOST AND C.PORT = S.PORT GROUP BY S.HOST, S.PORT, S.SERVICE_NAME, L.SQL_TYPE, L.LINE_NO);":
{
"enabled": true,
"metrics": [
{
"name": "hanadb_sql_service_executions",
"description": "Total number of SQL statements executions by service and SQL type",
"labels": ["HOST", "PORT", "SERVICE", "SQL_TYPE"],
"value": "EXECUTIONS",
"unit": "count",
"type": "gauge"
},
{
"name": "hanadb_sql_service_elapsed_time",
"description": "Total elapsed time of SQL statements executions by service and SQL type in miliseconds",
"labels": ["HOST", "PORT", "SERVICE", "SQL_TYPE"],
"value": "ELAPSED_MS",
"unit": "ms",
"type": "gauge"
},
{
"name": "hanadb_sql_service_elap_per_exec_avg",
"description": "Average elapsed time per execution by service and SQL type in miliseconds",
"labels": ["HOST", "PORT", "SERVICE", "SQL_TYPE"],
"value": "ELA_PER_EXEC_MS",
"unit": "ms",
"type": "gauge"
},
{
"name": "hanadb_sql_service_lock_per_exec",
"description": "Average lock wait time per execution by service and SQL type in miliseconds",
"labels": ["HOST", "PORT", "SERVICE", "SQL_TYPE"],
"value": "LOCK_PER_EXEC_MS",
"unit": "ms",
"type": "gauge"
},
{
"name": "hanadb_sql_service_max_ela_time",
"description": "Maximum elapsed time per execution by service and SQL type in miliseconds",
"labels": ["HOST", "PORT", "SERVICE", "SQL_TYPE"],
"value": "MAX_ELA_MS",
"unit": "ms",
"type": "gauge"
}
]
},
"SELECT TOP 10 host, LPAD(port, 5) port, SUBSTRING(REPLACE_REGEXPR('\n' IN statement_string WITH ' ' OCCURRENCE ALL), 1,30) sql_string, statement_hash sql_hash, execution_count, total_execution_time + total_preparation_time total_elapsed_time FROM sys.m_sql_plan_cache ORDER BY total_elapsed_time, execution_count DESC;":
{
"enabled": true,
"metrics": [
{
"name": "hanadb_sql_top_time_consumers",
"description": "Top statements time consumers. Sum of the time consumed in all executions in Microseconds",
"labels": ["HOST", "PORT", "SQL_STRING", "SQL_HASH"],
"value": "TOTAL_ELAPSED_TIME",
"unit": "mu",
"type": "gauge"
},
{
"name": "hanadb_sql_top_time_consumers",
"description": "Top statements time consumers. Number of total executions of the SQL Statement",
"labels": ["HOST", "PORT", "SQL_STRING", "SQL_HASH"],
"value": "EXECUTION_COUNT",
"unit": "count",
"type": "gauge"
}
]
},
"SELECT TOP 10 host, LPAD(port, 5) port, SUBSTRING(REPLACE_REGEXPR('\n' IN statement_string WITH ' ' OCCURRENCE ALL), 1,30) sql_string, statement_hash sql_hash, execution_count, total_execution_memory_size FROM sys.m_sql_plan_cache ORDER BY total_execution_memory_size, execution_count DESC;":
{
"enabled": true,
"metrics": [
{
"name": "hanadb_sql_top_mem_consumers",
"description": "Top statements memory consumers. Specifies the total size of tracked actual memory consumption in bytes",
"labels": ["HOST", "PORT", "SQL_STRING", "SQL_HASH"],
"value": "TOTAL_EXECUTION_MEMORY_SIZE",
"unit": "byte",
"type": "gauge"
},
{
"name": "hanadb_sql_top_mem_consumers",
"description": "Top statements time consumers. Number of total executions of the SQL Statement",
"labels": ["HOST", "PORT", "SQL_STRING", "SQL_HASH"],
"value": "EXECUTION_COUNT",
"unit": "count",
"type": "gauge"
}
]
},
"SELECT host, LPAD(port, 5) port, connection_type, MAP(connection_status,'','N/A', connection_status) connection_status, COUNT(1) total_connections FROM SYS.M_CONNECTIONS GROUP BY host, port, connection_status, connection_type;":
{
"enabled": true,
"metrics": [
{
"name": "hanadb_connections_total",
"description": "Number of connections grouped by Type and Status",
"labels": ["HOST", "PORT", "CONNECTION_TYPE", "CONNECTION_STATUS"],
"value": "TOTAL_CONNECTIONS",
"unit": "count",
"type": "gauge"
}
]
},
"SELECT TOP 10 ct.host, LPAD(ct.port,5) port, ct.schema_name, ct.table_name, TO_DECIMAL(ct.memory_size_in_total / 1024 / 1024, 10, 2) memory_size_in_total_mb, TO_DECIMAL(ct.estimated_max_memory_size_in_total / 1024 / 1024, 10, 2) estimated_max_mem_total_mb, ct.record_count, TO_DECIMAL(tps.disk_size / 1024 / 1024, 10, 2) disk_size_mb FROM sys.m_cs_tables ct, sys.m_table_persistence_statistics tps WHERE ct.schema_name = tps.schema_name AND ct.table_name = tps.table_name ORDER BY ct.memory_size_in_total DESC;":
{
"enabled": true,
"metrics": [
{
"name": "hanadb_table_cs_top_mem_total",
"description": "Top 10 tables consuming more memory. The total memory size (MB) is the sum of memory size in the main, delta, and history parts",
"labels": ["HOST", "PORT", "SCHEMA_NAME", "TABLE_NAME"],
"value": "MEMORY_SIZE_IN_TOTAL_MB",
"unit": "mb",
"type": "gauge"
},
{
"name": "hanadb_table_cs_top_mem_estimated_max",
"description": "Top 10 tables consuming more memory. The estimated maximum memory consumption (MB), in total, for the fully loaded table (data for open transactions is not included)",
"labels": ["HOST", "PORT", "SCHEMA_NAME", "TABLE_NAME"],
"value": "ESTIMATED_MAX_MEM_TOTAL_MB",
"unit": "mb",
"type": "gauge"
},
{
"name": "hanadb_table_cs_top_mem_record",
"description": "Top 10 tables consuming more memory. The record count of the table",
"labels": ["HOST", "PORT", "SCHEMA_NAME", "TABLE_NAME"],
"value": "RECORD_COUNT",
"unit": "count",
"type": "gauge"
},
{
"name": "hanadb_table_cs_top_mem_disk_size",
"description": "Top 10 tables consuming more memory. The total disk size of all of the table parts",
"labels": ["HOST", "PORT", "SCHEMA_NAME", "TABLE_NAME"],
"value": "DISK_SIZE_MB",
"unit": "mb",
"type": "gauge"
}
]
},
"SELECT host, LPAD(port, 5) port, site_name, secondary_site_name, secondary_host, LPAD(secondary_port, 5) secondary_port, replication_mode, MAP(secondary_active_status, 'YES', 1,0) secondary_active_status, MAP(UPPER(replication_status),'ACTIVE',0,'ERROR', 4, 'SYNCING',2, 'INITIALIZING',1,'UNKNOWN', 3, 99) replication_status, TO_DECIMAL(SECONDS_BETWEEN(SHIPPED_LOG_POSITION_TIME, LAST_LOG_POSITION_TIME), 10, 2) ship_delay_s, TO_DECIMAL((LAST_LOG_POSITION - SHIPPED_LOG_POSITION) * 64 / 1024 / 1024, 10, 2) async_buff_used_mb, secondary_reconnect_count, secondary_failover_count FROM sys.m_service_replication;":
{
"enabled": true,
"metrics": [
{
"name": "hanadb_sr_ship_delay",
"description": "System Replication log shipping delay in seconds",
"labels": ["HOST", "PORT", "SITE_NAME", "SECONDARY_SITE_NAME", "SECONDARY_HOST", "SECONDARY_PORT", "REPLICATION_MODE"],
"value": "SHIP_DELAY_S",
"unit": "seconds",
"type": "gauge"
},
{
"name": "hanadb_sr_async_used_shipping_buffer",
"description": "System Replication current filling level of asynchronous log shipping buffer (MB)",
"labels": ["HOST", "PORT", "SITE_NAME", "SECONDARY_SITE_NAME", "SECONDARY_HOST", "SECONDARY_PORT", "REPLICATION_MODE"],
"value": "ASYNC_BUFF_USED_MB",
"unit": "mb",
"type": "gauge"
},
{
"name": "hanadb_sr_secondary_active",
"description": "System Replication - Specifies the secondary active status. Values: 0 - INACTIVE and 1 - ACTIVE",
"labels": ["HOST", "PORT", "SITE_NAME", "SECONDARY_SITE_NAME", "SECONDARY_HOST", "SECONDARY_PORT", "REPLICATION_MODE"],
"value": "SECONDARY_ACTIVE_STATUS",
"unit": "status",
"type": "gauge"
},
{
"name": "hanadb_sr_replication",
"description": "System Replication status. Values: 0-ACTIVE, 1-INITIALIZING, 2-SYNCING, 3-UNKNOWN, 4-ERROR, 99-UNMAPPED ",
"labels": ["HOST", "PORT", "SITE_NAME", "SECONDARY_SITE_NAME", "SECONDARY_HOST", "SECONDARY_PORT", "REPLICATION_MODE"],
"value": "REPLICATION_STATUS",
"unit": "status",
"type": "gauge"
},
{
"name": "hanadb_sr_secondary_reconnect",
"description": "System Replication secondary reconnect count",
"labels": ["HOST", "PORT", "SITE_NAME", "SECONDARY_SITE_NAME", "SECONDARY_HOST", "SECONDARY_PORT", "REPLICATION_MODE"],
"value": "SECONDARY_RECONNECT_COUNT",
"unit": "count",
"type": "gauge"
},
{
"name": "hanadb_sr_secondary_failover",
"description": "System Replication secondary failover count",
"labels": ["HOST", "PORT", "SITE_NAME", "SECONDARY_SITE_NAME", "SECONDARY_HOST", "SECONDARY_PORT", "REPLICATION_MODE"],
"value": "SECONDARY_FAILOVER_COUNT",
"unit": "count",
"type": "gauge"
}
]
},
"SELECT TOP 10 TO_VARCHAR(RT.TAKEOVER_START_TIME) START_TIME, MAP(RT.TAKEOVER_END_TIME, NULL, 'N/A', TO_VARCHAR(RT.TAKEOVER_END_TIME)) END_TIME, MAP(SECONDS_BETWEEN(RT.TAKEOVER_START_TIME, RT.TAKEOVER_END_TIME),NULL, -1,SECONDS_BETWEEN(RT.TAKEOVER_START_TIME, RT.TAKEOVER_END_TIME)) DURATION_S, RT.SOURCE_SITE_NAME SRC_SITE_NAME, RT.SOURCE_MASTER_NAMESERVER_HOST SRC_HOST, RT.SITE_NAME TGT_SITE_NAME, RT.MASTER_NAMESERVER_HOST TGT_HOST, RT.TAKEOVER_TYPE TYPE, RT.OPERATION_MODE, MAP(RT.REPLICATION_STATUS,'ACTIVE',0,'ERROR', 4, 'SYNCING',2, 'INITIALIZING',1,'UNKNOWN', 3, 99) REPLICATION_STATUS, TO_VARCHAR(RT.LOG_POSITION_TIME) LOG_POS_TIME, TO_VARCHAR(RT.SHIPPED_LOG_POSITION_TIME) SHIPPED_LOG_POS_TIME, RT.LOG_POSITION, RT.SHIPPED_LOG_POSITION FROM M_SYSTEM_REPLICATION_TAKEOVER_HISTORY RT;":
{
"enabled": true,
"metrics": [
{
"name": "hanadb_sr_takeover_replication",
"description": "System Replication status at takeover time. Values: 0-ACTIVE, 1-INITIALIZING, 2-SYNCING, 3-UNKNOWN, 4-ERROR, 99-UNMAPPED",
"labels": ["START_TIME", "END_TIME", "SRC_SITE_NAME", "SRC_HOST", "TGT_SITE_NAME", "TGT_HOST", "OPERATION_MODE", "LOG_POS_TIME", "SHIPPED_LOG_POS_TIME"],
"value": "REPLICATION_STATUS",
"unit": "status",
"type": "gauge"
},
{
"name": "hanadb_sr_takeover_duration_time",
"description": "System Replication takeover duration time. Returns -1 if cannot be calculated, together with END_TIME=N/A. It is a workaround to when HANA cannot collect this value",
"labels": ["START_TIME", "END_TIME", "SRC_SITE_NAME", "SRC_HOST", "TGT_SITE_NAME", "TGT_HOST", "OPERATION_MODE", "LOG_POS_TIME", "SHIPPED_LOG_POS_TIME"],
"value": "DURATION_S",
"unit": "seconds",
"type": "gauge"
},
{
"name": "hanadb_sr_takeover_log_position",
"description": "Specifies the master log position, that has been reached by takeover",
"labels": ["START_TIME", "END_TIME", "SRC_SITE_NAME", "SRC_HOST", "TGT_SITE_NAME", "TGT_HOST", "OPERATION_MODE", "LOG_POS_TIME", "SHIPPED_LOG_POS_TIME"],
"value": "LOG_POSITION",
"unit": "bigint",
"type": "gauge"
},
{
"name": "hanadb_sr_takeover_shipped_log_position",
"description": "Specifies the highest master log position that has been shipped before executing takeover",
"labels": ["START_TIME", "END_TIME", "SRC_SITE_NAME", "SRC_HOST", "TGT_SITE_NAME", "TGT_HOST", "OPERATION_MODE", "LOG_POS_TIME", "SHIPPED_LOG_POS_TIME"],
"value": "SHIPPED_LOG_POSITION",
"unit": "bigint",
"type": "gauge"
}
]
},
"SELECT alert_host host, LPAD(alert_port,5) port, alert_details, alert_useraction,to_varchar(alert_timestamp) alert_timestamp, to_varchar(alert_rating) alert_rating FROM _SYS_STATISTICS.STATISTICS_CURRENT_ALERTS;":
{
"enabled": true,
"metrics": [
{
"name": "hanadb_alerts_current",
"description": "HANA Database current alerts rating",
"labels": ["HOST", "PORT", "ALERT_DETAILS", "ALERT_USERACTION", "ALERT_TIMESTAMP"],
"value": "ALERT_RATING",
"unit": "rating",
"type": "gauge"
}
]
}
}