From 8d6662feb77bff5bf85a31418b91903c4ea9dde5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Th=C3=A9riault?= Date: Fri, 10 Jan 2025 14:44:34 -0500 Subject: [PATCH] feat(instrumentation-express): propagate context and measure full handler spans --- .../src/instrumentation.ts | 16 +++++++++++----- .../test/express.test.ts | 4 ++-- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/plugins/node/opentelemetry-instrumentation-express/src/instrumentation.ts b/plugins/node/opentelemetry-instrumentation-express/src/instrumentation.ts index 2e283158b8..2c64ef79f8 100644 --- a/plugins/node/opentelemetry-instrumentation-express/src/instrumentation.ts +++ b/plugins/node/opentelemetry-instrumentation-express/src/instrumentation.ts @@ -215,6 +215,9 @@ export class ExpressInstrumentation extends InstrumentationBase { @@ -278,12 +284,12 @@ export class ExpressInstrumentation extends InstrumentationBase { ); assert.strictEqual(response, 'tata'); rootSpan.end(); - assert.strictEqual(finishListenerCount, 2); + assert.strictEqual(finishListenerCount, 3); assert.notStrictEqual( memoryExporter .getFinishedSpans() @@ -201,7 +201,7 @@ describe('ExpressInstrumentation', () => { ); assert.strictEqual(response, 'tata'); rootSpan.end(); - assert.strictEqual(finishListenerCount, 2); + assert.strictEqual(finishListenerCount, 3); assert.notStrictEqual( memoryExporter .getFinishedSpans()