@opentelemetry/instrumentation-pino
Advanced tools
Comparing version 0.34.3 to 0.34.4
@@ -29,8 +29,10 @@ "use strict"; | ||
return [ | ||
new instrumentation_1.InstrumentationNodeModuleDefinition('pino', pinoVersions, (pinoModule, moduleVersion) => { | ||
new instrumentation_1.InstrumentationNodeModuleDefinition('pino', pinoVersions, (module, moduleVersion) => { | ||
api_1.diag.debug(`Applying patch for pino@${moduleVersion}`); | ||
const isESM = module[Symbol.toStringTag] === 'Module'; | ||
const moduleExports = isESM ? module.default : module; | ||
const instrumentation = this; | ||
const patchedPino = Object.assign((...args) => { | ||
if (args.length === 0) { | ||
return pinoModule({ | ||
return moduleExports({ | ||
mixin: instrumentation._getMixinFunction(), | ||
@@ -47,8 +49,8 @@ }); | ||
}); | ||
return pinoModule(...args); | ||
return moduleExports(...args); | ||
} | ||
} | ||
args[0] = instrumentation._combineOptions(args[0]); | ||
return pinoModule(...args); | ||
}, pinoModule); | ||
return moduleExports(...args); | ||
}, moduleExports); | ||
if (typeof patchedPino.pino === 'function') { | ||
@@ -60,2 +62,9 @@ patchedPino.pino = patchedPino; | ||
} | ||
if (isESM) { | ||
if (module.pino) { | ||
// This was added in pino@6.8.0 (https://github.com/pinojs/pino/pull/936). | ||
module.pino = patchedPino; | ||
} | ||
module.default = patchedPino; | ||
} | ||
return patchedPino; | ||
@@ -62,0 +71,0 @@ }), |
@@ -1,2 +0,2 @@ | ||
export declare const VERSION = "0.34.3"; | ||
export declare const VERSION = "0.34.4"; | ||
//# sourceMappingURL=version.d.ts.map |
@@ -20,3 +20,3 @@ "use strict"; | ||
// this is autogenerated file, see scripts/version-update.js | ||
exports.VERSION = '0.34.3'; | ||
exports.VERSION = '0.34.4'; | ||
//# sourceMappingURL=version.js.map |
{ | ||
"name": "@opentelemetry/instrumentation-pino", | ||
"version": "0.34.3", | ||
"version": "0.34.4", | ||
"description": "OpenTelemetry instrumentation for pino", | ||
@@ -17,3 +17,3 @@ "main": "build/src/index.js", | ||
"prewatch": "npm run precompile", | ||
"prepare": "npm run compile", | ||
"prepublishOnly": "npm run compile", | ||
"version:update": "node ../../../scripts/version-update.js", | ||
@@ -50,2 +50,3 @@ "compile": "tsc -p ." | ||
"@opentelemetry/context-async-hooks": "^1.8.0", | ||
"@opentelemetry/contrib-test-utils": "^0.35.0", | ||
"@opentelemetry/sdk-trace-base": "^1.8.0", | ||
@@ -71,3 +72,3 @@ "@opentelemetry/sdk-trace-node": "^1.8.0", | ||
"homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-instrumentation-pino#readme", | ||
"gitHead": "607d375595da3ab51b7f773ac360900121c4361b" | ||
"gitHead": "c7e7000b7bf79b0b107c448b403c2613a9b9e2c1" | ||
} |
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
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
37122
213
18