File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
packages/core/src/tracing/instrumentation/cloud/aws-sdk/v2 Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -21,12 +21,15 @@ const awsProducts = [
2121/** @type {Object.<string, import('./instana_aws_product').InstanaAWSProduct } */
2222const operationMap = { } ;
2323let isActive = false ;
24+ let logger ;
2425
2526exports . isActive = function ( ) {
2627 return isActive ;
2728} ;
2829
2930exports . 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+
4658function instrumentAWS ( AWS ) {
59+ logDeprecationWarning ( ) ;
4760 shimmer . wrap ( AWS . Service . prototype , 'makeRequest' , shimMakeRequest ) ;
4861}
4962
You can’t perform that action at this time.
0 commit comments