Skip to content

Commit f41f62c

Browse files
committed
- Minor changes to align naming variable and more comments added.
1 parent e19e1ea commit f41f62c

File tree

4 files changed

+16
-13
lines changed

4 files changed

+16
-13
lines changed

plugins/node/opentelemetry-instrumentation-oracledb/src/constants.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,12 @@ export enum AttributeNames {
2525
ORACLE_EXEC_OPTIONS = 'db.oracle.exec.options',
2626
ORACLE_INSTANCE = 'db.oracle.instance',
2727
ORACLE_PDBNAME = 'db.oracle.pdbname',
28-
ORACLE_IMPLICIT_RELEASE = 'db.oracle.ImplicitRelease',
28+
ORACLE_IMPLICIT_RELEASE = 'db.oracle.implicit_release',
2929
}
3030

3131
// Contains span names produced by instrumentation
32+
// It lists the RPC names (suffix with _MSG like EXECUTE_MSG) and
33+
// exported oracledb functions (like EXECUTE).
3234
export enum SpanNames {
3335
CONNECT = 'oracledb.getConnection',
3436
POOL_CONNECT = 'oracledb.Pool.getConnection',

plugins/node/opentelemetry-instrumentation-oracledb/src/instrumentation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import * as utils from './utils';
2525
import { PACKAGE_NAME, PACKAGE_VERSION } from './version';
2626

2727
export class OracleInstrumentation extends InstrumentationBase {
28-
private _tmHandler!: utils.OracleTelemetryTraceHandler | null;
28+
private _tmHandler: utils.OracleTelemetryTraceHandler | null = null;
2929

3030
constructor(config: OracleInstrumentationConfig = {}) {
3131
super(PACKAGE_NAME, PACKAGE_VERSION, config);

plugins/node/opentelemetry-instrumentation-oracledb/src/internal-types.ts

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,26 +20,27 @@ import * as oracledbTypes from 'oracledb';
2020
import type * as api from '@opentelemetry/api';
2121
import { SpanConnectionConfig } from './types';
2222

23-
// Captures the context associated with onEnterFn, onExitFn hooks.
23+
// onEnterFn returns this Context(contains only span for now) and it is
24+
// received in onExitFn to end the span.
2425
export interface InstrumentationContext {
2526
span: api.Span;
2627
}
2728

2829
// Captures the entire span data
2930
export interface TraceSpanData {
30-
operation: string;
31+
operation: string; // RPC or exported function name.
3132
error?: oracledbTypes.DBError;
3233
connectLevelConfig?: SpanConnectionConfig;
3334
callLevelConfig?: SpanCallLevelConfig;
34-
additionalConfig?: any;
35-
fn: Function;
36-
args?: any[];
35+
additionalConfig?: any; // custom key/values associated with a function.
36+
fn: Function; // Replaced with bind function associating the active context.
37+
args?: any[]; // input arguments passed to the exported function.
3738
userContext: InstrumentationContext;
3839
}
3940

4041
// Captures call level related span data
4142
export interface SpanCallLevelConfig {
42-
statement?: string;
43-
operation?: string;
44-
values?: any[];
43+
statement?: string; // SQL stmt.
44+
operation?: string; // SQL op ('SELECT | INSERT ..').
45+
values?: any[]; // bind values.
4546
}

plugins/node/opentelemetry-instrumentation-oracledb/src/types.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ export interface SpanConnectionConfig {
2929
instanceName?: string;
3030
serverMode?: string;
3131
pdbName?: string;
32-
poolMin?: string;
33-
poolMax?: string;
34-
poolIncrement?: string;
32+
poolMin?: number;
33+
poolMax?: number;
34+
poolIncrement?: number;
3535
}
3636

3737
export interface OracleRequestHookInformation {

0 commit comments

Comments
 (0)