dd-trace 2.25.0 → 2.25.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -70,5 +70,5 @@ if (originalLambdaHandler !== undefined) {
|
|
|
70
70
|
addHook({ name: lambdaFilePath }, patchLambdaModule(handlerPath))
|
|
71
71
|
} else {
|
|
72
72
|
// Instrumentation is done manually.
|
|
73
|
-
addHook({ name: 'datadog-lambda-js'
|
|
73
|
+
addHook({ name: 'datadog-lambda-js' }, patchDatadogLambdaModule)
|
|
74
74
|
}
|
|
@@ -15,8 +15,6 @@ const Hook = require('../../../../datadog-instrumentations/src/helpers/hook')
|
|
|
15
15
|
const instrumentations = require('../../../../datadog-instrumentations/src/helpers/instrumentations')
|
|
16
16
|
const {
|
|
17
17
|
filename,
|
|
18
|
-
getVersion,
|
|
19
|
-
matchVersion,
|
|
20
18
|
pathSepExpr
|
|
21
19
|
} = require('../../../../datadog-instrumentations/src/helpers/register')
|
|
22
20
|
|
|
@@ -111,21 +109,18 @@ const registerLambdaHook = () => {
|
|
|
111
109
|
})
|
|
112
110
|
} else {
|
|
113
111
|
const moduleToPatch = 'datadog-lambda-js'
|
|
114
|
-
Hook([moduleToPatch], (moduleExports, moduleName,
|
|
112
|
+
Hook([moduleToPatch], (moduleExports, moduleName, _) => {
|
|
115
113
|
moduleName = moduleName.replace(pathSepExpr, '/')
|
|
116
114
|
|
|
117
115
|
require('./patch')
|
|
118
116
|
|
|
119
|
-
for (const { name, file,
|
|
117
|
+
for (const { name, file, hook } of instrumentations[moduleToPatch]) {
|
|
120
118
|
const fullFilename = filename(name, file)
|
|
121
119
|
if (moduleName === fullFilename) {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
} catch (e) {
|
|
127
|
-
log.error(e)
|
|
128
|
-
}
|
|
120
|
+
try {
|
|
121
|
+
moduleExports = hook(moduleExports)
|
|
122
|
+
} catch (e) {
|
|
123
|
+
log.error(e)
|
|
129
124
|
}
|
|
130
125
|
}
|
|
131
126
|
}
|