Skip to content
This repository has been archived by the owner on Jun 5, 2024. It is now read-only.

Fix instrumentation in 3.363.0 of aws sdk #195

Merged
merged 1 commit into from
Jun 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions nr-hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ const instrumentations = [
onResolved: require('./lib/v3/smithy-client'),
shimName: 'aws-sdk'
},
{
type: 'generic',
moduleName: '@smithy/smithy-client',
onResolved: require('./lib/v3/smithy-client'),
shimName: 'aws-sdk'
},
{
type: 'message',
moduleName: '@aws-sdk/client-sns',
Expand Down
6 changes: 5 additions & 1 deletion tests/versioned/v3/client-dynamodb.tap.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,11 @@ tap.test('DynamoDB', (t) => {
DynamoDBClient = null

Object.keys(require.cache).forEach((key) => {
if (key.includes('@aws-sdk/client-dynamodb') || key.includes('@aws-sdk/smithy-client')) {
if (
key.includes('@aws-sdk/client-dynamodb') ||
key.includes('@aws-sdk/smithy-client') ||
key.includes('@smithy/smithy-client')
) {
delete require.cache[key]
}
})
Expand Down
3 changes: 2 additions & 1 deletion tests/versioned/v3/lib-dynamodb.tap.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ tap.test('DynamoDB', (t) => {
if (
key.includes('@aws-sdk/lib-dynamodb') ||
key.includes('@aws-sdk/client-dynamodb') ||
key.includes('@aws-sdk/smithy-client')
key.includes('@aws-sdk/smithy-client') ||
key.includes('@smithy/smithy-client')
) {
delete require.cache[key]
}
Expand Down
6 changes: 5 additions & 1 deletion tests/versioned/v3/sns.tap.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@ tap.test('SNS', (t) => {
// which files within the modules were cached preventing the instrumenting
// from running on every test
Object.keys(require.cache).forEach((key) => {
if (key.includes('@aws-sdk/client-sns') || key.includes('@aws-sdk/smithy-client')) {
if (
key.includes('@aws-sdk/client-sns') ||
key.includes('@aws-sdk/smithy-client') ||
key.includes('@smithy/smithy-client')
) {
delete require.cache[key]
}
})
Expand Down