Skip to content

Commit 66f40a8

Browse files
authored
1 parent f85ae32 commit 66f40a8

File tree

1 file changed

+13
-0
lines changed
  • packages/core/src/tracing/instrumentation/cloud/aws-sdk/v2

1 file changed

+13
-0
lines changed

packages/core/src/tracing/instrumentation/cloud/aws-sdk/v2/index.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,15 @@ const awsProducts = [
2121
/** @type {Object.<string, import('./instana_aws_product').InstanaAWSProduct} */
2222
const operationMap = {};
2323
let isActive = false;
24+
let logger;
2425

2526
exports.isActive = function () {
2627
return isActive;
2728
};
2829

2930
exports.init = function init(config) {
31+
logger = config.logger;
32+
3033
awsProducts.forEach(AwsProductClass => {
3134
const awsProduct = new AwsProductClass(config);
3235
Object.assign(operationMap, awsProduct.getOperations());
@@ -43,7 +46,17 @@ exports.deactivate = function deactivate() {
4346
isActive = false;
4447
};
4548

49+
function logDeprecationWarning() {
50+
logger.warn(
51+
// eslint-disable-next-line max-len
52+
'[Deprecation Warning] The support for AWS SDK v2 (aws-sdk) is deprecated and will be removed in the next major release. ' +
53+
'Please migrate to AWS SDK v3 (@aws-sdk/*). For more information, see: ' +
54+
'https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/migrating.html'
55+
);
56+
}
57+
4658
function instrumentAWS(AWS) {
59+
logDeprecationWarning();
4760
shimmer.wrap(AWS.Service.prototype, 'makeRequest', shimMakeRequest);
4861
}
4962

0 commit comments

Comments
 (0)