Skip to content
This repository was archived by the owner on Feb 13, 2025. It is now read-only.

Commit 5fc3b51

Browse files
kirkchChris Kirk
andauthored
#219 add oracledb_tablespace_used_percent metric (#221)
Co-authored-by: Chris Kirk <[email protected]>
1 parent 6c979a3 commit 5fc3b51

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ The following metrics are exposed currently.
4040
- oracledb_tablespace_bytes
4141
- oracledb_tablespace_max_bytes
4242
- oracledb_tablespace_free
43+
- oracledb_tablespace_used_percent
4344
- oracledb_process_count
4445
- oracledb_resource_current_utilization
4546
- oracledb_resource_limit_value

default-metrics.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,15 @@ WHERE
4545
[[metric]]
4646
context = "tablespace"
4747
labels = [ "tablespace", "type" ]
48-
metricsdesc = { bytes = "Generic counter metric of tablespaces bytes in Oracle.", max_bytes = "Generic counter metric of tablespaces max bytes in Oracle.", free = "Generic counter metric of tablespaces free bytes in Oracle." }
48+
metricsdesc = { bytes = "Generic counter metric of tablespaces bytes in Oracle.", max_bytes = "Generic counter metric of tablespaces max bytes in Oracle.", free = "Generic counter metric of tablespaces free bytes in Oracle.", used_percent = "Gauge metric showing as a percentage of how much of the tablespace has been used." }
4949
request = '''
5050
SELECT
5151
dt.tablespace_name as tablespace,
5252
dt.contents as type,
5353
dt.block_size * dtum.used_space as bytes,
5454
dt.block_size * dtum.tablespace_size as max_bytes,
55-
dt.block_size * (dtum.tablespace_size - dtum.used_space) as free
55+
dt.block_size * (dtum.tablespace_size - dtum.used_space) as free,
56+
dtum.used_percent
5657
FROM dba_tablespace_usage_metrics dtum, dba_tablespaces dt
5758
WHERE dtum.tablespace_name = dt.tablespace_name
5859
ORDER by tablespace

0 commit comments

Comments
 (0)