From 6b4b0f349d2693652f160e3db6b0370dc625683b Mon Sep 17 00:00:00 2001 From: William Armiros Date: Tue, 14 Sep 2021 23:11:12 -0700 Subject: [PATCH 1/5] fix: attempt upgrade to v0.25.0 for lambda instrumentation --- lerna.json | 7 +------ .../README.md | 2 +- .../package.json | 12 ++++++------ .../src/instrumentation.ts | 2 +- .../test/integrations/lambda-handler.test.ts | 4 ++-- 5 files changed, 11 insertions(+), 16 deletions(-) diff --git a/lerna.json b/lerna.json index 133f43f099..193a35ed35 100644 --- a/lerna.json +++ b/lerna.json @@ -2,12 +2,7 @@ "lerna": "3.13.4", "npmClient": "npm", "packages": [ - "packages/*", - "metapackages/*", - "plugins/node/*", - "plugins/web/*", - "propagators/*", - "detectors/node/*" + "plugins/node/opentelemetry-instrumentation-aws-lambda" ], "version": "0.25.0", "changelog": { diff --git a/plugins/node/opentelemetry-instrumentation-aws-lambda/README.md b/plugins/node/opentelemetry-instrumentation-aws-lambda/README.md index dbd9540588..fb42e93cef 100644 --- a/plugins/node/opentelemetry-instrumentation-aws-lambda/README.md +++ b/plugins/node/opentelemetry-instrumentation-aws-lambda/README.md @@ -22,7 +22,7 @@ npm install --save @opentelemetry/instrumentation-aws-lambda Create a file to initialize the instrumentation, such as `lambda-wrapper.js`. ```js -const { NodeTracerProvider } = require('@opentelemetry/node'); +const { NodeTracerProvider } = require('@opentelemetry/sdk-trace-node'); const { AwsLambdaInstrumentation } = require('@opentelemetry/instrumentation-aws-lambda'); const { registerInstrumentations } = require('@opentelemetry/instrumentation'); diff --git a/plugins/node/opentelemetry-instrumentation-aws-lambda/package.json b/plugins/node/opentelemetry-instrumentation-aws-lambda/package.json index e489a59d1f..797c8ce378 100644 --- a/plugins/node/opentelemetry-instrumentation-aws-lambda/package.json +++ b/plugins/node/opentelemetry-instrumentation-aws-lambda/package.json @@ -46,8 +46,8 @@ }, "devDependencies": { "@opentelemetry/api": "1.0.2", - "@opentelemetry/core": "0.24.0", - "@opentelemetry/node": "0.24.0", + "@opentelemetry/core": "0.25.0", + "@opentelemetry/sdk-trace-node": "0.25.0", "@types/mocha": "7.0.2", "@types/node": "14.17.9", "codecov": "3.8.3", @@ -59,11 +59,11 @@ "typescript": "4.3.5" }, "dependencies": { - "@opentelemetry/instrumentation": "^0.24.0", - "@opentelemetry/propagator-aws-xray": "^0.25.0", - "@opentelemetry/resources": "^0.24.0", + "@opentelemetry/instrumentation": "^0.25.0", + "@opentelemetry/propagator-aws-xray": "^0.24.0", + "@opentelemetry/resources": "^0.25.0", "@opentelemetry/semantic-conventions": "^0.24.0", - "@opentelemetry/tracing": "^0.24.0", + "@opentelemetry/sdk-trace-base": "^0.25.0", "@types/aws-lambda": "8.10.81" } } diff --git a/plugins/node/opentelemetry-instrumentation-aws-lambda/src/instrumentation.ts b/plugins/node/opentelemetry-instrumentation-aws-lambda/src/instrumentation.ts index c4e41490d1..8309a761d7 100644 --- a/plugins/node/opentelemetry-instrumentation-aws-lambda/src/instrumentation.ts +++ b/plugins/node/opentelemetry-instrumentation-aws-lambda/src/instrumentation.ts @@ -44,7 +44,7 @@ import { SemanticAttributes, SemanticResourceAttributes, } from '@opentelemetry/semantic-conventions'; -import { BasicTracerProvider } from '@opentelemetry/tracing'; +import { BasicTracerProvider } from '@opentelemetry/sdk-trace-base'; import { APIGatewayProxyEventHeaders, diff --git a/plugins/node/opentelemetry-instrumentation-aws-lambda/test/integrations/lambda-handler.test.ts b/plugins/node/opentelemetry-instrumentation-aws-lambda/test/integrations/lambda-handler.test.ts index a41be9b50f..f61052426b 100644 --- a/plugins/node/opentelemetry-instrumentation-aws-lambda/test/integrations/lambda-handler.test.ts +++ b/plugins/node/opentelemetry-instrumentation-aws-lambda/test/integrations/lambda-handler.test.ts @@ -28,8 +28,8 @@ import { BatchSpanProcessor, InMemorySpanExporter, ReadableSpan, -} from '@opentelemetry/tracing'; -import { NodeTracerProvider } from '@opentelemetry/node'; +} from '@opentelemetry/sdk-trace-base'; +import { NodeTracerProvider } from '@opentelemetry/sdk-trace-node'; import { Context } from 'aws-lambda'; import * as assert from 'assert'; import { From b6c9248cbda17ffef25ba40c4ae15a12ff49cf85 Mon Sep 17 00:00:00 2001 From: William Armiros Date: Tue, 14 Sep 2021 23:13:08 -0700 Subject: [PATCH 2/5] fix lerna.json --- lerna.json | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lerna.json b/lerna.json index 193a35ed35..133f43f099 100644 --- a/lerna.json +++ b/lerna.json @@ -2,7 +2,12 @@ "lerna": "3.13.4", "npmClient": "npm", "packages": [ - "plugins/node/opentelemetry-instrumentation-aws-lambda" + "packages/*", + "metapackages/*", + "plugins/node/*", + "plugins/web/*", + "propagators/*", + "detectors/node/*" ], "version": "0.25.0", "changelog": { From 376ca6740d2cf4bfea2d5b4327479397075c6e1b Mon Sep 17 00:00:00 2001 From: William Armiros Date: Tue, 21 Sep 2021 14:22:33 -0700 Subject: [PATCH 3/5] fixed force-flush tests --- .../test/integrations/lambda-handler.force-flush.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/node/opentelemetry-instrumentation-aws-lambda/test/integrations/lambda-handler.force-flush.test.ts b/plugins/node/opentelemetry-instrumentation-aws-lambda/test/integrations/lambda-handler.force-flush.test.ts index eba072b9b1..0dc32c63be 100644 --- a/plugins/node/opentelemetry-instrumentation-aws-lambda/test/integrations/lambda-handler.force-flush.test.ts +++ b/plugins/node/opentelemetry-instrumentation-aws-lambda/test/integrations/lambda-handler.force-flush.test.ts @@ -23,8 +23,8 @@ import { AwsLambdaInstrumentation } from '../../src'; import { BatchSpanProcessor, InMemorySpanExporter, -} from '@opentelemetry/tracing'; -import { NodeTracerProvider } from '@opentelemetry/node'; +} from '@opentelemetry/sdk-trace-base'; +import { NodeTracerProvider } from '@opentelemetry/sdk-trace-node'; import { Context } from 'aws-lambda'; import * as assert from 'assert'; import { ProxyTracerProvider, TracerProvider } from '@opentelemetry/api'; From 7da8be8e48c1380099adf5d2e2a80f44682fb89f Mon Sep 17 00:00:00 2001 From: William Armiros Date: Tue, 21 Sep 2021 14:56:17 -0700 Subject: [PATCH 4/5] fix: re-added sdk-trace-base --- .../node/opentelemetry-instrumentation-aws-lambda/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/node/opentelemetry-instrumentation-aws-lambda/package.json b/plugins/node/opentelemetry-instrumentation-aws-lambda/package.json index 19a5771643..3815f54950 100644 --- a/plugins/node/opentelemetry-instrumentation-aws-lambda/package.json +++ b/plugins/node/opentelemetry-instrumentation-aws-lambda/package.json @@ -62,6 +62,7 @@ "dependencies": { "@opentelemetry/instrumentation": "^0.25.0", "@opentelemetry/propagator-aws-xray": "^0.24.0", + "@opentelemetry/sdk-trace-base": "^0.25.0", "@opentelemetry/resources": "^0.25.0", "@opentelemetry/semantic-conventions": "^0.24.0", "@types/aws-lambda": "8.10.81" From 9fb777ea80cb6d10cc58288786b8a7baa8772846 Mon Sep 17 00:00:00 2001 From: William Armiros Date: Tue, 21 Sep 2021 14:58:50 -0700 Subject: [PATCH 5/5] moved to devdeps --- .../node/opentelemetry-instrumentation-aws-lambda/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/node/opentelemetry-instrumentation-aws-lambda/package.json b/plugins/node/opentelemetry-instrumentation-aws-lambda/package.json index 3815f54950..688b16b84f 100644 --- a/plugins/node/opentelemetry-instrumentation-aws-lambda/package.json +++ b/plugins/node/opentelemetry-instrumentation-aws-lambda/package.json @@ -48,6 +48,7 @@ "devDependencies": { "@opentelemetry/api": "1.0.2", "@opentelemetry/core": "0.25.0", + "@opentelemetry/sdk-trace-base": "^0.25.0", "@opentelemetry/sdk-trace-node": "0.25.0", "@types/mocha": "7.0.2", "@types/node": "14.17.9", @@ -62,7 +63,6 @@ "dependencies": { "@opentelemetry/instrumentation": "^0.25.0", "@opentelemetry/propagator-aws-xray": "^0.24.0", - "@opentelemetry/sdk-trace-base": "^0.25.0", "@opentelemetry/resources": "^0.25.0", "@opentelemetry/semantic-conventions": "^0.24.0", "@types/aws-lambda": "8.10.81"