diff --git a/currencies.json b/currencies.json index e8c2e5ea4a..430c9ee119 100644 --- a/currencies.json +++ b/currencies.json @@ -73,7 +73,7 @@ "core": false, "versions": [ { - "v": "3.1045.0" + "v": "3.1046.0" } ] }, @@ -89,7 +89,7 @@ "core": false, "versions": [ { - "v": "3.1045.0" + "v": "3.1046.0" } ] }, @@ -105,7 +105,7 @@ "core": false, "versions": [ { - "v": "3.1045.0" + "v": "3.1046.0" } ] }, @@ -121,7 +121,7 @@ "core": false, "versions": [ { - "v": "3.1045.0" + "v": "3.1046.0" } ] }, @@ -137,7 +137,7 @@ "core": false, "versions": [ { - "v": "3.1045.0" + "v": "3.1046.0" } ] }, @@ -153,7 +153,7 @@ "core": false, "versions": [ { - "v": "3.1045.0" + "v": "3.1046.0" } ] }, @@ -169,7 +169,7 @@ "core": false, "versions": [ { - "v": "3.1045.0" + "v": "3.1046.0" } ] }, @@ -185,7 +185,7 @@ "core": false, "versions": [ { - "v": "3.1045.0" + "v": "3.1046.0" } ] }, @@ -201,7 +201,7 @@ "core": false, "versions": [ { - "v": "3.1045.0" + "v": "3.1046.0" } ] }, @@ -800,7 +800,7 @@ "core": false, "versions": [ { - "v": "12.5.2" + "v": "12.5.3" }, { "v": "10.0.4" @@ -1331,4 +1331,4 @@ } ] } -] +] \ No newline at end of file diff --git a/packages/core/src/tracing/instrumentation/cloud/aws-sdk/v3/index.js b/packages/core/src/tracing/instrumentation/cloud/aws-sdk/v3/index.js index 2e6dcd8590..b97277897e 100644 --- a/packages/core/src/tracing/instrumentation/cloud/aws-sdk/v3/index.js +++ b/packages/core/src/tracing/instrumentation/cloud/aws-sdk/v3/index.js @@ -42,6 +42,11 @@ exports.init = function init(config) { sqsConsumer.init(); + /** + * https://github.com/aws/aws-sdk-js-v3/releases/tag/v3.1046.0 + */ + hook.onModuleLoad('@smithy/core/client', instrumentGlobalSmithy); + /** * @aws-sdk/smithly-client >= 3.36.0 changed how the dist structure gets delivered * https://github.com/aws/aws-sdk-js-v3/blob/main/packages/smithy-client/CHANGELOG.md#3360-2021-10-08 @@ -72,8 +77,25 @@ exports.deactivate = function deactivate() { isActive = false; }; -function instrumentGlobalSmithy(Smithy) { - shimmer.wrap(Smithy.Client.prototype, 'send', shimSmithySend); +/** + * The require hook can run once while `exports` is still `{}` (cyclic CJS load); `exports` is then the same object + * Node fills in later. Defer wrapping until after the current synchronous load completes. + */ +function instrumentGlobalSmithy(exports) { + const tryWrap = () => { + if (typeof exports.Client === 'function' && exports.Client.prototype) { + shimmer.wrap(exports.Client.prototype, 'send', shimSmithySend); + return true; + } + return false; + }; + + if (!tryWrap()) { + setImmediate(() => { + tryWrap(); + }); + } + return exports; } function shimSmithySend(originalSend) { @@ -84,6 +106,7 @@ function shimSmithySend(originalSend) { const serviceId = self.config && self.config.serviceId; let awsProduct = serviceId && awsProductInstances.find(aws => aws.getServiceIdName() === serviceId.toLowerCase()); + if (awsProduct && awsProduct.supportsOperation(command.constructor.name)) { return awsProduct.instrumentedSmithySend(self, isActive, originalSend, smithySendArgs); } else {