Skip to content

Commit

Permalink
Merge pull request newrelic#183 from bizob2828/fix-wrap-class-v3
Browse files Browse the repository at this point in the history
fix: Assigned shimName to v3 instrumentation to avoid duplicate middleware crashes
  • Loading branch information
bizob2828 authored Apr 28, 2023
2 parents c120871 + 276b48d commit 34fafe0
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 10 deletions.
15 changes: 10 additions & 5 deletions merged/aws-sdk/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,26 @@ newrelic.instrumentConglomerate('aws-sdk', require('./lib/v2/instrumentation'))

newrelic.instrument({
moduleName: '@aws-sdk/smithy-client',
onResolved: require('./lib/v3/smithy-client')
onResolved: require('./lib/v3/smithy-client'),
shimName: 'aws-sdk'
})
newrelic.instrumentMessages({
moduleName: '@aws-sdk/client-sns',
onResolved: require('./lib/v3/sns')
onResolved: require('./lib/v3/sns'),
shimName: 'aws-sdk'
})
newrelic.instrumentMessages({
moduleName: '@aws-sdk/client-sqs',
onResolved: require('./lib/v3/sqs')
onResolved: require('./lib/v3/sqs'),
shimName: 'aws-sdk'
})
newrelic.instrumentDatastore({
moduleName: '@aws-sdk/client-dynamodb',
onResolved: require('./lib/v3/client-dynamodb')
onResolved: require('./lib/v3/client-dynamodb'),
shimName: 'aws-sdk'
})
newrelic.instrumentDatastore({
moduleName: '@aws-sdk/lib-dynamodb',
onResolved: require('./lib/v3/lib-dynamodb')
onResolved: require('./lib/v3/lib-dynamodb'),
shimName: 'aws-sdk'
})
15 changes: 10 additions & 5 deletions merged/aws-sdk/nr-hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,32 @@ const instrumentations = [
{
type: 'generic',
moduleName: '@aws-sdk/smithy-client',
onResolved: require('./lib/v3/smithy-client')
onResolved: require('./lib/v3/smithy-client'),
shimName: 'aws-sdk'
},
{
type: 'message',
moduleName: '@aws-sdk/client-sns',
onResolved: require('./lib/v3/sns')
onResolved: require('./lib/v3/sns'),
shimName: 'aws-sdk'
},
{
type: 'message',
moduleName: '@aws-sdk/client-sqs',
onResolved: require('./lib/v3/sqs')
onResolved: require('./lib/v3/sqs'),
shimName: 'aws-sdk'
},
{
type: 'datastore',
moduleName: '@aws-sdk/client-dynamodb',
onResolved: require('./lib/v3/client-dynamodb')
onResolved: require('./lib/v3/client-dynamodb'),
shimName: 'aws-sdk'
},
{
type: 'datastore',
moduleName: '@aws-sdk/lib-dynamodb',
onResolved: require('./lib/v3/lib-dynamodb')
onResolved: require('./lib/v3/lib-dynamodb'),
shimName: 'aws-sdk'
}
]

Expand Down

0 comments on commit 34fafe0

Please sign in to comment.