Repository: serverless/dashboard (language: python)

Issue:
SDK Schema: Release v0.10.0



Discussion / hints:

Fix patch:
diff --git a/node/packages/aws-lambda-sdk/.ts-types/index.d.ts b/node/packages/aws-lambda-sdk/.ts-types/index.d.ts
index 179bfc411..d83c51fa4 100644
--- a/node/packages/aws-lambda-sdk/.ts-types/index.d.ts
+++ b/node/packages/aws-lambda-sdk/.ts-types/index.d.ts
@@ -1,14 +1,14 @@
 import TraceSpan from './lib/trace-span';
-import AwsSdkV2Instrument from './instrument/aws-sdk-v2';
-import AwsSdkV3ClientInstrument from './instrument/aws-sdk-v3-client';
-import ExpressAppInstrument from './instrument/express-app';
+import AwsSdkV2Instrument from './instrumentation/aws-sdk-v2';
+import AwsSdkV3ClientInstrument from './instrumentation/aws-sdk-v3-client';
+import ExpressAppInstrument from './instrumentation/express-app';
 
 interface TraceSpans {
   awsLambda: TraceSpan;
   awsLambdaInitialization: TraceSpan;
 }
 
-interface Instrument {
+interface Instrumentation {
   awsSdkV2: AwsSdkV2Instrument;
   awsSdkV3Client: AwsSdkV3ClientInstrument;
   expressApp: ExpressAppInstrument;
@@ -17,7 +17,7 @@ interface Instrument {
 interface Sdk {
   orgId: string;
   traceSpans: TraceSpans;
-  instrument: Instrument;
+  instrumentation: Instrumentation;
   createTraceSpan(
     name: string,
     options?: {
diff --git a/node/packages/aws-lambda-sdk/.ts-types/instrument.d.ts b/node/packages/aws-lambda-sdk/.ts-types/instrument/index.d.ts
similarity index 100%
rename from node/packages/aws-lambda-sdk/.ts-types/instrument.d.ts
rename to node/packages/aws-lambda-sdk/.ts-types/instrument/index.d.ts
diff --git a/node/packages/aws-lambda-sdk/.ts-types/instrument/aws-sdk-v2.d.ts b/node/packages/aws-lambda-sdk/.ts-types/instrumentation/aws-sdk-v2.d.ts
similarity index 100%
rename from node/packages/aws-lambda-sdk/.ts-types/instrument/aws-sdk-v2.d.ts
rename to node/packages/aws-lambda-sdk/.ts-types/instrumentation/aws-sdk-v2.d.ts
diff --git a/node/packages/aws-lambda-sdk/.ts-types/instrument/aws-sdk-v3-client.d.ts b/node/packages/aws-lambda-sdk/.ts-types/instrumentation/aws-sdk-v3-client.d.ts
similarity index 100%
rename from node/packages/aws-lambda-sdk/.ts-types/instrument/aws-sdk-v3-client.d.ts
rename to node/packages/aws-lambda-sdk/.ts-types/instrumentation/aws-sdk-v3-client.d.ts
diff --git a/node/packages/aws-lambda-sdk/.ts-types/instrument/express-app.d.ts b/node/packages/aws-lambda-sdk/.ts-types/instrumentation/express-app.d.ts
similarity index 100%
rename from node/packages/aws-lambda-sdk/.ts-types/instrument/express-app.d.ts
rename to node/packages/aws-lambda-sdk/.ts-types/instrumentation/express-app.d.ts
diff --git a/node/packages/aws-lambda-sdk/docs/monitoring.md b/node/packages/aws-lambda-sdk/docs/monitoring.md
index 8d9031f12..65a170c22 100644
--- a/node/packages/aws-lambda-sdk/docs/monitoring.md
+++ b/node/packages/aws-lambda-sdk/docs/monitoring.md
@@ -128,10 +128,8 @@ Handling of express route is covered in context of main `express` span. Addition
 - `express.middlewa.route.<method>.<name>` - route specific middleware (setup via `app.get`, `app.post` etc.)
 - `express.middleware.error.<name>` - error handling middleware
 
-#### `express` trace span tags:
+#### Tags introduced on `aws.lambda` span
 
-| Name                  | Value                                                  |
-| --------------------- | ------------------------------------------------------ |
-| `express.method`      | The HTTP method defined by the Express Route Handler.  |
-| `express.path`        | The HTTP Path defined by the Express Route Handler.    |
-| `express.status_code` | The status code returned by the Express Route Handler. |
+| Name                          | Value                 |
+| ----------------------------- | --------------------- |
+| `aws.lambda.http_router.path` | Middleware route path |
diff --git a/node/packages/aws-lambda-sdk/docs/sdk-trace.md b/node/packages/aws-lambda-sdk/docs/sdk-trace.md
index ff8e01f6b..ed32073e2 100644
--- a/node/packages/aws-lambda-sdk/docs/sdk-trace.md
+++ b/node/packages/aws-lambda-sdk/docs/sdk-trace.md
@@ -75,17 +75,18 @@ Tags collected if event is sourced by either:
 - AWS API Gateway v1 REST API endpoint configured with `AWS_PROXY` integration type.
 - AWS API Gateway v2 HTTP API endpoint configured with either v1 or v2 version of a payload
 
-| Name                                             | Value                                                                                 |
-| ------------------------------------------------ | ------------------------------------------------------------------------------------- |
-| `aws.lambda.event_source`                        | `"aws.apigateway"`                                                                    |
-| `aws.lambda.event_type`                          | `"aws.apigateway.rest"`, `"aws.apigatewayv2.http.v1"` or `"aws.apigatewayv2.http.v2"` |
-| `aws.lambda.api_gateway.account_id`              | Account id of API Gateway                                                             |
-| `aws.lambda.api_gateway.api_id`                  | API id                                                                                |
-| `aws.lambda.api_gateway.api_stage`               | API stage                                                                             |
-| `aws.lambda.api_gateway.request.id`              | API Gateway request id                                                                |
-| `aws.lambda.api_gateway.request.time_epoch`      | API Gateway request time                                                              |
-| `aws.lambda.api_gateway.request.headers`         | JSON string of request headers. Multi value headers are stored as arrays              |
-| `aws.lambda.api_gateway.request.path_parameters` | JSON string of request path parameters                                                |
+| Name                                             | Value                                                                                            |
+| ------------------------------------------------ | ------------------------------------------------------------------------------------------------ |
+| `aws.lambda.event_source`                        | `"aws.apigateway"`                                                                               |
+| `aws.lambda.event_type`                          | `"aws.apigateway.rest"`, `"aws.apigatewayv2.http.v1"` or `"aws.apigatewayv2.http.v2"`            |
+| `aws.lambda.api_gateway.account_id`              | Account id of API Gateway                                                                        |
+| `aws.lambda.api_gateway.api_id`                  | API id                                                                                           |
+| `aws.lambda.api_gateway.api_stage`               | API stage                                                                                        |
+| `aws.lambda.api_gateway.request.id`              | API Gateway request id                                                                           |
+| `aws.lambda.api_gateway.request.time_epoch`      | API Gateway request time                                                                         |
+| `aws.lambda.api_gateway.request.headers`         | JSON string of request headers. Multi value headers are stored as arrays                         |
+| `aws.lambda.api_gateway.request.path_parameters` | JSON string of request path parameters                                                           |
+| `aws.lambda.http_router.path`                    | Route path with unresolved param (potentally overriden by router framework as `express` if used) |
 
 ##### SQS queue message
 
diff --git a/node/packages/aws-lambda-sdk/index.js b/node/packages/aws-lambda-sdk/index.js
index eff1f6714..b9782b2b3 100644
--- a/node/packages/aws-lambda-sdk/index.js
+++ b/node/packages/aws-lambda-sdk/index.js
@@ -46,24 +46,24 @@ serverlessSdk._initialize = (options = {}) => {
 
   if (!settings.disableHttpMonitoring) {
     // Auto generate HTTP(S) request spans
-    require('./lib/instrument/http').install();
+    require('./lib/instrumentation/http').install();
   }
 
   if (!settings.disableAwsSdkMonitoring) {
     // Auto generate AWS SDK request spans
-    require('./lib/instrument/aws-sdk').install();
+    require('./lib/instrumentation/aws-sdk').install();
   }
 
   if (!settings.disableExpressMonitoring) {
     // Auto generate AWS SDK request spans
-    require('./lib/instrument/express').install();
+    require('./lib/instrumentation/express').install();
   }
 
   return serverlessSdk;
 };
 
-serverlessSdk.instrument = {
-  awsSdkV2: require('./instrument/aws-sdk-v2'),
-  awsSdkV3Client: require('./instrument/aws-sdk-v3-client'),
-  expressApp: require('./instrument/express-app'),
+serverlessSdk.instrumentation = {
+  awsSdkV2: require('./instrumentation/aws-sdk-v2'),
+  awsSdkV3Client: require('./instrumentation/aws-sdk-v3-client'),
+  expressApp: require('./instrumentation/express-app'),
 };
diff --git a/node/packages/aws-lambda-sdk/instrument/README.md b/node/packages/aws-lambda-sdk/instrument/README.md
new file mode 100644
index 000000000..560e6bb94
--- /dev/null
+++ b/node/packages/aws-lambda-sdk/instrument/README.md
@@ -0,0 +1,7 @@
+No local modules aside of main `serverlessSdk` object should be required in context of this directory
+
+When relying on `serverlessSdk`, require it as:
+
+```javascript
+const serverlessSdk = global.serverlessSdk || require('../../');
+```
diff --git a/node/packages/aws-lambda-sdk/instrument.js b/node/packages/aws-lambda-sdk/instrument/index.js
similarity index 98%
rename from node/packages/aws-lambda-sdk/instrument.js
rename to node/packages/aws-lambda-sdk/instrument/index.js
index ff85f7fd7..6e7e9e753 100644
--- a/node/packages/aws-lambda-sdk/instrument.js
+++ b/node/packages/aws-lambda-sdk/instrument/index.js
@@ -10,9 +10,9 @@ const traceProto = require('@serverless/sdk-schema/dist/trace');
 const requestResponseProto = require('@serverless/sdk-schema/dist/request_response');
 const resolveEventTags = require('./lib/resolve-event-tags');
 const resolveResponseTags = require('./lib/resolve-response-tags');
-const pkgJson = require('./package');
+const pkgJson = require('../package');
 
-const serverlessSdk = global.serverlessSdk || require('./');
+const serverlessSdk = global.serverlessSdk || require('../');
 
 const { traceSpans } = serverlessSdk;
 const { awsLambda: awsLambdaSpan, awsLambdaInitialization: awsLambdaInitializationSpan } =
diff --git a/node/packages/aws-lambda-sdk/lib/resolve-event-tags.js b/node/packages/aws-lambda-sdk/instrument/lib/resolve-event-tags.js
similarity index 94%
rename from node/packages/aws-lambda-sdk/lib/resolve-event-tags.js
rename to node/packages/aws-lambda-sdk/instrument/lib/resolve-event-tags.js
index 2e62e5714..20c0693c9 100644
--- a/node/packages/aws-lambda-sdk/lib/resolve-event-tags.js
+++ b/node/packages/aws-lambda-sdk/instrument/lib/resolve-event-tags.js
@@ -2,7 +2,7 @@
 
 const isObject = require('type/object/is');
 
-const awsLambdaSpan = (global.serverlessSdk || require('../')).traceSpans.awsLambda;
+const awsLambdaSpan = (global.serverlessSdk || require('../../')).traceSpans.awsLambda;
 
 const objHasOwnProperty = Object.prototype.hasOwnProperty;
 
@@ -191,6 +191,7 @@ module.exports = (event) => {
       },
       { prefix: 'aws.lambda.http' }
     );
+    awsLambdaSpan.tags.set('aws.lambda.http_router.path', requestContext.resourcePath);
     return;
   }
   if (doesObjectMatchMap(event, httpApiV2EventMap)) {
@@ -227,6 +228,12 @@ module.exports = (event) => {
       },
       { prefix: 'aws.lambda.http' }
     );
+    awsLambdaSpan.tags.set(
+      'aws.lambda.http_router.path',
+      event.routeKey === '$default'
+        ? '$default'
+        : event.routeKey.slice(event.routeKey.indexOf(' ') + 1)
+    );
     return;
   }
 
diff --git a/node/packages/aws-lambda-sdk/lib/resolve-response-tags.js b/node/packages/aws-lambda-sdk/instrument/lib/resolve-response-tags.js
similarity index 90%
rename from node/packages/aws-lambda-sdk/lib/resolve-response-tags.js
rename to node/packages/aws-lambda-sdk/instrument/lib/resolve-response-tags.js
index 91efc07f3..e4a485153 100644
--- a/node/packages/aws-lambda-sdk/lib/resolve-response-tags.js
+++ b/node/packages/aws-lambda-sdk/instrument/lib/resolve-response-tags.js
@@ -2,7 +2,7 @@
 
 const coerceNaturalNumber = require('type/natural-number/coerce');
 
-const awsLambdaSpan = (global.serverlessSdk || require('../')).traceSpans.awsLambda;
+const awsLambdaSpan = (global.serverlessSdk || require('../../')).traceSpans.awsLambda;
 
 module.exports = (response) => {
   switch (awsLambdaSpan.tags.get('aws.lambda.event_source')) {
diff --git a/node/packages/aws-lambda-sdk/instrument/aws-sdk-v2.js b/node/packages/aws-lambda-sdk/instrumentation/aws-sdk-v2.js
similarity index 94%
rename from node/packages/aws-lambda-sdk/instrument/aws-sdk-v2.js
rename to node/packages/aws-lambda-sdk/instrumentation/aws-sdk-v2.js
index 8438001f4..6cd9876cc 100644
--- a/node/packages/aws-lambda-sdk/instrument/aws-sdk-v2.js
+++ b/node/packages/aws-lambda-sdk/instrumentation/aws-sdk-v2.js
@@ -3,8 +3,8 @@
 const ensureObject = require('type/object/ensure');
 const ensureConstructor = require('type/constructor/ensure');
 const doNotInstrumentFollowingHttpRequest =
-  require('../lib/instrument/http').ignoreFollowingRequest;
-const serviceMapper = require('../lib/instrument/aws-sdk/service-mapper');
+  require('../lib/instrumentation/http').ignoreFollowingRequest;
+const serviceMapper = require('../lib/instrumentation/aws-sdk/service-mapper');
 
 const instrumentedSdks = new WeakMap();
 
diff --git a/node/packages/aws-lambda-sdk/instrument/aws-sdk-v3-client.js b/node/packages/aws-lambda-sdk/instrumentation/aws-sdk-v3-client.js
similarity index 95%
rename from node/packages/aws-lambda-sdk/instrument/aws-sdk-v3-client.js
rename to node/packages/aws-lambda-sdk/instrumentation/aws-sdk-v3-client.js
index cd8553287..219421767 100644
--- a/node/packages/aws-lambda-sdk/instrument/aws-sdk-v3-client.js
+++ b/node/packages/aws-lambda-sdk/instrumentation/aws-sdk-v3-client.js
@@ -2,11 +2,11 @@
 
 const ensureObject = require('type/object/ensure');
 const doNotInstrumentFollowingHttpRequest =
-  require('../lib/instrument/http').ignoreFollowingRequest;
+  require('../lib/instrumentation/http').ignoreFollowingRequest;
 
 const instrumentedClients = new WeakMap();
 
-const serviceMapper = require('../lib/instrument/aws-sdk/service-mapper');
+const serviceMapper = require('../lib/instrumentation/aws-sdk/service-mapper');
 
 module.exports.install = (client) => {
   ensureObject(client, { errorMessage: '%v is not an instance of AWS SDK v3 client' });
diff --git a/node/packages/aws-lambda-sdk/instrument/express-app.js b/node/packages/aws-lambda-sdk/instrumentation/express-app.js
similarity index 88%
rename from node/packages/aws-lambda-sdk/instrument/express-app.js
rename to node/packages/aws-lambda-sdk/instrumentation/express-app.js
index eba35496c..f93ac2102 100644
--- a/node/packages/aws-lambda-sdk/instrument/express-app.js
+++ b/node/packages/aws-lambda-sdk/instrumentation/express-app.js
@@ -2,7 +2,7 @@
 
 const ensureObject = require('type/object/ensure');
 const ensurePlainFunction = require('type/plain-function/ensure');
-const instrumentLayerPrototype = require('../lib/instrument/express/instrument-layer-prototype');
+const instrumentLayerPrototype = require('../lib/instrumentation/express/instrument-layer-prototype');
 
 const instrumentedApps = new WeakMap();
 
diff --git a/node/packages/aws-lambda-sdk/lib/instrument/aws-sdk/index.js b/node/packages/aws-lambda-sdk/lib/instrumentation/aws-sdk/index.js
similarity index 87%
rename from node/packages/aws-lambda-sdk/lib/instrument/aws-sdk/index.js
rename to node/packages/aws-lambda-sdk/lib/instrumentation/aws-sdk/index.js
index 2bc964c83..02dc199d2 100644
--- a/node/packages/aws-lambda-sdk/lib/instrument/aws-sdk/index.js
+++ b/node/packages/aws-lambda-sdk/lib/instrumentation/aws-sdk/index.js
@@ -1,8 +1,8 @@
 'use strict';
 
 const cjsHook = require('../utils/cjs-hook');
-const instrumentV2Sdk = require('../../../instrument/aws-sdk-v2').install;
-const instrumentV3Client = require('../../../instrument/aws-sdk-v3-client').install;
+const instrumentV2Sdk = require('../../../instrumentation/aws-sdk-v2').install;
+const instrumentV3Client = require('../../../instrumentation/aws-sdk-v3-client').install;
 
 const instrumentedv3SmithyClients = new WeakMap();
 
diff --git a/node/packages/aws-lambda-sdk/lib/instrument/aws-sdk/service-mapper.js b/node/packages/aws-lambda-sdk/lib/instrumentation/aws-sdk/service-mapper.js
similarity index 100%
rename from node/packages/aws-lambda-sdk/lib/instrument/aws-sdk/service-mapper.js
rename to node/packages/aws-lambda-sdk/lib/instrumentation/aws-sdk/service-mapper.js
diff --git a/node/packages/aws-lambda-sdk/lib/instrument/express/index.js b/node/packages/aws-lambda-sdk/lib/instrumentation/express/index.js
similarity index 100%
rename from node/packages/aws-lambda-sdk/lib/instrument/express/index.js
rename to node/packages/aws-lambda-sdk/lib/instrumentation/express/index.js
diff --git a/node/packages/aws-lambda-sdk/lib/instrument/express/instrument-layer-prototype.js b/node/packages/aws-lambda-sdk/lib/instrumentation/express/instrument-layer-prototype.js
similarity index 91%
rename from node/packages/aws-lambda-sdk/lib/instrument/express/instrument-layer-prototype.js
rename to node/packages/aws-lambda-sdk/lib/instrumentation/express/instrument-layer-prototype.js
index 1824056a4..1b71c5e42 100644
--- a/node/packages/aws-lambda-sdk/lib/instrument/express/instrument-layer-prototype.js
+++ b/node/packages/aws-lambda-sdk/lib/instrumentation/express/instrument-layer-prototype.js
@@ -23,14 +23,11 @@ module.exports.install = (layerPrototype) => {
       expressSpansMap.set(req, expressRouteData);
       res.on('finish', () => {
         const endTime = process.hrtime.bigint();
-        expressSpan.tags.setMany(
-          {
-            status_code: res.statusCode,
-            method: expressRouteData.method?.toUpperCase(),
-            path: expressRouteData.route?.path,
-          },
-          { prefix: 'express' }
-        );
+        if (expressRouteData.route?.path) {
+          // Override eventual API Gateway's `resourcePath`
+          awsLambdaSpan.tags.delete('aws.lambda.http_router.path');
+          awsLambdaSpan.tags.set('aws.lambda.http_router.path', expressRouteData.route.path);
+        }
         for (const subSpan of openedSpans) {
           if (!subSpan.endTime) subSpan.close({ endTime });
         }
@@ -106,3 +103,5 @@ module.exports.uninstall = (layerPrototype) => {
 };
 
 const serverlessSdk = global.serverlessSdk || require('../../../');
+
+const awsLambdaSpan = serverlessSdk.traceSpans.awsLambda;
diff --git a/node/packages/aws-lambda-sdk/lib/instrument/http.js b/node/packages/aws-lambda-sdk/lib/instrumentation/http.js
similarity index 100%
rename from node/packages/aws-lambda-sdk/lib/instrument/http.js
rename to node/packages/aws-lambda-sdk/lib/instrumentation/http.js
diff --git a/node/packages/aws-lambda-sdk/lib/instrument/utils/cjs-hook.js b/node/packages/aws-lambda-sdk/lib/instrumentation/utils/cjs-hook.js
similarity index 100%
rename from node/packages/aws-lambda-sdk/lib/instrument/utils/cjs-hook.js
rename to node/packages/aws-lambda-sdk/lib/instrumentation/utils/cjs-hook.js
diff --git a/node/packages/aws-lambda-sdk/package.json b/node/packages/aws-lambda-sdk/package.json
index 6836b2183..f56f1e80c 100644
--- a/node/packages/aws-lambda-sdk/package.json
+++ b/node/packages/aws-lambda-sdk/package.json
@@ -4,7 +4,7 @@
   "version": "0.6.0",
   "author": "Serverless, Inc.",
   "dependencies": {
-    "@serverless/sdk-schema": "^0.9.0",
+    "@serverless/sdk-schema": "^0.10.0",
     "d": "^1.0.1",
     "ext": "^1.7.0",
     "long": "^5.2.0",


Test patch:
diff --git a/node/packages/aws-lambda-sdk/test/integration/index.test.js b/node/packages/aws-lambda-sdk/test/integration/index.test.js
index dee02afc3..a1be7922a 100644
--- a/node/packages/aws-lambda-sdk/test/integration/index.test.js
+++ b/node/packages/aws-lambda-sdk/test/integration/index.test.js
@@ -612,6 +612,8 @@ describe('integration', function () {
 
                   expect(tags.aws.lambda.http.statusCode.toString()).to.equal('200');
 
+                  expect(tags.aws.lambda.httpRouter.path).to.equal('/some-path/{param}');
+
                   expect(JSON.parse(request.data.requestData)).to.have.property('httpMethod');
                   expect(response.data.responseData).to.equal(
                     JSON.stringify({ statusCode: 200, body: '"ok"' })
@@ -668,6 +670,8 @@ describe('integration', function () {
 
                   expect(tags.aws.lambda.http.statusCode.toString()).to.equal('200');
 
+                  expect(tags.aws.lambda.httpRouter.path).to.equal('/test');
+
                   expect(JSON.parse(request.data.requestData)).to.have.property('httpMethod');
                   expect(response.data.responseData).to.equal(
                     JSON.stringify({ statusCode: 200, body: '"ok"' })
@@ -724,6 +728,8 @@ describe('integration', function () {
 
                   expect(tags.aws.lambda.http.statusCode.toString()).to.equal('200');
 
+                  expect(tags.aws.lambda.httpRouter.path).to.equal('/test');
+
                   expect(JSON.parse(request.data.requestData)).to.have.property('rawPath');
                   expect(response.data.responseData).to.equal(
                     JSON.stringify({ statusCode: 200, body: '"ok"' })
@@ -968,6 +974,8 @@ describe('integration', function () {
 
             expect(lambdaTags.aws.lambda.http.statusCode.toString()).to.equal('200');
 
+            expect(lambdaTags.aws.lambda.httpRouter.path.toString()).to.equal('/test');
+
             expect(JSON.parse(request.data.requestData)).to.have.property('rawPath');
             expect(JSON.parse(response.data.responseData).body).to.deep.equal(JSON.stringify('ok'));
 
@@ -976,11 +984,6 @@ describe('integration', function () {
             const routerSpan = middlewareSpans[middlewareSpans.length - 1];
 
             expect(expressSpan.parentSpanId).to.deep.equal(invocationSpan.id);
-            const expressTags = expressSpan.tags;
-
-            expect(expressTags.express.method).to.equal('POST');
-            expect(expressTags.express.path).to.equal('/test');
-            expect(expressTags.express.statusCode).to.equal(200);
 
             expect(middlewareSpans.map(({ name }) => name)).to.deep.equal([
               'express.middleware.query',
@@ -1012,7 +1015,7 @@ describe('integration', function () {
                 trace: { spans },
               },
             ] of invocationsData.entries()) {
-              spans.shift();
+              const lambdaSpan = spans.shift();
               if (!index) spans.shift();
 
               const [invocationSpan, expressSpan, ...otherSpans] = spans;
@@ -1023,11 +1026,8 @@ describe('integration', function () {
               const outerRequestSpan = otherSpans[otherSpans.length - 1];
 
               expect(expressSpan.parentSpanId).to.deep.equal(invocationSpan.id);
-              const expressTags = expressSpan.tags;
 
-              expect(expressTags.express.method).to.equal('GET');
-              expect(expressTags.express.path).to.equal('/foo');
-              expect(expressTags.express.statusCode).to.equal(200);
+              expect(lambdaSpan.tags.aws.lambda.httpRouter.path).to.equal('/foo');
 
               expect(middlewareSpans.map(({ name }) => name)).to.deep.equal([
                 'express.middleware.query',
diff --git a/node/packages/aws-lambda-sdk/test/unit/internal-extension/index.test.js b/node/packages/aws-lambda-sdk/test/unit/internal-extension/index.test.js
index 2a48ecb96..2fe37232a 100644
--- a/node/packages/aws-lambda-sdk/test/unit/internal-extension/index.test.js
+++ b/node/packages/aws-lambda-sdk/test/unit/internal-extension/index.test.js
@@ -44,9 +44,9 @@ const handleInvocation = async (handlerModuleName, options = {}) => {
     } catch (invocationError) {
       error = invocationError;
     }
-    require('../../../lib/instrument/http').uninstall();
-    require('../../../lib/instrument/aws-sdk').uninstall();
-    require('../../../lib/instrument/express').uninstall();
+    require('../../../lib/instrumentation/http').uninstall();
+    require('../../../lib/instrumentation/aws-sdk').uninstall();
+    require('../../../lib/instrumentation/express').uninstall();
     const serverlessSdk = require('../../../');
     const { TracePayload } = require('@serverless/sdk-schema/dist/trace');
     const { RequestResponse } = require('@serverless/sdk-schema/dist/request_response');
@@ -233,6 +233,8 @@ describe('internal-extension/index.test.js', () => {
 
     expect(tags.aws.lambda.http.statusCode.toString()).to.equal('200');
 
+    expect(tags.aws.lambda.httpRouter.path).to.equal('/some-path/{param}');
+
     expect(response.data.responseData).to.deep.equal(
       JSON.stringify({ statusCode: 200, body: '"ok"' })
     );
@@ -334,6 +336,8 @@ describe('internal-extension/index.test.js', () => {
 
     expect(tags.aws.lambda.http.statusCode.toString()).to.equal('200');
 
+    expect(tags.aws.lambda.httpRouter.path).to.equal('/v1');
+
     expect(response.data.responseData).to.deep.equal(
       JSON.stringify({ statusCode: 200, body: '"ok"' })
     );
@@ -410,6 +414,8 @@ describe('internal-extension/index.test.js', () => {
 
     expect(tags.aws.lambda.http.statusCode.toString()).to.equal('200');
 
+    expect(tags.aws.lambda.httpRouter.path).to.equal('/v2');
+
     expect(response.data.responseData).to.deep.equal(
       JSON.stringify({ statusCode: 200, body: '"ok"' })
     );
@@ -645,16 +651,13 @@ describe('internal-extension/index.test.js', () => {
 
     expect(lambdaTags.aws.lambda.http.statusCode.toString()).to.equal('200');
 
+    expect(lambdaTags.aws.lambda.httpRouter.path).to.equal('/foo');
+
     expect(JSON.parse(response.data.responseData).body).to.deep.equal(JSON.stringify('ok'));
 
     expect(expressSpan.name).to.equal('express');
     expect(expressSpan.parentSpanId).to.deep.equal(invocationSpan.id);
 
-    const expressTags = expressSpan.tags;
-    expect(expressTags.express.method).to.equal('GET');
-    expect(expressTags.express.path).to.equal('/foo');
-    expect(expressTags.express.statusCode).to.equal(200);
-
     expect(middlewareSpans.map(({ name }) => name)).to.deep.equal([
       'express.middleware.query',
       'express.middleware.expressinit',
@@ -675,21 +678,18 @@ describe('internal-extension/index.test.js', () => {
       },
     } = await handleInvocation('multi-async');
 
-    const [, , invocationSpan, expressSpan, ...otherSpans] = spans;
+    const [lambdaSpan, , invocationSpan, expressSpan, ...otherSpans] = spans;
     const middlewareSpans = otherSpans.slice(0, -2);
     const routeSpan = middlewareSpans.pop();
     const routerSpan = middlewareSpans[middlewareSpans.length - 1];
     const expressRequestSpan = otherSpans[otherSpans.length - 2];
     const outerRequestSpan = otherSpans[otherSpans.length - 1];
 
+    expect(lambdaSpan.tags.aws.lambda.httpRouter.path).to.equal('/foo');
+
     expect(expressSpan.name).to.equal('express');
     expect(expressSpan.parentSpanId).to.deep.equal(invocationSpan.id);
 
-    const expressTags = expressSpan.tags;
-    expect(expressTags.express.method).to.equal('GET');
-    expect(expressTags.express.path).to.equal('/foo');
-    expect(expressTags.express.statusCode).to.equal(200);
-
     expect(middlewareSpans.map(({ name }) => name)).to.deep.equal([
       'express.middleware.query',
       'express.middleware.expressinit',