diff --git a/plugins/node/opentelemetry-instrumentation-pg/src/instrumentation.ts b/plugins/node/opentelemetry-instrumentation-pg/src/instrumentation.ts index f0f68c86b1..42de6e28b2 100644 --- a/plugins/node/opentelemetry-instrumentation-pg/src/instrumentation.ts +++ b/plugins/node/opentelemetry-instrumentation-pg/src/instrumentation.ts @@ -297,16 +297,18 @@ export class PgInstrumentation extends InstrumentationBase { const [span] = memoryExporter.getFinishedSpans(); assert.ok(span); - const commentedQuery = addSqlCommenterComment( - trace.wrapSpanContext(span.spanContext()), - query - ); - const executedQueries = getExecutedQueries(); assert.equal(executedQueries.length, 1); assert.equal(executedQueries[0].text, query); - assert.notEqual(query, commentedQuery); } catch (e: any) { assert.ok(false, e.message); } @@ -875,15 +869,11 @@ describe('pg', () => { assert.ok(res); const [span] = memoryExporter.getFinishedSpans(); - const commentedQuery = addSqlCommenterComment( - trace.wrapSpanContext(span.spanContext()), - query - ); + assert.ok(span); const executedQueries = getExecutedQueries(); assert.equal(executedQueries.length, 1); assert.equal(executedQueries[0].text, query); - assert.notEqual(query, commentedQuery); done(); }, } as pg.QueryConfig); @@ -964,15 +954,11 @@ describe('pg', () => { assert.ok(resPromise); const [span] = memoryExporter.getFinishedSpans(); - const commentedQuery = addSqlCommenterComment( - trace.wrapSpanContext(span.spanContext()), - query - ); + assert.ok(span); const executedQueries = getExecutedQueries(); assert.equal(executedQueries.length, 1); assert.equal(executedQueries[0].text, query); - assert.notEqual(query, commentedQuery); } catch (e: any) { assert.ok(false, e.message); }