Skip to content

Commit 275a237

Browse files
committed
[receiver/oracledb] Add transaction, lock, and recovery metrics
Surfaces transaction-rollback, lock-timing, recovery, SMON, and RAC cache-fusion statistics already returned by the existing system-statistics query as seven opt-in metrics. No new SQL queries are introduced.
1 parent d119753 commit 275a237

11 files changed

Lines changed: 1346 additions & 2 deletions
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Use this changelog template to create an entry for release notes.
2+
3+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
4+
change_type: enhancement
5+
6+
# The name of the component, or a single word describing the area of concern, (e.g. receiver/filelog)
7+
component: receiver/oracledb
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: Add transaction, lock, and recovery metrics sourced from the existing v$sysstat query.
11+
12+
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
13+
issues: [49064]
14+
15+
# (Optional) One or more lines of additional information to render under the primary note.
16+
# These lines will be padded with 2 spaces and then inserted directly into the document.
17+
# Use pipe (|) for multiline entries.
18+
subtext: |
19+
Adds oracledb.transaction.rollbacks, oracledb.lock.time (attribute oracledb.lock.kind),
20+
oracledb.lock.wait.time, oracledb.recovery.blocks_read, oracledb.smon.instance_recovery.posts,
21+
oracledb.smon.txn_recovery.posts, and oracledb.gc.current_block.receive.time. All are disabled
22+
by default and add no new database queries.
23+
24+
# If your change doesn't affect end users or the exported elements of any package,
25+
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
26+
# Optional: The change log or logs in which this entry should be included.
27+
# e.g. '[user]' or '[user, api]'
28+
# Include 'user' if the change is relevant to end users.
29+
# Include 'api' if there is a change to a library API.
30+
# Default: '[user]'
31+
change_logs: [user]

receiver/oracledbreceiver/documentation.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,14 @@ Fraction of executions that did not require a parse, as computed by Oracle V$SYS
319319
| ---- | ----------- | ------ | ----------------- | ------------------- |
320320
| oracledb.parse.type | Type of parse operation (e.g., soft). | Str: ``soft`` | Recommended | - |
321321
322+
### oracledb.gc.current_block.receive.time
323+
324+
Cumulative time spent receiving current blocks from other instances over RAC cache fusion, in seconds (converted from centiseconds). Sourced from v$sysstat name gc current block receive time.
325+
326+
| Unit | Metric Type | Value Type | Aggregation Temporality | Monotonic | Stability |
327+
| ---- | ----------- | ---------- | ----------------------- | --------- | --------- |
328+
| s | Sum | Double | Cumulative | true | Development |
329+
322330
### oracledb.host.cpu.utilization
323331
324332
Fraction of host CPU time in use, as computed by Oracle V$SYSMETRIC (% Busy/(Idle+Busy)).
@@ -335,6 +343,28 @@ Fraction of library cache pin requests that found the object already cached, as
335343
| ---- | ----------- | ---------- | --------- |
336344
| % | Gauge | Double | Development |
337345
346+
### oracledb.lock.time
347+
348+
Cumulative time spent on transaction lock activity, in seconds (converted from centiseconds). Sourced from v$sysstat names transaction lock background get time (oracledb.lock.kind=background) and transaction lock foreground wait time (oracledb.lock.kind=foreground).
349+
350+
| Unit | Metric Type | Value Type | Aggregation Temporality | Monotonic | Stability |
351+
| ---- | ----------- | ---------- | ----------------------- | --------- | --------- |
352+
| s | Sum | Double | Cumulative | true | Development |
353+
354+
#### Attributes
355+
356+
| Name | Description | Values | Requirement Level | Semantic Convention |
357+
| ---- | ----------- | ------ | ----------------- | ------------------- |
358+
| oracledb.lock.kind | Whether the lock timing is accumulated by background (get) or foreground (wait) sessions. | Str: ``background``, ``foreground`` | Recommended | - |
359+
360+
### oracledb.lock.wait.time
361+
362+
Cumulative total time sessions spent waiting on locks, in seconds (converted from centiseconds). Sourced from v$sysstat name Total Lock Time.
363+
364+
| Unit | Metric Type | Value Type | Aggregation Temporality | Monotonic | Stability |
365+
| ---- | ----------- | ---------- | ----------------------- | --------- | --------- |
366+
| s | Sum | Double | Cumulative | true | Development |
367+
338368
### oracledb.logons
339369
340370
Number of logon operations
@@ -499,6 +529,14 @@ Number of SELECT statements executed in parallel
499529
| ---- | ----------- | ---------- | ----------------------- | --------- | --------- |
500530
| {queries} | Sum | Int | Cumulative | true | Development |
501531
532+
### oracledb.recovery.blocks_read
533+
534+
Number of blocks read during instance or media recovery. Sourced from v$sysstat name recovery blocks read.
535+
536+
| Unit | Metric Type | Value Type | Aggregation Temporality | Monotonic | Stability |
537+
| ---- | ----------- | ---------- | ----------------------- | --------- | --------- |
538+
| {blocks} | Sum | Int | Cumulative | true | Development |
539+
502540
### oracledb.recycle_bin.limit
503541
504542
Total size of the recycle bin.
@@ -523,6 +561,22 @@ Fraction of the shared pool that is currently free, as computed by Oracle V$SYSM
523561
| ---- | ----------- | ---------- | --------- |
524562
| % | Gauge | Double | Development |
525563
564+
### oracledb.smon.instance_recovery.posts
565+
566+
Number of times SMON was posted to perform instance recovery. Sourced from v$sysstat name SMON posted for instance recovery.
567+
568+
| Unit | Metric Type | Value Type | Aggregation Temporality | Monotonic | Stability |
569+
| ---- | ----------- | ---------- | ----------------------- | --------- | --------- |
570+
| {posts} | Sum | Int | Cumulative | true | Development |
571+
572+
### oracledb.smon.txn_recovery.posts
573+
574+
Number of times SMON was posted to perform transaction recovery for other instances. Sourced from v$sysstat name SMON posted for txn recovery for other instances.
575+
576+
| Unit | Metric Type | Value Type | Aggregation Temporality | Monotonic | Stability |
577+
| ---- | ----------- | ---------- | ----------------------- | --------- | --------- |
578+
| {posts} | Sum | Int | Cumulative | true | Development |
579+
526580
### oracledb.sort.ratio
527581
528582
Fraction of sorts performed in memory vs disk, as computed by Oracle V$SYSMETRIC (% MemSort/(MemSort + DiskSort)). Low values indicate PGA memory pressure.
@@ -576,6 +630,14 @@ Fraction of allocated database storage that is used.
576630
| ---- | ----------- | ---------- | --------- |
577631
| 1 | Gauge | Double | Development |
578632
633+
### oracledb.transaction.rollbacks
634+
635+
Number of transactions rolled back. Sourced from v$sysstat name transaction rollbacks.
636+
637+
| Unit | Metric Type | Value Type | Aggregation Temporality | Monotonic | Stability |
638+
| ---- | ----------- | ---------- | ----------------------- | --------- | --------- |
639+
| {rollbacks} | Sum | Int | Cumulative | true | Development |
640+
579641
## Default Events
580642
581643
The following events are emitted by default. Each of them can be disabled by applying the following configuration:

receiver/oracledbreceiver/internal/metadata/config.schema.yaml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,13 +109,34 @@ $defs:
109109
enabled:
110110
type: boolean
111111
default: true
112+
oracledb.gc.current_block.receive.time:
113+
description: "OracledbGcCurrentBlockReceiveTimeMetricConfig provides config for the oracledb.gc.current_block.receive.time metric."
114+
type: object
115+
properties:
116+
enabled:
117+
type: boolean
118+
default: false
112119
oracledb.hard_parses:
113120
description: "OracledbHardParsesMetricConfig provides config for the oracledb.hard_parses metric."
114121
type: object
115122
properties:
116123
enabled:
117124
type: boolean
118125
default: true
126+
oracledb.lock.time:
127+
description: "OracledbLockTimeMetricConfig provides config for the oracledb.lock.time metric."
128+
type: object
129+
properties:
130+
enabled:
131+
type: boolean
132+
default: false
133+
oracledb.lock.wait.time:
134+
description: "OracledbLockWaitTimeMetricConfig provides config for the oracledb.lock.wait.time metric."
135+
type: object
136+
properties:
137+
enabled:
138+
type: boolean
139+
default: false
119140
oracledb.logical_reads:
120141
description: "OracledbLogicalReadsMetricConfig provides config for the oracledb.logical_reads metric."
121142
type: object
@@ -306,6 +327,13 @@ $defs:
306327
enabled:
307328
type: boolean
308329
default: false
330+
oracledb.recovery.blocks_read:
331+
description: "OracledbRecoveryBlocksReadMetricConfig provides config for the oracledb.recovery.blocks_read metric."
332+
type: object
333+
properties:
334+
enabled:
335+
type: boolean
336+
default: false
309337
oracledb.recycle_bin.limit:
310338
description: "OracledbRecycleBinLimitMetricConfig provides config for the oracledb.recycle_bin.limit metric."
311339
type: object
@@ -345,6 +373,20 @@ $defs:
345373
default:
346374
- "session_type"
347375
- "session_status"
376+
oracledb.smon.instance_recovery.posts:
377+
description: "OracledbSmonInstanceRecoveryPostsMetricConfig provides config for the oracledb.smon.instance_recovery.posts metric."
378+
type: object
379+
properties:
380+
enabled:
381+
type: boolean
382+
default: false
383+
oracledb.smon.txn_recovery.posts:
384+
description: "OracledbSmonTxnRecoveryPostsMetricConfig provides config for the oracledb.smon.txn_recovery.posts metric."
385+
type: object
386+
properties:
387+
enabled:
388+
type: boolean
389+
default: false
348390
oracledb.sqlnet.io.transferred:
349391
description: "OracledbSqlnetIoTransferredMetricConfig provides config for the oracledb.sqlnet.io.transferred metric."
350392
type: object
@@ -430,6 +472,13 @@ $defs:
430472
- "tablespace_name"
431473
default:
432474
- "tablespace_name"
475+
oracledb.transaction.rollbacks:
476+
description: "OracledbTransactionRollbacksMetricConfig provides config for the oracledb.transaction.rollbacks metric."
477+
type: object
478+
properties:
479+
enabled:
480+
type: boolean
481+
default: false
433482
oracledb.transactions.limit:
434483
description: "OracledbTransactionsLimitMetricConfig provides config for the oracledb.transactions.limit metric."
435484
type: object

0 commit comments

Comments
 (0)