You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: collector/default_metrics.toml
+45-17Lines changed: 45 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -2,35 +2,48 @@
2
2
context = "sessions"
3
3
labels = [ "status", "type" ]
4
4
metricsdesc = { value= "Gauge metric with count of sessions by status and type." }
5
-
request = "SELECT status, type, COUNT(*) as value FROM v$session GROUP BY status, type"
5
+
request = '''
6
+
select status, type, count(*) as value
7
+
from gv$session
8
+
group by status, type
9
+
'''
6
10
7
11
[[metric]]
8
12
context = "resource"
9
13
labels = [ "resource_name" ]
10
-
metricsdesc = { current_utilization= "Generic counter metric from v$resource_limit view in Oracle (current value).", limit_value="Generic counter metric from v$resource_limit view in Oracle (UNLIMITED: -1)." }
14
+
metricsdesc = { current_utilization= "Generic counter metric from gv$resource_limit view in Oracle (current value).", limit_value="Generic counter metric from v$resource_limit view in Oracle (UNLIMITED: -1)." }
11
15
request = '''
12
-
SELECT resource_name, current_utilization, CASE WHEN TRIM(limit_value) LIKE 'UNLIMITED' THEN '-1' ELSE TRIM(limit_value) END as limit_value
13
-
FROM v$resource_limit
16
+
select resource_name, current_utilization, case when trim(limit_value) like 'unlimited' then '-1' else trim(limit_value) end as limit_value
17
+
from gv$resource_limit
14
18
'''
15
19
ignorezeroresult = true
16
20
17
21
[[metric]]
18
22
context = "asm_diskgroup"
19
23
labels = [ "name" ]
20
24
metricsdesc = { total = "Total size of ASM disk group.", free = "Free space available on ASM disk group." }
21
-
request = "SELECT name,total_mb*1024*1024 as total,free_mb*1024*1024 as free FROM v$asm_diskgroup_stat where exists (select 1 from v$datafile where name like '+%')"
25
+
request = '''
26
+
select name, total_mb*1024*1024 as total, free_mb*1024*1024 as free
27
+
from gv$asm_diskgroup_stat
28
+
where exists (select 1 from gv$datafile where name like '+%')
29
+
and inst_id = (select max(inst_id) from gv$instance)
30
+
group by name, total_mb, free_mb
31
+
'''
22
32
ignorezeroresult = true
23
33
24
34
[[metric]]
25
35
context = "activity"
26
-
metricsdesc = { value="Generic counter metric from v$sysstat view in Oracle." }
36
+
metricsdesc = { value="Generic counter metric from gv$sysstat view in Oracle." }
27
37
fieldtoappend = "name"
28
-
request = "SELECT name, value FROM v$sysstat WHERE name IN ('parse count (total)', 'execute count', 'user commits', 'user rollbacks')"
38
+
request = '''
39
+
select name, value from gv$sysstat
40
+
where name in ('parse count (total)', 'execute count', 'user commits', 'user rollbacks')
41
+
'''
29
42
30
43
[[metric]]
31
44
context = "process"
32
45
metricsdesc = { count="Gauge metric with count of processes." }
33
-
request = "SELECT COUNT(*) as count FROM v$process"
46
+
request = "select count(*) as count from gv$process"
34
47
35
48
[[metric]]
36
49
context = "wait_time"
@@ -43,7 +56,7 @@ select
43
56
wait_class,
44
57
round(time_waited/100,3) time_waited_sec_total,
45
58
con_id
46
-
from v$system_wait_class
59
+
from gv$system_wait_class
47
60
where wait_class <> 'Idle'
48
61
'''
49
62
ignorezeroresult = true
@@ -62,7 +75,17 @@ SELECT
62
75
dtum.used_percent
63
76
FROM dba_tablespace_usage_metrics dtum, dba_tablespaces dt
Copy file name to clipboardExpand all lines: custom-metrics-example/custom-metrics.toml
+10-2Lines changed: 10 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,20 @@
1
1
[[metric]]
2
2
context = "slow_queries"
3
3
metricsdesc = { p95_time_usecs= "Gauge metric with percentile 95 of elapsed time.", p99_time_usecs= "Gauge metric with percentile 99 of elapsed time." }
4
-
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)"
4
+
request = '''
5
+
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
6
+
from gv$sql
7
+
where last_active_time >= sysdate - 5/(24*60)
8
+
'''
5
9
6
10
[[metric]]
7
11
context = "big_queries"
8
12
metricsdesc = { p95_rows= "Gauge metric with percentile 95 of returned rows.", p99_rows= "Gauge metric with percentile 99 of returned rows." }
9
-
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)"
13
+
request = '''
14
+
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
Copy file name to clipboardExpand all lines: default-metrics.toml
+29-16Lines changed: 29 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -2,35 +2,48 @@
2
2
context = "sessions"
3
3
labels = [ "status", "type" ]
4
4
metricsdesc = { value= "Gauge metric with count of sessions by status and type." }
5
-
request = "SELECT status, type, COUNT(*) as value FROM v$session GROUP BY status, type"
5
+
request = '''
6
+
select status, type, count(*) as value
7
+
from gv$session
8
+
group by status, type
9
+
'''
6
10
7
11
[[metric]]
8
12
context = "resource"
9
13
labels = [ "resource_name" ]
10
14
metricsdesc = { current_utilization= "Generic counter metric from v$resource_limit view in Oracle (current value).", limit_value="Generic counter metric from v$resource_limit view in Oracle (UNLIMITED: -1)." }
11
15
request = '''
12
-
SELECT resource_name, current_utilization, CASE WHEN TRIM(limit_value) LIKE 'UNLIMITED' THEN '-1' ELSE TRIM(limit_value) END as limit_value
13
-
FROM v$resource_limit
16
+
select resource_name, current_utilization, case when trim(limit_value) like 'unlimited' then '-1' else trim(limit_value) end as limit_value
17
+
from gv$resource_limit
14
18
'''
15
19
ignorezeroresult = true
16
20
17
21
[[metric]]
18
22
context = "asm_diskgroup"
19
23
labels = [ "name" ]
20
24
metricsdesc = { total = "Total size of ASM disk group.", free = "Free space available on ASM disk group." }
21
-
request = "SELECT name,total_mb*1024*1024 as total,free_mb*1024*1024 as free FROM v$asm_diskgroup_stat where exists (select 1 from v$datafile where name like '+%')"
25
+
request = '''
26
+
select name, total_mb*1024*1024 as total, free_mb*1024*1024 as free
27
+
from gv$asm_diskgroup_stat
28
+
where exists (select 1 from gv$datafile where name like '+%')
29
+
and inst_id = (select max(inst_id) from gv$instance)
30
+
group by name, total_mb, free_mb
31
+
'''
22
32
ignorezeroresult = true
23
33
24
34
[[metric]]
25
35
context = "activity"
26
-
metricsdesc = { value="Generic counter metric from v$sysstat view in Oracle." }
36
+
metricsdesc = { value="Generic counter metric from gv$sysstat view in Oracle." }
27
37
fieldtoappend = "name"
28
-
request = "SELECT name, value FROM v$sysstat WHERE name IN ('parse count (total)', 'execute count', 'user commits', 'user rollbacks')"
38
+
request = '''
39
+
select name, value from gv$sysstat
40
+
where name in ('parse count (total)', 'execute count', 'user commits', 'user rollbacks')
41
+
'''
29
42
30
43
[[metric]]
31
44
context = "process"
32
45
metricsdesc = { count="Gauge metric with count of processes." }
33
-
request = "SELECT COUNT(*) as count FROM v$process"
46
+
request = "select count(*) as count from gv$process"
34
47
35
48
[[metric]]
36
49
context = "wait_time"
@@ -43,7 +56,7 @@ select
43
56
wait_class,
44
57
round(time_waited/100,3) time_waited_sec_total,
45
58
con_id
46
-
from v$system_wait_class
59
+
from gv$system_wait_class
47
60
where wait_class <> 'Idle'
48
61
'''
49
62
ignorezeroresult = true
@@ -80,8 +93,8 @@ context = "db_system"
80
93
labels = [ "name" ]
81
94
metricsdesc = { value = "Database system resources metric" }
82
95
request = '''
83
-
select name, value
84
-
from v$parameter
96
+
select name, value
97
+
from gv$parameter
85
98
where name in ('cpu_count', 'sga_max_size', 'pga_aggregate_limit')
0 commit comments