@opentelemetry/instrumentation
Advanced tools
Comparing version 0.28.0 to 0.29.0
@@ -11,2 +11,3 @@ import * as types from '../../types'; | ||
constructor(instrumentationName: string, instrumentationVersion: string, config?: types.InstrumentationConfig); | ||
private _warnOnPreloadedModules; | ||
private _extractPackageVersion; | ||
@@ -13,0 +14,0 @@ private _onRequire; |
@@ -71,2 +71,18 @@ /* | ||
} | ||
InstrumentationBase.prototype._warnOnPreloadedModules = function () { | ||
var _this = this; | ||
this._modules.forEach(function (module) { | ||
var name = module.name; | ||
try { | ||
var resolvedModule = require.resolve(name); | ||
if (require.cache[resolvedModule]) { | ||
// Module is already cached, which means the instrumentation hook might not work | ||
_this._diag.warn("Module " + name + " has been loaded before " + _this.instrumentationName + " so it might not work, please initialize it before requiring " + name); | ||
} | ||
} | ||
catch (_a) { | ||
// Module isn't available, we can simply skip | ||
} | ||
}); | ||
}; | ||
InstrumentationBase.prototype._extractPackageVersion = function (baseDir) { | ||
@@ -159,2 +175,3 @@ try { | ||
} | ||
this._warnOnPreloadedModules(); | ||
var _loop_1 = function (module_2) { | ||
@@ -161,0 +178,0 @@ this_1._hooks.push(RequireInTheMiddle([module_2.name], { internals: true }, function (exports, name, baseDir) { |
@@ -41,7 +41,2 @@ import { TracerProvider } from '@opentelemetry/api'; | ||
enabled?: boolean; | ||
/** | ||
* Path of the trace plugin to load. | ||
* @default '@opentelemetry/plugin-http' in case of http. | ||
*/ | ||
path?: string; | ||
} | ||
@@ -48,0 +43,0 @@ /** |
@@ -1,2 +0,2 @@ | ||
export declare const VERSION = "0.28.0"; | ||
export declare const VERSION = "0.29.0"; | ||
//# sourceMappingURL=version.d.ts.map |
@@ -17,3 +17,3 @@ /* | ||
// this is autogenerated file, see scripts/version-update.js | ||
export var VERSION = '0.28.0'; | ||
export var VERSION = '0.29.0'; | ||
//# sourceMappingURL=version.js.map |
@@ -11,2 +11,3 @@ import * as types from '../../types'; | ||
constructor(instrumentationName: string, instrumentationVersion: string, config?: types.InstrumentationConfig); | ||
private _warnOnPreloadedModules; | ||
private _extractPackageVersion; | ||
@@ -13,0 +14,0 @@ private _onRequire; |
@@ -42,2 +42,17 @@ /* | ||
} | ||
_warnOnPreloadedModules() { | ||
this._modules.forEach((module) => { | ||
const { name } = module; | ||
try { | ||
const resolvedModule = require.resolve(name); | ||
if (require.cache[resolvedModule]) { | ||
// Module is already cached, which means the instrumentation hook might not work | ||
this._diag.warn(`Module ${name} has been loaded before ${this.instrumentationName} so it might not work, please initialize it before requiring ${name}`); | ||
} | ||
} | ||
catch (_a) { | ||
// Module isn't available, we can simply skip | ||
} | ||
}); | ||
} | ||
_extractPackageVersion(baseDir) { | ||
@@ -108,2 +123,3 @@ try { | ||
} | ||
this._warnOnPreloadedModules(); | ||
for (const module of this._modules) { | ||
@@ -110,0 +126,0 @@ this._hooks.push(RequireInTheMiddle([module.name], { internals: true }, (exports, name, baseDir) => { |
@@ -41,7 +41,2 @@ import { TracerProvider } from '@opentelemetry/api'; | ||
enabled?: boolean; | ||
/** | ||
* Path of the trace plugin to load. | ||
* @default '@opentelemetry/plugin-http' in case of http. | ||
*/ | ||
path?: string; | ||
} | ||
@@ -48,0 +43,0 @@ /** |
@@ -1,2 +0,2 @@ | ||
export declare const VERSION = "0.28.0"; | ||
export declare const VERSION = "0.29.0"; | ||
//# sourceMappingURL=version.d.ts.map |
@@ -17,3 +17,3 @@ /* | ||
// this is autogenerated file, see scripts/version-update.js | ||
export const VERSION = '0.28.0'; | ||
export const VERSION = '0.29.0'; | ||
//# sourceMappingURL=version.js.map |
@@ -11,2 +11,3 @@ import * as types from '../../types'; | ||
constructor(instrumentationName: string, instrumentationVersion: string, config?: types.InstrumentationConfig); | ||
private _warnOnPreloadedModules; | ||
private _extractPackageVersion; | ||
@@ -13,0 +14,0 @@ private _onRequire; |
@@ -45,2 +45,17 @@ "use strict"; | ||
} | ||
_warnOnPreloadedModules() { | ||
this._modules.forEach((module) => { | ||
const { name } = module; | ||
try { | ||
const resolvedModule = require.resolve(name); | ||
if (require.cache[resolvedModule]) { | ||
// Module is already cached, which means the instrumentation hook might not work | ||
this._diag.warn(`Module ${name} has been loaded before ${this.instrumentationName} so it might not work, please initialize it before requiring ${name}`); | ||
} | ||
} | ||
catch (_a) { | ||
// Module isn't available, we can simply skip | ||
} | ||
}); | ||
} | ||
_extractPackageVersion(baseDir) { | ||
@@ -111,2 +126,3 @@ try { | ||
} | ||
this._warnOnPreloadedModules(); | ||
for (const module of this._modules) { | ||
@@ -113,0 +129,0 @@ this._hooks.push(RequireInTheMiddle([module.name], { internals: true }, (exports, name, baseDir) => { |
@@ -41,7 +41,2 @@ import { TracerProvider } from '@opentelemetry/api'; | ||
enabled?: boolean; | ||
/** | ||
* Path of the trace plugin to load. | ||
* @default '@opentelemetry/plugin-http' in case of http. | ||
*/ | ||
path?: string; | ||
} | ||
@@ -48,0 +43,0 @@ /** |
@@ -1,2 +0,2 @@ | ||
export declare const VERSION = "0.28.0"; | ||
export declare const VERSION = "0.29.0"; | ||
//# sourceMappingURL=version.d.ts.map |
@@ -20,3 +20,3 @@ "use strict"; | ||
// this is autogenerated file, see scripts/version-update.js | ||
exports.VERSION = '0.28.0'; | ||
exports.VERSION = '0.29.0'; | ||
//# sourceMappingURL=version.js.map |
{ | ||
"name": "@opentelemetry/instrumentation", | ||
"version": "0.28.0", | ||
"version": "0.29.0", | ||
"description": "Base class for node which OpenTelemetry instrumentation modules extend", | ||
@@ -71,3 +71,3 @@ "author": "OpenTelemetry Authors", | ||
"dependencies": { | ||
"@opentelemetry/api-metrics": "0.28.0", | ||
"@opentelemetry/api-metrics": "0.29.0", | ||
"require-in-the-middle": "^5.0.3", | ||
@@ -104,3 +104,3 @@ "semver": "^7.3.2", | ||
"ts-loader": "8.3.0", | ||
"ts-mocha": "8.0.0", | ||
"ts-mocha": "9.0.2", | ||
"typescript": "4.4.4", | ||
@@ -111,3 +111,3 @@ "webpack": "4.46.0", | ||
}, | ||
"gitHead": "a0a670a03fd35b0799bee8cc466f79e93b5b6dd2" | ||
"gitHead": "eda0b092db484855ded8b4837ba7fc19a377c5a7" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
269503
2840
6
+ Added@opentelemetry/api-metrics@0.29.0(transitive)
- Removed@opentelemetry/api-metrics@0.28.0(transitive)