Skip to content

Commit e6818f6

Browse files
committed
Disable and enable instrumentation on create.
1 parent 76cefbb commit e6818f6

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

plugins/node/opentelemetry-instrumentation-pg/test/pg-pool.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,10 @@ describe('pg-pool', () => {
114114
function create(config: PgInstrumentationConfig = {}) {
115115
instrumentation.setConfig(config);
116116
instrumentation.enable();
117+
118+
// Disable and enable the instrumentation to visit unwrap calls
119+
instrumentation.disable();
120+
instrumentation.enable();
117121
}
118122

119123
let pool: pgPool<pg.Client>;

plugins/node/opentelemetry-instrumentation-pg/test/pg.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,10 @@ describe('pg', () => {
108108
function create(config: PgInstrumentationConfig = {}) {
109109
instrumentation.setConfig(config);
110110
instrumentation.enable();
111+
112+
// Disable and enable the instrumentation to visit unwrap calls
113+
instrumentation.disable();
114+
instrumentation.enable();
111115
}
112116

113117
let postgres: typeof pg;

0 commit comments

Comments
 (0)