@@ -12,29 +12,112 @@ will publish these events into Open Telemetry. These events include:
1212 * AC begin and success
1313 * VIP down event
1414
15- The following attributes are added the traces for each event:
16- * ** Roundtrips**
17- * Connection ID
18- * Database Operation
19- * Database User
20- * Database Tenant
21- * SQL ID
22- * Original SQL Text * (only present if sensitive data is enabled)*
23- * Actual SQL Text * (only present if sensitive data is enabled)*
24- * ** AC begin and success**
25- * Error Message
26- * Error code
27- * SQL state
28- * Current replay retry count
29- * ** VIP down event**
30- * Error message
31- * VIP address
32- * Protocol * (only present if sensitive data is enabled)*
33- * Host * (only present if sensitive data is enabled)*
34- * Port * (only present if sensitive data is enabled)*
35- * Service name * (only present if sensitive data is enabled)*
36- * SID * (only present if sensitive data is enabled)*
37- * Connection data * (only present if sensitive data is enabled)*
15+ ## Semantic Conventions (OpenTelemetry Tracer)
16+
17+ The OpenTelemetry tracer supports both ** stable** and ** experimental** (legacy)
18+ OpenTelemetry semantic conventions for Oracle Database instrumentation.
19+
20+ ### Semantic Convention Migration
21+
22+ The OpenTelemetry tracer supports three modes controlled by the ` OTEL_SEMCONV_STABILITY_OPT_IN `
23+ environment variable:
24+
25+ * ** Empty/Not Set (default)** - Emits only experimental (legacy) conventions for backward compatibility
26+ * ** ` database ` ** - Emits only the new stable Oracle Database semantic conventions
27+ * ** ` database/dup ` ** - Emits both old and new conventions (dual mode for gradual migration)
28+
29+ This configuration can be set via environment variable or changed at runtime through the MBean interface.
30+
31+ See the [ OpenTelemetry Database Semantic Conventions] ( https://opentelemetry.io/docs/specs/semconv/database/database-spans/ )
32+ for details on the stable conventions.
33+
34+ ### Roundtrip Events
35+
36+ #### Stable Conventions
37+ When ` OTEL_SEMCONV_STABILITY_OPT_IN=database ` or ` database/dup ` :
38+
39+ * ** Required/Recommended Attributes**
40+ * ` db.system.name ` - Always set to ` "oracle.db" `
41+ * ` db.namespace ` - Format: ` {instance_name}|{database_name}|{service_name} `
42+ * ` db.operation.name ` - Database operation being executed
43+ * ` db.query.summary ` - Low cardinality query summary (SQL type)
44+ * ` server.address ` - Database server hostname
45+ * ` server.port ` - Database server port (if non-default, i.e., not 1521)
46+ * ` oracle.db.query.sql.id ` - Oracle SQL_ID
47+ * ` oracle.db.session.id ` - Oracle session ID
48+ * ` oracle.db.server.pid ` - Oracle server process ID
49+ * ` oracle.db.shard.name ` - Oracle shard name (if applicable)
50+ * ` thread.id ` - Current thread ID
51+ * ` thread.name ` - Current thread name
52+
53+ * ** Opt-In Attributes** * (only present if sensitive data is enabled)*
54+ * ` db.user ` - Database user name
55+ * ` db.query.text ` - Actual SQL query text
56+ * ` db.response.returned_rows ` - Number of rows returned
57+
58+ * ** Error Attributes** * (only present on errors)*
59+ * ` error.type ` - Exception class name (e.g., ` java.sql.SQLSyntaxErrorException ` )
60+ * ` db.response.status_code ` - Oracle error code (format: ` ORA-XXXXX ` )
61+
62+ #### Legacy Conventions
63+ When ` OTEL_SEMCONV_STABILITY_OPT_IN ` is empty/not set or ` database/dup ` :
64+
65+ * ` Connection ID `
66+ * ` Database Operation `
67+ * ` Database Tenant `
68+ * ` SQL ID `
69+ * ` thread.id `
70+ * ` thread.name `
71+ * ` Database User ` * (only present if sensitive data is enabled)*
72+ * ` Original SQL Text ` * (only present if sensitive data is enabled)*
73+ * ` Actual SQL Text ` * (only present if sensitive data is enabled)*
74+
75+ ### Application Continuity (AC) Replay Events
76+
77+ #### Stable Conventions
78+ When ` OTEL_SEMCONV_STABILITY_OPT_IN=database ` or ` database/dup ` :
79+
80+ * ` db.system.name ` - Always set to ` "oracle.db" `
81+ * ` error.type ` - Error message that triggered replay
82+ * ` db.response.status_code ` - Oracle error code (format: ` ORA-XXXXX ` )
83+ * ` db.operation.batch.size ` - Current replay retry count
84+
85+ #### Legacy Conventions
86+ When ` OTEL_SEMCONV_STABILITY_OPT_IN ` is empty/not set or ` database/dup ` :
87+
88+ * ` Error Message `
89+ * ` Error code `
90+ * ` SQL state `
91+ * ` Current replay retry count `
92+
93+ ### VIP Retry Events
94+
95+ #### Stable Conventions
96+ When ` OTEL_SEMCONV_STABILITY_OPT_IN=database ` or ` database/dup ` :
97+
98+ * ` db.system.name ` - Always set to ` "oracle.db" `
99+ * ` error.type ` - Error message that triggered VIP retry
100+ * ` server.address ` - VIP address being retried
101+
102+ ** Opt-In VIP Debug Attributes** * (only present if sensitive data is enabled)* :
103+ * ` server.port ` - Server port number
104+ * ` oracle.db.vip.protocol ` - Connection protocol
105+ * ` oracle.db.vip.failed_host ` - Host that failed during VIP retry
106+ * ` oracle.db.vip.service_name ` - Oracle service name
107+ * ` oracle.db.vip.sid ` - Oracle System Identifier (SID)
108+ * ` oracle.db.vip.connection_descriptor ` - Full connection descriptor
109+
110+ #### Legacy Conventions
111+ When ` OTEL_SEMCONV_STABILITY_OPT_IN ` is empty/not set or ` database/dup ` :
112+
113+ * ` Error message `
114+ * ` VIP Address `
115+ * ` Protocol ` * (only present if sensitive data is enabled)*
116+ * ` Host ` * (only present if sensitive data is enabled)*
117+ * ` Port ` * (only present if sensitive data is enabled)*
118+ * ` Service name ` * (only present if sensitive data is enabled)*
119+ * ` SID ` * (only present if sensitive data is enabled)*
120+ * ` Connection data ` * (only present if sensitive data is enabled)*
38121
39122## Installation
40123
@@ -69,6 +152,17 @@ oracle.jdbc.provider.traceEventListener.unique_identifier=<unique identifier>
69152
70153If no unique identifier is provided, the unique idetifier "default" is used.
71154
155+ ### Enabling Stable Semantic Conventions (OpenTelemetry)
156+
157+ To use the new stable OpenTelemetry semantic conventions, set the environment variable:
158+ ``` bash
159+ # Use only stable conventions
160+ export OTEL_SEMCONV_STABILITY_OPT_IN=database
161+
162+ # OR use both old and new conventions (dual mode for migration)
163+ export OTEL_SEMCONV_STABILITY_OPT_IN=database/dup
164+ ```
165+
72166## Configuration
73167
74168The provider can be configured by:
0 commit comments