Skip to content

Commit 4329431

Browse files
Document YAML metrics format (#365)
* Document YAML metrics format Signed-off-by: Anders Swanson <[email protected]>
1 parent 82f2ae0 commit 4329431

File tree

80 files changed

+333
-68
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+333
-68
lines changed

default-metrics.yaml

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
metrics:
2+
- context: "sessions"
3+
labels: [ "inst_id", "status", "type" ]
4+
metricsdesc:
5+
value: "Gauge metric with count of sessions by inst_id, status and type."
6+
request: |
7+
select inst_id, status, type, count(*) as value
8+
from gv$session
9+
group by inst_id, status, type
10+
11+
- context: "resource"
12+
labels: [ "inst_id", "resource_name" ]
13+
metricsdesc:
14+
current_utilization: "Generic counter metric from gv$resource_limit view in Oracle (current value)."
15+
limit_value: "Generic counter metric from v$resource_limit view in Oracle (UNLIMITED: -1)."
16+
request: |
17+
select inst_id, resource_name, current_utilization,
18+
case when trim(limit_value) like 'UNLIMITED' then '-1' else trim(limit_value) end as limit_value
19+
from gv$resource_limit
20+
group by inst_id, resource_name, current_utilization, limit_value
21+
ignorezeroresult: true
22+
23+
- context: "asm_diskgroup"
24+
labels: [ "inst_id", "name" ]
25+
metricsdesc:
26+
total: "Total size of ASM disk group."
27+
free: "Free space available on ASM disk group."
28+
request: |
29+
select inst_id, name, total_mb*1024*1024 as total, free_mb*1024*1024 as free
30+
from gv$asm_diskgroup_stat
31+
where exists (select 1 from gv$datafile where name like '+%')
32+
and inst_id = (select max(inst_id) from gv$instance)
33+
group by inst_id, name, total_mb, free_mb
34+
ignorezeroresult: true
35+
36+
- context: "activity"
37+
labels: [ "inst_id" ]
38+
metricsdesc:
39+
value: "Generic counter metric from gv$sysstat view in Oracle."
40+
fieldtoappend: "name"
41+
request: |
42+
select inst_id, name, value from gv$sysstat
43+
where name in ('parse count (total)', 'execute count', 'user commits', 'user rollbacks')
44+
group by inst_id, name, value
45+
46+
- context: "process"
47+
labels: [ "inst_id" ]
48+
metricsdesc:
49+
count: "Gauge metric with count of processes."
50+
request: |
51+
select inst_id, count(*) as count
52+
from gv$process
53+
group by inst_id
54+
55+
- context: "wait_time"
56+
labels: [ "inst_id", "wait_class", "con_id" ]
57+
metricsdesc:
58+
time_waited_sec_total: "counter metric from system_wait_class view in Oracle."
59+
metricstype:
60+
time_waited_sec_total: "counter"
61+
fieldtoappend: "wait_class"
62+
request: |
63+
select
64+
inst_id,
65+
wait_class,
66+
round(time_waited/100,3) time_waited_sec_total,
67+
con_id
68+
from gv$system_wait_class
69+
where wait_class <> 'Idle'
70+
group by inst_id, wait_class, con_id, round(time_waited/100,3)
71+
ignorezeroresult: true
72+
73+
- context: "tablespace"
74+
labels: [ "tablespace", "type" ]
75+
metricsdesc:
76+
bytes: "Generic counter metric of tablespaces bytes in Oracle."
77+
max_bytes: "Generic counter metric of tablespaces max bytes in Oracle."
78+
free: "Generic counter metric of tablespaces free bytes in Oracle."
79+
used_percent: "Gauge metric showing as a percentage of how much of the tablespace has been used."
80+
request: |
81+
SELECT
82+
dt.tablespace_name as tablespace,
83+
dt.contents as type,
84+
dt.block_size * dtum.used_space as bytes,
85+
dt.block_size * dtum.tablespace_size as max_bytes,
86+
dt.block_size * (dtum.tablespace_size - dtum.used_space) as free,
87+
dtum.used_percent
88+
FROM dba_tablespace_usage_metrics dtum, dba_tablespaces dt
89+
WHERE dtum.tablespace_name = dt.tablespace_name
90+
and dt.contents != 'TEMPORARY'
91+
union
92+
SELECT
93+
dt.tablespace_name as tablespace,
94+
'TEMPORARY' as type,
95+
dt.tablespace_size - dt.free_space as bytes,
96+
dt.tablespace_size as max_bytes,
97+
dt.free_space as free,
98+
((dt.tablespace_size - dt.free_space) / dt.tablespace_size)
99+
FROM dba_temp_free_space dt
100+
order by tablespace
101+
102+
- context: "db_system"
103+
labels: [ "inst_id", "name" ]
104+
metricsdesc:
105+
value: "Database system resources metric"
106+
request: |
107+
select inst_id, name, value
108+
from gv$parameter
109+
where name in ('cpu_count', 'sga_max_size', 'pga_aggregate_limit')
110+
group by inst_id, name, value
111+
112+
- context: "db_platform"
113+
labels: [ "inst_id", "platform_name" ]
114+
metricsdesc:
115+
value: "Database platform"
116+
request: |
117+
SELECT inst_id, platform_name, 1 as value
118+
FROM gv$database
119+
GROUP BY inst_id, platform_name
120+
121+
- context: "top_sql"
122+
labels: [ "inst_id", "sql_id", "sql_text" ]
123+
metricsdesc:
124+
elapsed: "SQL statement elapsed time running"
125+
request: |
126+
select * from (
127+
select inst_id, sql_id, elapsed_time / 1000000 as elapsed, substrb(replace(sql_text,'',' '),1,55) as sql_text
128+
from gv$sqlstats
129+
order by elapsed_time desc
130+
) where rownum <= 15
131+
ignorezeroresult: true
132+
# scrapeinterval: "5m"
133+
134+
- context: "cache_hit_ratio"
135+
labels: [ "inst_id", "cache_hit_type" ]
136+
metricsdesc:
137+
value: "Cache Hit Ratio"
138+
request: |
139+
select metric_name cache_hit_type, value
140+
from gv$sysmetric
141+
where group_id=2 and metric_id in (2000,2050,2112,2110)
142+
ignorezeroresult: true

docs/404.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<meta charset="UTF-8">
55
<meta name="generator" content="Docusaurus v3.8.1">
66
<title data-rh="true">Page Not Found | Oracle Database Metrics Exporter</title><meta data-rh="true" name="viewport" content="width=device-width,initial-scale=1"><meta data-rh="true" name="twitter:card" content="summary_large_image"><meta data-rh="true" property="og:image" content="https://oracle.github.io/oracle-db-appdev-monitoring/img/logo.png"><meta data-rh="true" name="twitter:image" content="https://oracle.github.io/oracle-db-appdev-monitoring/img/logo.png"><meta data-rh="true" property="og:url" content="https://oracle.github.io/oracle-db-appdev-monitoring/404.html"><meta data-rh="true" property="og:locale" content="en"><meta data-rh="true" name="docusaurus_locale" content="en"><meta data-rh="true" name="docusaurus_tag" content="default"><meta data-rh="true" name="docsearch:language" content="en"><meta data-rh="true" name="docsearch:docusaurus_tag" content="default"><meta data-rh="true" property="og:title" content="Page Not Found | Oracle Database Metrics Exporter"><link data-rh="true" rel="icon" href="/oracle-db-appdev-monitoring/img/favicon-32x32.png"><link data-rh="true" rel="canonical" href="https://oracle.github.io/oracle-db-appdev-monitoring/404.html"><link data-rh="true" rel="alternate" href="https://oracle.github.io/oracle-db-appdev-monitoring/404.html" hreflang="en"><link data-rh="true" rel="alternate" href="https://oracle.github.io/oracle-db-appdev-monitoring/404.html" hreflang="x-default"><link rel="stylesheet" href="/oracle-db-appdev-monitoring/assets/css/styles.d329a656.css">
7-
<script src="/oracle-db-appdev-monitoring/assets/js/runtime~main.22554033.js" defer="defer"></script>
7+
<script src="/oracle-db-appdev-monitoring/assets/js/runtime~main.a3a99869.js" defer="defer"></script>
88
<script src="/oracle-db-appdev-monitoring/assets/js/main.f84efef5.js" defer="defer"></script>
99
</head>
1010
<body class="navigation-with-keyboard">

docs/assets/js/0e384e19.3cab749d.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)