Skip to main content

Oracledb Receiver

Status Available in: contrib Maintainers: @dmitryax, @crobert-1, @atoulme Source: opentelemetry-collector-contrib

Supported Telemetry

Logs Metrics

Overview

Getting Started

To use the Oracle DB receiver you must define how to connect to your DB. This can be done in two ways, defined in the Primary and Secondary configuration option sections. Defining one of the two configurations is required. If both are defined, the primary option will be used.

Primary Configuration Option

Required options: Example:
receivers:
  oracledb:
    datasource: "oracle://otel:password@localhost:51521/XE"

Secondary Configuration Option

Required options:
  • endpoint: Endpoint used to connect to the Oracle DB server. Must be in the format of host:port
  • password: Password for the Oracle DB connection. Special characters are allowed.
  • service: Oracle DB service that the receiver should connect to.
  • username: Username for the Oracle DB connection.
Example:
receivers:
  oracledb:
    endpoint: localhost:51521
    password: p@sswo%d
    service: XE
    username: otel

Optional Configuration Options

  • collection_interval (default = 10s): The interval at which metrics should be emitted by this receiver.
  • initial_delay (default = 1s): The initial time period this receiver waits before starting.
  • timeout (default = 0): Timeout for each Oracle DB request. Disabled by default.

Permissions

Instance detection

These grants are required to populate the oracle.db.version, oracle.db.role, oracle.db.open_mode, and oracle.db.pdb resource attributes. Detection is best-effort; failures are logged at warn level and the receiver continues.
GRANT SELECT ON V_$INSTANCE TO <username>;
GRANT SELECT ON V_$DATABASE TO <username>;
Note: sys_context('USERENV', ...) queries against DUAL require no additional grant and are available to all database users.

Hosting type detection (Oracle >=19c only)

These grants are required to populate the oracle.db.hosting_type resource attribute. Only applies to Oracle 19c and later. Detection is best-effort; failures are logged at warn level and the receiver continues.
GRANT SELECT ON V_$DATAFILE TO <username>;
GRANT SELECT ON V_$PDBS TO <username>;        -- OCI detection, connected to PDB only
GRANT SELECT ON CDB_SERVICES TO <username>;   -- OCI confirmation, connected to PDB only

Metrics collection

Depending on which metrics you collect, you will need to assign these permissions to the database user:
GRANT SELECT ON V_$SESSION TO <username>;
GRANT SELECT ON V_$SYSSTAT TO <username>;
GRANT SELECT ON V_$RESOURCE_LIMIT TO <username>;
GRANT SELECT ON DBA_TABLESPACES TO <username>;
GRANT SELECT ON DBA_DATA_FILES TO <username>;
GRANT SELECT ON DBA_TABLESPACE_USAGE_METRICS TO <username>;

Events collection

These grants are required for the db.server.query_sample, db.server.top_query, and db.server.session.wait_sample events.
GRANT SELECT ON V_$SQL TO <username>;
GRANT SELECT ON V_$SQL_PLAN_STATISTICS_ALL TO <username>;
GRANT SELECT ON V_$SESSION TO <username>;
GRANT SELECT ON V_$SESSION_EVENT TO <username>;
GRANT SELECT ON V_$LOCK TO <username>;
GRANT SELECT ON V_$CONTAINERS TO <username>;
GRANT SELECT ON DBA_OBJECTS TO <username>;
GRANT SELECT ON DBA_PROCEDURES TO <username>;
[!NOTE] In the SQL query plan details, the LAST_*, OUTPUT_ROWS, and STARTS columns are populated only when Oracle is configured to collect execution plan statistics (for example, STATISTICS_LEVEL=ALL or the GATHER_PLAN_STATISTICS hint). Otherwise, these fields will be NULL or empty. Configuring this Oracle instrumentation may introduce additional runtime overhead. Enable it only if you need these runtime execution statistics for query performance analysis.
ALTER SYSTEM SET statistics_level = ALL;

Enabling metrics.

See documentation. You can enable or disable selective metrics. Example:
receivers:
  oracledb:
    datasource: "oracle://otel:password@localhost:51521/XE"
    metrics:
      oracledb.query.cpu_time:
        enabled: false
      oracledb.query.physical_read_requests:
        enabled: true

Enabling events.

The following is a generic configuration that can be used for the default logs and metrics scraped by the Oracle DB receiver.
receivers:
  oracledb:
    collection_interval: 10s                     # interval for overall collection
    datasource: "oracle://otel:password@localhost:51521/XE"
    events:
      db.server.query_sample:
        enabled: true
      db.server.top_query:
        enabled: true
      db.server.session.wait_sample:
        enabled: true
    top_query_collection:                        # this collection exports the most expensive queries as logs
      max_query_sample_count: 1000               # maximum number of samples collected from db to filter the top N
      top_query_count: 200                       # The maximum number of queries (N) for which the metrics would be reported
      collection_interval: 60s                   # collection interval for top query collection specifically
      allowed_comment_keys: [application]        # keys to extract from leading SQL comments (see SQL Comment Extraction below)
    query_sample_collection:                     # this collection exports the currently (relate to the query time) executing queries as logs
      max_rows_per_query: 100                     # the maximum number of samples to bre reported.
      allowed_comment_keys: [application]        # keys to extract from leading SQL comments (see SQL Comment Extraction below)
    session_wait_event_collection:               # this collection exports per-session wait event statistics from v$session_event as logs
      max_rows_per_query: 100                    # the maximum number of session wait event rows to be reported                 

SQL Comment Extraction

When the db.server.query_sample and/or db.server.top_query events are enabled, the receiver can extract key-value pairs from leading SQL block comments (/* key=value */) and emit them as the db.query.comment_tags attribute on the corresponding logs. This behavior is controlled by the allowed_comment_keys option, which can be set independently under top_query_collection and query_sample_collection:
  • allowed_comment_keys (default = []): A list of comment keys to extract. For each enabled collection, only keys present in this allowlist are extracted from the leading SQL comment and included (as comma-separated key=value pairs) in the db.query.comment_tags attribute.
Extraction is disabled unless explicitly configured:
  • When allowed_comment_keys is empty or unset, no comments are extracted.
  • Only keys included in the allowlist are emitted; all other comment keys are ignored.
  • Only leading block comments are parsed; comments elsewhere in the query are ignored.
Example:
receivers:
  oracledb:
    datasource: "oracle://otel:password@localhost:51521/XE"
    events:
      db.server.query_sample:
        enabled: true
      db.server.top_query:
        enabled: true
    top_query_collection:
      allowed_comment_keys: [application, team]
    query_sample_collection:
      allowed_comment_keys: [application, team]
Given a query such as /* application=exampleApp,team=payments */ SELECT * FROM users, the emitted log record will include db.query.comment_tags set to application=exampleApp,team=payments. When multiple keys are extracted, they are emitted as a comma-separated list of key=value pairs. See documentation for details on the db.query.comment_tags attribute.

Metrics

Metric NameDescriptionUnitTypeAttributes
oracledb.buffer.inspectedNumber of buffers inspected from the end of the LRU queue while a process searched for a reusable buffer, grouped by buffer state.{buffer}Counteroracledb.buffer.state
oracledb.buffer.requestsNumber of times a reusable or free buffer was requested to create or load a block.{request}Counter
oracledb.buffer_cache.block.changesNumber of changes that were part of an update or delete operation made to blocks in the buffer cache.{change}Counter
oracledb.buffer_cache.block.getsNumber of current-mode block gets satisfied from the buffer cache. Distinct from oracledb.db_block_gets, which counts all current-mode block gets requested regardless of where they are satisfied.{get}Counter
oracledb.buffer_cache.utilizationFraction of logical reads served from the buffer cache without physical I/O, as computed by Oracle V$SYSMETRIC (% (LogRead - PhyRead)/LogRead).%Gauge
oracledb.call.countTotal count of calls issued to the database.{call}Counteroracledb.call.type
oracledb.call.recursive.cpu.timeTotal CPU time spent on recursive (internal) calls.sCounter
oracledb.checkpoint.buffersNumber of buffers written by the Database Writer (DBWR) for checkpoints.{buffer}Counter
oracledb.checkpoint.completedNumber of checkpoints completed by the Database Writer (DBWR).{checkpoint}Counter
oracledb.consistent_getsNumber of times a consistent read was requested for a block from the buffer cache.{gets}Counter
oracledb.cpu_timeCumulative CPU time, in secondssCounter
oracledb.cursor.cache.hitsTotal count of session cursor cache hits, where an existing cached cursor is reused to avoid a soft parse.{hit}Counter
oracledb.cursor.cache.sizeNumber of cursors currently held in the session cursor cache.{cursor}Gauge
oracledb.cursor.openNumber of currently open cursors in the Oracle instance.{cursor}Gauge
oracledb.data_dictionary.hit_ratioData dictionary cache hit ratio from v$rowcache.%Gauge
oracledb.database.cpu.utilizationFraction of total database time spent on CPU, as computed by Oracle V$SYSMETRIC (% Cpu/DB_Time).%Gauge
oracledb.database.wait.utilizationFraction of total database time spent waiting on I/O, locks, or latches, as computed by Oracle V$SYSMETRIC (% Wait/DB_Time).%Gauge
oracledb.db.timeTotal wall-clock time spent in database calls.sCounteroracledb.session.type
oracledb.db_block_getsNumber of times a current block was requested from the buffer cache.{gets}Counter
oracledb.ddl_statements_parallelizedNumber of DDL statements that were executed in parallel{statements}Counter
oracledb.dml_locks.limitMaximum limit of active DML (Data Manipulation Language) locks, -1 if unlimited.{locks}Gauge
oracledb.dml_locks.usageCurrent count of active DML (Data Manipulation Language) locks.{locks}Gauge
oracledb.dml_statements_parallelizedNumber of DML statements that were executed in parallel{statements}Counter
oracledb.enqueue.operationsTotal count of enqueue (lock) operations.{operation}Counteroracledb.enqueue.type
oracledb.enqueue_deadlocksTotal number of deadlocks between table or row locks in different sessions.{deadlocks}Counter
oracledb.enqueue_locks.limitMaximum limit of active enqueue locks, -1 if unlimited.{locks}Gauge
oracledb.enqueue_locks.usageCurrent count of active enqueue locks.{locks}Gauge
oracledb.enqueue_resources.limitMaximum limit of active enqueue resources, -1 if unlimited.{resources}Gauge
oracledb.enqueue_resources.usageCurrent count of active enqueue resources.{resources}Gauge
oracledb.exchange_deadlocksNumber of times that a process detected a potential deadlock when exchanging two buffers and raised an internal, restartable error. Index scans are the only operations that perform exchanges.{deadlocks}Counter
oracledb.execution.utilizationFraction of executions that did not require a parse, as computed by Oracle V$SYSMETRIC (% (ExecWOParse/TotalExec)). High values indicate good cursor reuse.%Gaugeoracledb.parse.type
oracledb.executionsTotal number of calls (user and recursive) that executed SQL statements{executions}Counter
oracledb.hard_parsesNumber of hard parses{parses}Counter
oracledb.host.cpu.utilizationFraction of host CPU time in use, as computed by Oracle V$SYSMETRIC (% Busy/(Idle+Busy)).%Gauge
oracledb.library_cache.utilizationFraction of library cache pin requests that found the object already cached, as computed by Oracle V$SYSMETRIC (% Hits/Pins).%Gauge
oracledb.lob.operationsTotal count of LOB (large object) I/O operations.{operation}Counterdisk.io.direction
oracledb.logical_readsNumber of logical reads{reads}Counter
oracledb.logonsNumber of logon operations{operation}Counter
oracledb.parallel_operations_downgraded_1_to_25_pctNumber of times parallel execution was requested and the degree of parallelism was reduced down to 1-25% because of insufficient parallel execution servers{executions}Counter
oracledb.parallel_operations_downgraded_25_to_50_pctNumber of times parallel execution was requested and the degree of parallelism was reduced down to 25-50% because of insufficient parallel execution servers{executions}Counter
oracledb.parallel_operations_downgraded_50_to_75_pctNumber of times parallel execution was requested and the degree of parallelism was reduced down to 50-75% because of insufficient parallel execution servers{executions}Counter
oracledb.parallel_operations_downgraded_75_to_99_pctNumber of times parallel execution was requested and the degree of parallelism was reduced down to 75-99% because of insufficient parallel execution servers{executions}Counter
oracledb.parallel_operations_downgraded_to_serialNumber of times parallel execution was requested but execution was serial because of insufficient parallel execution servers{executions}Counter
oracledb.parallel_operations_not_downgradedNumber of times parallel execution was executed at the requested degree of parallelism{executions}Counter
oracledb.parse.cpu.timeTotal CPU time spent on SQL parsing.sCounter
oracledb.parse.elapsed.timeTotal wall-clock time spent on SQL parsing.sCounter
oracledb.parse.rateRate of parse operations per second broken down by result, as computed by Oracle V$SYSMETRIC (e.g., Parse Failure Count Per Sec).{parses}/sGaugeoracledb.parse.result
oracledb.parse.utilizationFraction of parse calls that were soft parses, as computed by Oracle V$SYSMETRIC (% SoftParses/TotalParses). High values indicate good cursor reuse.%Gauge
oracledb.parse_callsTotal number of parse calls.{parses}Counter
oracledb.pga_memorySession PGA (Program Global Area) memoryByCounter
oracledb.physical_io.cache_writesNumber of physical writes from the buffer cache to disk by DBWR. Sourced from v$sysstat name physical writes from cache.{writes}Counter
oracledb.physical_io.requestsNumber of physical I/O requests issued to storage. Sourced from v$sysstat names physical read/write total IO requests (disk.io.block_size=all) and physical read/write total multi block requests (disk.io.block_size=multi).{requests}Counterdisk.io.direction, disk.io.block_size
oracledb.physical_io.transferredTotal physical I/O bytes transferred between Oracle and storage. Sums across all data files. Sourced from v$sysstat names physical read/write bytes (disk.io.type=buffered) and physical read/write total bytes (disk.io.type=total).ByCounterdisk.io.direction, disk.io.type
oracledb.physical_read_io_requestsNumber of read requests for application activity{requests}Counter
oracledb.physical_readsNumber of physical reads{reads}Counter
oracledb.physical_reads_directNumber of reads directly from disk, bypassing the buffer cache{reads}Counter
oracledb.physical_write_io_requestsNumber of write requests for application activity{requests}Counter
oracledb.physical_writesNumber of physical writes{writes}Counter
oracledb.physical_writes_directNumber of writes directly to disk, bypassing the buffer cache{writes}Counter
oracledb.processes.limitMaximum limit of active processes, -1 if unlimited.{processes}Gauge
oracledb.processes.usageCurrent count of active processes.{processes}Gauge
oracledb.queries_parallelizedNumber of SELECT statements executed in parallel{queries}Counter
oracledb.recycle_bin.limitTotal size of the recycle bin.ByGauge
oracledb.redo.blocksNumber of redo blocks moved between the redo log and storage.{block}Counterdisk.io.direction
oracledb.redo.operationsNumber of redo I/O operations.{operation}Counterdisk.io.direction
oracledb.redo.requestsNumber of times a process requested space in the redo log buffer and had to wait.{request}Counteroracledb.redo.request.type
oracledb.redo.retriesNumber of times a process waited and retried to allocate space in the redo buffer.{retry}Counteroracledb.redo.retry.type
oracledb.redo.sizeAmount of redo generated.ByCounter
oracledb.redo.timeTime spent in each phase of the redo pipeline.sCounteroracledb.redo.type
oracledb.redo_allocation.utilizationFraction of redo allocations that succeeded without space contention, as computed by Oracle V$SYSMETRIC (% (#Redo - RedoSpaceReq)/#Redo).%Gauge
oracledb.scan.countTotal count of scan operations.{operation}Counteroracledb.scan.type, oracledb.scan.mode
oracledb.scan.table.rowsTotal number of rows returned by full-table scans.{row}Counter
oracledb.sessions.limitMaximum limit of active sessions, -1 if unlimited.{sessions}Gauge
oracledb.sessions.usageCount of active sessions.{sessions}Gaugesession_type, session_status
oracledb.shared_pool.utilizationFraction of the shared pool that is currently free, as computed by Oracle V$SYSMETRIC (% Free/Total). Low values indicate shared pool pressure.%Gauge
oracledb.sort.operationsTotal count of sort operations.{operation}Counteroracledb.sort.type
oracledb.sort.ratioFraction of sorts performed in memory vs disk, as computed by Oracle V$SYSMETRIC (% MemSort/(MemSort + DiskSort)). Low values indicate PGA memory pressure.1Gaugeoracledb.sort.type
oracledb.sort.rowsTotal number of rows sorted across all sort operations.{row}Counter
oracledb.sql_service.response.durationAverage SQL service response time in seconds, converted from centiseconds as reported by Oracle V$SYSMETRIC (CentiSeconds Per Call).sGauge
oracledb.sqlnet.io.transferredBytes transferred via SQLNet between Oracle and clients/dblinks. Sourced from v$sysstat names bytes received/sent via SQLNet from/to client/dblink.ByCounternetwork.io.direction, destination.type
oracledb.storage.usageUsed database storage size from dba_data_files and dba_free_space.ByGauge
oracledb.storage.utilizationFraction of allocated database storage that is used.1Gauge
oracledb.tablespace_size.limitMaximum size of tablespace in bytes, -1 if unlimited.ByGaugetablespace_name
oracledb.tablespace_size.usageUsed tablespace in bytes.ByGaugetablespace_name
oracledb.transactions.limitMaximum limit of active transactions, -1 if unlimited.{transactions}Gauge
oracledb.transactions.usageCurrent count of active transactions.{transactions}Gauge
oracledb.user_commitsNumber of user commits. When a user commits a transaction, the redo generated that reflects the changes made to database blocks must be written to disk. Commits often represent the closest thing to a user transaction rate.{commits}Counter
oracledb.user_rollbacksNumber of times users manually issue the ROLLBACK statement or an error occurs during a user’s transactions1Counter

Attributes

Attribute NameDescriptionTypeValues
client.addressHostname or address of the client.string
client.portTCP port used by the client.int
db.namespaceThe database name.string
db.query.comment_tagsFiltered SQL query comments extracted from leading block comments. Contains comma-separated key=value pairs for keys specified in allowed_comment_keys configuration. Used for correlation with APM traces.string
db.query.textThe text of the database query being executed.string
db.server.nameThe name of the server hosting the database.string
db.system.nameThe database management system (DBMS) product as identified by the client instrumentation.string
destination.typeType of the SQL*Net destination endpoint (client application or remote database link).stringclient, dblink
disk.io.block_sizeMulti-block vs single-block (all) I/O request grouping.stringall, multi
disk.io.directionDirection of the storage I/O operation.stringread, write
disk.io.typeWhether the I/O bytes are buffered (cache-mediated) or total (raw transfer count).stringbuffered, total
network.io.directionDirection of the SQL*Net network transfer.stringreceive, transmit
network.peer.addressIP address of the peer client.string
network.peer.portTCP port used by the peer client.int
oracle.db.serviceThe Oracle service name associated with the database connection.string
oracledb.application_wait_timeThe total time (in seconds) a query spent waiting on the application before it could proceed with execution (reporting delta).double
oracledb.blocking.blocker.root_sidThe session ID (SID) of the root/head blocker at the top of the blocking chain. Empty string when there is no blocking.string
oracledb.blocking.blocker.sidThe session ID (SID) of the immediate blocker of this session. Empty string when the session is not blocked.string
oracledb.blocking.blocker.stateThe status of the blocking session relationship (e.g. VALID, NOT IN WAIT, GLOBAL, NO HOLDER, UNKNOWN).string
oracledb.blocking.lock.modeThe lock mode being requested by the blocked session (e.g., ROW SHARE, ROW EXCLUSIVE, SHARE, SHARE ROW EXCLUSIVE, EXCLUSIVE). Empty when not waiting on a lock.string
oracledb.blocking.lock.typeThe type of enqueue lock the session is waiting on, extracted from the wait event (e.g., TX for row lock, TM for table lock). Empty when not waiting on a lock.string
oracledb.blocking.object.nameThe name of the database object the session is waiting to lock. Empty when no object lock wait is active.string
oracledb.blocking.object.ownerThe owner (schema) of the database object the session is waiting to lock. Empty when no object lock wait is active.string
oracledb.blocking.start_timeEstimated UTC timestamp of when the blocking wait began, derived from SYSDATE - SECONDS_IN_WAIT. RFC3339 format.string
oracledb.blocking.wait_durationThe number of seconds this session has been waiting for the current wait event.int
oracledb.buffer.stateThe state of a buffer encountered while inspecting the LRU queue for a reusable buffer (free = a reusable buffer that was skipped; dirty = a dirty buffer found).stringfree, dirty
oracledb.buffer_getsNumber of logical reads (i.e., buffer cache accesses) performed by a query (reporting delta).int
oracledb.call.typeType of call reported by Oracle.stringrecursive, user
oracledb.child_addressAddress of the child cursor.string
oracledb.child_numberThe child number of the query.string
oracledb.cluster_wait_timeTotal time (in seconds) that a query waited due to Oracle Real Application Clusters (RAC) coordination (reporting delta).double
oracledb.command_typeCommand type of the query.int
oracledb.concurrency_wait_timeTotal time (in seconds) a query spent waiting on concurrency-related events (reporting delta).double
oracledb.cpu_timeTotal time (in seconds) that the CPU spent actively processing a query, excluding time spent waiting (reporting delta).double
oracledb.direct_readsThe number of direct path reads performed by a query — i.e., data blocks read directly from disk into the session’s memory (reporting delta).int
oracledb.direct_writesThe number of direct path write operations, where data is written directly to disk from user memory (reporting delta).int
oracledb.disk_readsThe number of physical reads a query performs — that is, the number of data blocks read from disk (reporting delta).int
oracledb.duration_secTotal time taken by a database query to execute.double
oracledb.elapsed_timeThe total time (in seconds) taken by a query from start to finish, including CPU time and all types of waits (reporting delta).double
oracledb.enqueue.typeType of enqueue (lock) operation reported by Oracle.stringconversions, releases, requests, timeouts, waits
oracledb.eventThe specific wait event that a query or session is currently experiencing.string
oracledb.executionsThe number of times a specific SQL query has been executed (reporting delta).int
oracledb.moduleLogical module name of the client application that initiated a query or session.string
oracledb.osuserName of the operating system user that initiated or is running the Oracle database session.string
oracledb.parse.resultResult of a parse operation (e.g., failure).stringfailure
oracledb.parse.typeType of parse operation (e.g., soft).stringsoft
oracledb.physical_read_bytesThe total number of bytes read from disk by a query (reporting delta).int
oracledb.physical_read_requestsThe number of physical I/O read operations performed by a query (reporting delta).int
oracledb.physical_write_bytesThe total number of bytes written to disk by a query (reporting delta).int
oracledb.physical_write_requestsThe number of times a query requested to write data to disk (reporting delta).int
oracledb.plan.first_loadTime at which the plan was first loaded into the library cache, in the server’s local timezone. Format: YYYY-MM-DD/HH:MM:SSstring
oracledb.plan.last_loadPlan load time in the server’s local timezone. Format: YYYY-MM-DD/HH:MM:SSstring
oracledb.plan_hash_valueBinary hash value calculated on the query execution plan and used to identify similar query execution plans, reported in the HEX format.string
oracledb.procedure_execution_countThe number of times the stored procedure has been executed, derived from the minimum statement execution count across all statements in the procedure (reporting delta). Please note, this is best effort and may not be accurate in some scenarios. Use with caution.int
oracledb.procedure_idThe identifier of the stored procedure or function being executed by the query.int
oracledb.procedure_nameName of the database object that a query is accessing.string
oracledb.procedure_typeType of the database object that a query is accessing.string
oracledb.processThe operating system process ID (PID) associated with a session.string
oracledb.programName of the client program or tool that initiated the Oracle database session.string
oracledb.query.startedThe timestamp when the SQL statement started execution, in ISO 8601 format (UTC).string
oracledb.query.wait_timeThe wait time in seconds. If the session is currently waiting, the value is the time spent waiting in the current wait. Returns 0 if the session is not currently waiting.double
oracledb.query_planThe query execution plan used by the SQL Server.string
oracledb.redo.request.typeThe type of redo log buffer space request.stringlog_space
oracledb.redo.retry.typeThe type of redo buffer allocation retry.stringbuffer_allocation
oracledb.redo.typeThe phase of the redo pipeline that a redo time measurement is attributed to.stringwrite, log_space_wait, sync
oracledb.rows_processedThe total number of rows that a query has read, returned, or affected during its execution (reporting delta).int
oracledb.scan.modeExecution mode of the scan reported by Oracle.stringdirect_read, full, long_tables, rowid_ranges
oracledb.scan.typeType of scan operation reported by Oracle.stringindex_fast_full, table
oracledb.schemanameOracle schema under which SQL statements are being executedstring
oracledb.serialSerial number associated with a session.string
oracledb.session.durationThe total time in seconds that the session has been connected.double
oracledb.session.startedThe timestamp when the session logged on, in ISO 8601 format (UTC).string
oracledb.session.typeClass of session the database time is attributed to.stringforeground
oracledb.sidID of the Oracle Server session.string
oracledb.sort.typeType of sort operation (e.g., memory, disk).stringdisk, memory
oracledb.sql_idThe SQL ID of the query.string
oracledb.stateCurrent state of the query or the session executing it.string
oracledb.statusExecution state or result of a database query or session.string
oracledb.user_io_wait_timeThe total time (in seconds) a query spent waiting for user I/O operations—such as reading or writing data to disk or network file systems (reporting delta).double
oracledb.wait.countTotal number of waits for the wait event across all sessions.int
oracledb.wait.durationTotal time waited in seconds for the wait event.double
oracledb.wait_classThe category of wait events a query or session is currently experiencing in Oracle Database.string
session_statusSession statusstring
session_typeSession typestring
tablespace_nameTablespace namestring
user.nameDatabase user name under which a session is connected tostring

Resource Attributes

Attribute NameDescriptionTypeEnabled
host.nameThe host name of Oracle Serverstring
oracle.db.hosting_typeThe hosting environment of the Oracle instance. One of “self-managed”, “rds”, or “oci”.string
oracle.db.open_modeThe open mode of the Oracle database (e.g. “READ WRITE”, “READ ONLY”, “MOUNTED”).string
oracle.db.pdbThe pluggable database (PDB) name associated with the connection.string
oracle.db.roleThe database role of the Oracle instance (e.g. “PRIMARY”, “PHYSICAL STANDBY”).string
oracle.db.versionThe Oracle Database version string.string
oracledb.instance.nameThe name of the instance that data is coming from.string
service.instance.idA unique identifier of the Oracle DB instance in the format host:port/serviceName. (defaults to ‘unknown:1521’, in case of error in generating this value)string
service.nameLogical name of the service. When enabled, defaults to unknown_service:oracle.string
service.namespaceLogical namespace for the service (for example team or environment). When enabled, defaults to an empty string until set via configuration.string

Configuration

Example Configuration

oracledb:
  # driver name: oracle
  endpoint: localhost:51521
  password: password
  service: XE
  username: otel
  # Refer to Oracle Go Driver go_ora documentation for full connection string options
  datasource: "oracle://otel:password@localhost:51521/XE"
  top_query_collection:
    max_query_sample_count: 222
    top_query_count: 200
  metrics:
    oracledb.exchange_deadlocks:
      enabled: false
    oracledb.tablespace_size.usage:
      enabled: false
  events:
    db.server.top_query:
      enabled: true
    db.server.query_sample:
      enabled: true

Last generated: 2026-07-06