You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
const instrumentations = new ${oTelInstrumentationClass}(${oTelInstrumentationConstructorArgs}).getModuleDefinitions();
55
43
56
-
if (instrumentation.files?.length) {
57
-
for (const file of instrumentation.files.filter(f => f.name === '${path}')) {
58
-
if (!file.supportedVersions.some(v => satisfies('${moduleVersion}', v))) {
59
-
diag.debug('Skipping instrumentation for ${path}@${moduleVersion} because it does not match supported versions ' + file.supportedVersions.join(','));
44
+
for (const instrumentation of instrumentations.filter(i => i.name === '${instrumentationName}')) {
45
+
if (!instrumentation.supportedVersions.some(v => satisfies('${moduleVersion}', v))) {
46
+
diag.debug('Skipping instrumentation ${instrumentationName}, because module version ${moduleVersion} does not match supported versions ' + instrumentation.supportedVersions.join(','));
60
47
continue;
61
48
}
62
-
mod = file.patch(mod, '${moduleVersion}');
63
-
}
64
-
}
65
49
50
+
if (instrumentation.patch) {
51
+
diag.debug('Applying instrumentation patch ${instrumentationName} via esbuild-plugin-node');
52
+
mod = instrumentation.patch(mod)
53
+
}
66
54
67
-
module.exports = mod;
55
+
if (instrumentation.files?.length) {
56
+
for (const file of instrumentation.files.filter(f => f.name === '${path}')) {
57
+
if (!file.supportedVersions.some(v => satisfies('${moduleVersion}', v))) {
58
+
diag.debug('Skipping instrumentation for ${path}@${moduleVersion} because it does not match supported versions' + file.supportedVersions.join(','));
59
+
continue;
60
+
}
61
+
diag.debug('Applying instrumentation patch to ${path}@${moduleVersion} via esbuild-plugin-node');
0 commit comments