[db/oracledb] Add application context piggyback for oracle database#3901
[db/oracledb] Add application context piggyback for oracle database#3901sudarshan12s wants to merge 10 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR extends the existing Oracle Database (oracledb) semantic conventions documentation by adding guidance for propagating trace context via Oracle driver “Application Context Piggyback” (CLIENTCONTEXT), and by recommending it over V$SESSION.ACTION when supported.
Changes:
- Document a new “Application context piggyback” context propagation strategy, including a specified wire-format for
traceparent/tracestate(and optional baggage). - Add a .NET (
Oracle.ManagedDataAccess.Core) configuration example demonstrating opt-in driver-side propagation. - Update the
V$SESSION.ACTIONsection to recommend piggybacking when available, and add a changelog entry.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| docs/db/oracledb.md | Adds a new context propagation section for application context piggybacking, examples, and guidance vs V$SESSION.ACTION. |
| .chloggen/oracledb-app-context.yaml | Adds a release note entry for the Oracle DB enhancement. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
| // 2. Opt-in to client context piggybacking. | ||
| // The driver automatically serializes the active W3C trace context | ||
| // into CLIENTCONTEXT (ora$opentelem$tracectx) during subsequent executions. | ||
| connection.DatabaseOpenTelemetryTracing = true; |
lmolkova
left a comment
There was a problem hiding this comment.
That's awesome!
I'd like to check if we can deprecate or remove V$SESSION section
|
|
||
| Although application context piggyback is not constrained by the 64 byte limit of `V$SESSION.ACTION`, it can still be subject to application context size limits. Oracle application context values are limited to 4000 bytes, and drivers such as `node-oracledb` may enforce the same limit in their APIs. Furthermore, this mechanism requires support from both the database client driver and the database server version in use. To successfully capture and process these values for end-to-end tracing, the database server must also be explicitly configured to enable tracing. | ||
|
|
||
| Compared with `V$SESSION.ACTION`, application context piggyback avoids overloading a field that applications may already use and is not constrained by the 64 byte limit of `ACTION`. |
There was a problem hiding this comment.
I'd be in favor of deprecating V$SESSION section give there is a blessed-by-provider way to propagate context now.
@sincejune @XSAM @open-telemetry/semconv-db-approvers wdyt?
@sudarshan12s are there cases when V$SESSION.ACTION is preferred / necessary? Can we provide an explicit recommendation to use new way over that?
There was a problem hiding this comment.
Hi @lmolkova, I've updated the document to address this. The V$SESSION.ACTION approach is now explicitly designated for older Oracle versions only.
I have added the exact minimum client and server versions required for the new Application Context Piggyback mechanism, along with a new Recommendation Guidance section details.
Please see.
There was a problem hiding this comment.
@sudarshan12s Is it possible to read traceparent from V$SESSION after using piggybacks?
The oracledbreceiver currently uses V$SESSION to sample running queries. The samples include information such as the query plan and blocking sessions. If not, then using only piggybacks would break the query sample feature of oracledbreceiver.
Or, is there a way to make spans from oracledb publish this type of information?
… into appcontextpiggybackspec
propogation is supported.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
Comments suppressed due to low confidence (1)
docs/db/oracledb.md:1
- The normative language here is internally inconsistent and overly strict: a universal “MUST prioritize” conflicts with earlier text that frames piggybacking as optional/opt-in and dependent on driver/server support. Consider changing the requirement to conditional language (e.g., “SHOULD prefer when supported/available”) and avoid calling
V$SESSION.ACTION“deprecated” unless the repo has a formal deprecation process/marker for this section.
<!--- Hugo front matter used to generate the website version of this page:
|
|
||
| ### Choice of Propagation Mechanism | ||
|
|
||
| When selecting a context propagation strategy for Oracle Database, telemetry implementations MUST prioritize the **Application Context Piggyback** mechanism over the legacy `V$SESSION.ACTION` method. |
There was a problem hiding this comment.
I can address them after review of updated changes.
|
|
||
| | Mechanism | Implementation Type | Minimum Stack Requirements | Tracing Behavior | | ||
| | :--- | :--- | :--- | :--- | | ||
| | **Application Context Piggyback (Recommended)** | **Native** | • **Client:** Oracle JDBC Driver 23.26.2+ or ODP.NET (managed or core) 23.26.2+<br><br>• **Server:** Oracle AI Database 26ai 23.26.2+ | Built-in server-side parsing of W3C telemetry context via the network protocol. | |
There was a problem hiding this comment.
26ai is generally the release name and 23.26.2+ is the specific version from where its supported.
Pull request dashboard statusStatus last refreshed: 2026-07-25 18:00:13 UTC.
This automated status or its linked feedback items may be incorrect. If something looks wrong, please report it with the result you expected. If you believe this pull request is incorrectly routed as waiting on the author, comment |
Fixes #
Changes
This PR enhances the Oracle Database (
oracledb) semantic conventions by documenting a modern Application Context Piggyback mechanism for context propagation.CLIENTCONTEXTnamespace using the keyora$opentelem$tracectx(and optionallyora$opentelem$baggage).tracestateandbaggageto handle future-proofing gracefully.oracle.jdbc) connection tracing API usage and also a complete application configuration example using .NET (Oracle.ManagedDataAccess.Core).V$SESSION.ACTION(avoids overloading application fields and bypasses the 64-byte limitation).Important
Pull request acceptance is subject to the triage process as described in Issue and PR Triage Management.
PRs that do not follow the guidance above may be automatically rejected and closed.
Merge requirement checklist
Footnotes
Yes, I can answer maintainer questions about the content of this PR without using AI. ↩