Skip to content

Commit 8047bf1

Browse files
authored
chore: Added a new diagnostics base class and migrated undici to use new class (#3408)
1 parent 0840324 commit 8047bf1

File tree

66 files changed

+1097
-940
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+1097
-940
lines changed

lib/config/build-instrumentation-config.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ const corePkgs = Object.keys(coreLibraries)
1212
const subscriptions = require('../subscriber-configs')
1313
const subscribers = Object.keys(subscriptions)
1414
pkgNames.push(...subscribers)
15-
// Manually adding undici as it is registered separately in shimmer
16-
corePkgs.push('undici')
1715
// Manually adding domain as it is registered separately in shimmer
1816
corePkgs.push('domain')
1917
pkgNames.push(...corePkgs)

lib/instrumentation-descriptor.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,6 @@ class InstrumentationDescriptor {
8686
*/
8787
static TYPE_WEB_FRAMEWORK = 'web-framework'
8888

89-
/**
90-
* Used to load supportability metrics on installed versions of packages
91-
* that the Node.js agent does not instrument (e.g. OTEL instrumentation or
92-
* top logging libraries).
93-
* @type {string}
94-
*/
95-
static TYPE_TRACKING = 'tracking'
96-
9789
/**
9890
* The type of the module being instrumented. See the static `TYPE_` fields.
9991
* @type {string|null}
@@ -207,7 +199,6 @@ module.exports.TYPES = {
207199
PROMISE: InstrumentationDescriptor.TYPE_PROMISE,
208200

209201
WEB_FRAMEWORK: InstrumentationDescriptor.TYPE_WEB_FRAMEWORK,
210-
TRACKING: InstrumentationDescriptor.TYPE_TRACKING,
211202
/** @private */
212203
CONGLOMERATE: InstrumentationDescriptor.TYPE_CONGLOMERATE,
213204
/** @private */

lib/instrumentation/undici.js

Lines changed: 0 additions & 229 deletions
This file was deleted.

lib/instrumentations.js

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -39,22 +39,6 @@ module.exports = function instrumentations() {
3939
restify: { type: InstrumentationDescriptor.TYPE_WEB_FRAMEWORK },
4040
superagent: { type: InstrumentationDescriptor.TYPE_GENERIC },
4141
when: { module: './instrumentation/when' },
42-
winston: { type: InstrumentationDescriptor.TYPE_GENERIC },
43-
44-
/**
45-
* The modules below are listed here purely to take
46-
* advantage of the Supportability/Features/onRequire/<module>
47-
* metrics for libraries we want to track for some reason or another.
48-
* The big uses cases are:
49-
* Logging libraries we want to instrument in the future
50-
* Libraries that have OpenTelemetry instrumentation we want to register
51-
* or have already registered.
52-
*/
53-
'@azure/openai': { type: InstrumentationDescriptor.TYPE_TRACKING },
54-
'@langchain/community/llms/bedrock': { type: InstrumentationDescriptor.TYPE_TRACKING },
55-
'fancy-log': { type: InstrumentationDescriptor.TYPE_TRACKING },
56-
knex: { type: InstrumentationDescriptor.TYPE_TRACKING },
57-
loglevel: { type: InstrumentationDescriptor.TYPE_TRACKING },
58-
npmlog: { type: InstrumentationDescriptor.TYPE_TRACKING },
42+
winston: { type: InstrumentationDescriptor.TYPE_GENERIC }
5943
}
6044
}

0 commit comments

Comments
 (0)