Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(oracledb): Add support for Oracle DB instrumentation #2612

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sudarshan12s
Copy link

Add Oracledb instrumentation

Which problem is this PR solving?

Adding instrumentation support for node-oracledb applications connecting to Oracle database.

Short description of the changes

From node-oracledb version 6.7 onwards, oracledb module exports a class,
TraceHandlerBase which simulates interface kind of functionality with abstract methods to be overwritten by the derived class.

The current OT module derives this class TraceHandlerBase and implements abstract methods; It uses setTraceInstance method of oracledb module to register this new derived class OracleTelemetryTraceHandler
These methods are invoked by oracledb module providing the traceContext which is used to dump the data in to the span after converting to standard span attributes.

Following are the abstract methods implemented:

  • onEnterFn -> It gets invoked by oracledb module when application invokes getConnection to create a connection to
    database or execute method to run a sql. It is invoked before invoking the public API calls made by application.
  • onExitFn -> It gets invoked after the public API call is completed with success/failure.
  • onBeginRoundTrip -> It gets invoked before round trip to database which was triggered as part of public API.
  • onEndRoundTrip -> It gets invoked after round trip to database completes which was triggered as part of public API..

Note:

  • As part of CI, i was getting regex ReDos for comment inside files. which can be ignored . I modified to make it safe..

Add Oracledb instrumentation
@sudarshan12s sudarshan12s requested a review from a team as a code owner December 20, 2024 17:52
Copy link

linux-foundation-easycla bot commented Dec 20, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: sudarshan12s / name: Sudarshan Soma (90db232)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment