-
Notifications
You must be signed in to change notification settings - Fork 237
/
custom-metrics.yaml
82 lines (73 loc) · 3.66 KB
/
custom-metrics.yaml
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
metrics:
- context: "slow_queries"
metricsdesc:
p95_time_usecs: "Gauge metric with percentile 95 of elapsed time."
p99_time_usecs: "Gauge metric with percentile 99 of elapsed time."
request: "select percentile_disc(0.95) within group (order by elapsed_time) as p95_time_usecs,
percentile_disc(0.99) within group (order by elapsed_time) as p99_time_usecs
from v$sql where last_active_time >= sysdate - 5/(24*60)"
- context: "big_queries"
metricsdesc:
p95_rows: "Gauge metric with percentile 95 of returned rows."
p99_rows: "Gauge metric with percentile 99 of returned rows."
request: "select percentile_disc(0.95) within group (order by rownum) as p95_rows,
percentile_disc(0.99) within group (order by rownum) as p99_rows
from v$sql where last_active_time >= sysdate - 5/(24*60)"
- context: "size_user_segments_top100"
metricsdesc:
table_bytes: "Gauge metric with the size of the tables in user segments."
labels: [segment_name]
request: "select * from (select segment_name,sum(bytes) as table_bytes
from user_segments where segment_type='TABLE' group by segment_name)
order by table_bytes DESC FETCH NEXT 100 ROWS ONLY"
- context: "size_user_segments_top100"
metricsdesc:
table_partition_bytes: "Gauge metric with the size of the table partition in user segments."
labels: [segment_name]
request: "select * from (select segment_name,sum(bytes) as table_partition_bytes
from user_segments where segment_type='TABLE PARTITION' group by segment_name)
order by table_partition_bytes DESC FETCH NEXT 100 ROWS ONLY"
- context: "size_user_segments_top100"
metricsdesc:
cluster_bytes: "Gauge metric with the size of the cluster in user segments."
labels: [segment_name]
request: "select * from (select segment_name,sum(bytes) as cluster_bytes
from user_segments where segment_type='CLUSTER' group by segment_name)
order by cluster_bytes DESC FETCH NEXT 100 ROWS ONLY"
- context: "size_dba_segments_top100"
metricsdesc:
table_bytes: "Gauge metric with the size of the tables in user segments."
labels: [segment_name]
request: "select * from (select segment_name,sum(bytes) as table_bytes
from dba_segments where segment_type='TABLE' group by segment_name)
order by table_bytes DESC FETCH NEXT 100 ROWS ONLY"
- context: "size_dba_segments_top100"
metricsdesc:
table_partition_bytes: "Gauge metric with the size of the table partition in user segments."
labels: [segment_name]
request: "select * from (select segment_name,sum(bytes) as table_partition_bytes
from dba_segments where segment_type='TABLE PARTITION' group by segment_name)
order by table_partition_bytes DESC FETCH NEXT 100 ROWS ONLY"
- context: "size_dba_segments_top100"
metricsdesc:
cluster_bytes: "Gauge metric with the size of the cluster in user segments."
labels: [segment_name]
request: "select * from (select segment_name,sum(bytes) as cluster_bytes
from dba_segments where segment_type='CLUSTER' group by segment_name)
order by cluster_bytes DESC FETCH NEXT 100 ROWS ONLY"
- context: "cache_hit_ratio"
metricsdesc:
percentage: "Gauge metric with the cache hit ratio."
request: "select
Round((
(Sum(Decode(a.name, 'consistent gets', a.value, 0))
+ Sum(Decode(a.name, 'db block gets', a.value, 0))
- Sum(Decode(a.name, 'physical reads', a.value, 0))
)/
(Sum(Decode(a.name, 'consistent gets', a.value, 0))
+ Sum(Decode(a.name, 'db block gets', a.value, 0)))) *100,2) as percentage
FROM v$sysstat a"
- context: "startup"
metricsdesc:
time_seconds: "Database startup time in seconds."
request: "SELECT (SYSDATE - STARTUP_TIME) * 24 * 60 * 60 AS time_seconds FROM V$INSTANCE"