|
1 | 1 | var shimmer = require('../utils/shimmer') |
| 2 | +var Module = require('module') |
2 | 3 |
|
3 | 4 | var defaults = require('lodash.defaults') |
4 | 5 | var get = require('lodash.get') |
@@ -74,32 +75,32 @@ module.exports = { |
74 | 75 | instrumentations: [{ |
75 | 76 | path: 'amqplib', |
76 | 77 | pre: function () { |
77 | | - require('amqplib/channel_api') |
| 78 | + Module._load('amqplib/channel_api', arguments[3]) |
78 | 79 | return Array.prototype.slice.call(arguments, 2) |
79 | 80 | } |
80 | 81 | }, { |
81 | 82 | path: 'amqplib/channel_api', |
82 | 83 | pre: function () { |
83 | | - require('amqplib/lib/channel_model') |
| 84 | + Module._load('amqplib/lib/channel_model', arguments[3]) |
84 | 85 | return Array.prototype.slice.call(arguments, 2) |
85 | 86 | } |
86 | 87 | }, { |
87 | 88 | path: 'amqplib/callback_api', |
88 | 89 | pre: function () { |
89 | | - require('amqplib/lib/callback_model') |
| 90 | + Module._load('amqplib/lib/callback_model', arguments[3]) |
90 | 91 | return Array.prototype.slice.call(arguments, 2) |
91 | 92 | } |
92 | 93 | }, { |
93 | 94 | path: 'amqplib/lib/channel_model', |
94 | 95 | pre: function () { |
95 | | - require('amqplib/lib/connection') |
| 96 | + Module._load('amqplib/lib/connection', arguments[3]) |
96 | 97 | return Array.prototype.slice.call(arguments, 2) |
97 | 98 | }, |
98 | 99 | post: channelModelWrapper |
99 | 100 | }, { |
100 | 101 | path: 'amqplib/lib/callback_model', |
101 | 102 | pre: function () { |
102 | | - require('amqplib/lib/connection') |
| 103 | + Module._load('amqplib/lib/connection', arguments[3]) |
103 | 104 | return Array.prototype.slice.call(arguments, 2) |
104 | 105 | }, |
105 | 106 | post: callbackModelWrapper |
|
0 commit comments