Skip to content

Commit c299caa

Browse files
committed
- Make the new types TitleCase aligning to rest of the code
1 parent 90db232 commit c299caa

File tree

3 files changed

+24
-21
lines changed

3 files changed

+24
-21
lines changed

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,27 +18,27 @@
1818

1919
import * as oracledbTypes from 'oracledb';
2020
import type * as api from '@opentelemetry/api';
21-
import { spanConnectionConfig } from './types';
21+
import { SpanConnectionConfig } from './types';
2222

2323
// Captures the context associated with onEnterFn, onExitFn hooks.
24-
export interface instrumentationContext {
24+
export interface InstrumentationContext {
2525
span: api.Span;
2626
}
2727

2828
// Captures the entire span data
29-
export interface traceSpanData {
29+
export interface TraceSpanData {
3030
operation: string;
3131
error?: oracledbTypes.DBError;
32-
connectLevelConfig?: spanConnectionConfig;
33-
callLevelConfig?: spanCallLevelConfig;
32+
connectLevelConfig?: SpanConnectionConfig;
33+
callLevelConfig?: SpanCallLevelConfig;
3434
additionalConfig?: any;
3535
fn: Function;
3636
args?: any[];
37-
userContext: instrumentationContext;
37+
userContext: InstrumentationContext;
3838
}
3939

4040
// Captures call level related span data
41-
export interface spanCallLevelConfig {
41+
export interface SpanCallLevelConfig {
4242
statement?: string;
4343
operation?: string;
4444
values?: any[];

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import type * as api from '@opentelemetry/api';
1919
import { InstrumentationConfig } from '@opentelemetry/instrumentation';
2020

2121
// Captures connection related span data
22-
export interface spanConnectionConfig {
22+
export interface SpanConnectionConfig {
2323
serviceName?: string;
2424
connectString?: string;
2525
hostName?: string;
@@ -36,7 +36,7 @@ export interface spanConnectionConfig {
3636

3737
export interface OracleRequestHookInformation {
3838
inputArgs: any;
39-
connection: spanConnectionConfig | undefined;
39+
connection: SpanConnectionConfig | undefined;
4040
}
4141

4242
export interface OracleInstrumentationExecutionRequestHook {
@@ -55,12 +55,15 @@ export interface OracleInstrumentationConfig extends InstrumentationConfig {
5555
/**
5656
* If true, an attribute containing the execute method
5757
* bind values will be attached the spans generated.
58+
*
59+
* @default false
5860
*/
5961
enhancedDatabaseReporting?: boolean;
6062

6163
/**
6264
* If true, db.statement will have sql in the spans generated.
63-
* default value is false/undefined.
65+
*
66+
* @default false
6467
*/
6568
dbStatementDump?: boolean;
6669

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

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ import {
3939
DBSYSTEMVALUES_ORACLE,
4040
} from '@opentelemetry/semantic-conventions';
4141
import * as oracledbTypes from 'oracledb';
42-
import { OracleInstrumentationConfig, spanConnectionConfig } from './types';
43-
import { traceSpanData, spanCallLevelConfig } from './internal-types';
42+
import { OracleInstrumentationConfig, SpanConnectionConfig } from './types';
43+
import { TraceSpanData, SpanCallLevelConfig } from './internal-types';
4444
import { SpanNames } from './constants';
4545

4646
const newmoduleExports: any = oracledbTypes;
@@ -72,7 +72,7 @@ export class OracleTelemetryTraceHandler extends newmoduleExports.traceHandler
7272

7373
// Returns the connection related Attributes for
7474
// semantic standards and module custom keys.
75-
private _getConnectionSpanAttributes(config: spanConnectionConfig) {
75+
private _getConnectionSpanAttributes(config: SpanConnectionConfig) {
7676
return {
7777
[SEMATTRS_DB_SYSTEM]: DBSYSTEMVALUES_ORACLE,
7878
[SEMATTRS_NET_TRANSPORT]: config.protocol,
@@ -124,7 +124,7 @@ export class OracleTelemetryTraceHandler extends newmoduleExports.traceHandler
124124
// internal roundtrip spans generated for oracledb exported functions.
125125
private _setCallLevelAttributes(
126126
span: Span,
127-
callConfig?: spanCallLevelConfig,
127+
callConfig?: SpanCallLevelConfig,
128128
roundTrip = false
129129
) {
130130
if (!callConfig) return;
@@ -150,7 +150,7 @@ export class OracleTelemetryTraceHandler extends newmoduleExports.traceHandler
150150
}
151151
}
152152

153-
private _handleExecuteCustomRequest(span: Span, traceContext: traceSpanData) {
153+
private _handleExecuteCustomRequest(span: Span, traceContext: TraceSpanData) {
154154
if (typeof this._instrumentConfig.requestHook === 'function') {
155155
safeExecuteInTheMiddle(
156156
() => {
@@ -169,7 +169,7 @@ export class OracleTelemetryTraceHandler extends newmoduleExports.traceHandler
169169
}
170170
}
171171

172-
private _handleExecuteCustomResult(span: Span, traceContext: traceSpanData) {
172+
private _handleExecuteCustomResult(span: Span, traceContext: TraceSpanData) {
173173
if (typeof this._instrumentConfig.responseHook === 'function') {
174174
safeExecuteInTheMiddle(
175175
() => {
@@ -192,7 +192,7 @@ export class OracleTelemetryTraceHandler extends newmoduleExports.traceHandler
192192
// roundTrip flag will skip dumping bind values for
193193
// internal roundtrip spans generated for exported functions.
194194
private _updateFinalSpanAttributes(
195-
traceContext: traceSpanData,
195+
traceContext: TraceSpanData,
196196
roundTrip = false
197197
) {
198198
const span = traceContext.userContext.span;
@@ -230,7 +230,7 @@ export class OracleTelemetryTraceHandler extends newmoduleExports.traceHandler
230230

231231
// This method is invoked before calling an exported function
232232
// from oracledb module.
233-
onEnterFn(traceContext: traceSpanData) {
233+
onEnterFn(traceContext: TraceSpanData) {
234234
if (this._shouldSkipInstrumentation()) {
235235
return;
236236
}
@@ -272,7 +272,7 @@ export class OracleTelemetryTraceHandler extends newmoduleExports.traceHandler
272272

273273
// This method is invoked after exported function from oracledb module
274274
// completes.
275-
onExitFn(traceContext: traceSpanData) {
275+
onExitFn(traceContext: TraceSpanData) {
276276
if (
277277
this._shouldSkipInstrumentation() ||
278278
!traceContext.userContext ||
@@ -296,7 +296,7 @@ export class OracleTelemetryTraceHandler extends newmoduleExports.traceHandler
296296

297297
// This method is invoked before a round trip call to DB is done
298298
// from the oracledb module as part of sql execution.
299-
onBeginRoundTrip(traceContext: traceSpanData) {
299+
onBeginRoundTrip(traceContext: TraceSpanData) {
300300
if (this._shouldSkipInstrumentation()) {
301301
return;
302302
}
@@ -312,7 +312,7 @@ export class OracleTelemetryTraceHandler extends newmoduleExports.traceHandler
312312

313313
// This method is invoked after a round trip call to DB is done
314314
// from the oracledb module as part of sql execution.
315-
onEndRoundTrip(traceContext: traceSpanData) {
315+
onEndRoundTrip(traceContext: TraceSpanData) {
316316
if (
317317
this._shouldSkipInstrumentation() ||
318318
!traceContext.userContext ||

0 commit comments

Comments
 (0)