@opentelemetry/instrumentation-connect
Advanced tools
Comparing version 0.29.0 to 0.30.0
@@ -56,3 +56,3 @@ "use strict"; | ||
return function nextFunction(err) { | ||
const result = next.apply(this, err); | ||
const result = next.apply(this, [err]); | ||
finishSpan(); | ||
@@ -88,9 +88,13 @@ return result; | ||
const instrumentation = this; | ||
return function () { | ||
const isErrorMiddleware = middleWare.length === 4; | ||
function patchedMiddleware() { | ||
if (!instrumentation.isEnabled()) { | ||
return middleWare.apply(this, arguments); | ||
} | ||
const req = arguments[0]; | ||
const res = arguments[1]; | ||
const next = arguments[2]; | ||
const [reqArgIdx, resArgIdx, nextArgIdx] = isErrorMiddleware | ||
? [1, 2, 3] | ||
: [0, 1, 2]; | ||
const req = arguments[reqArgIdx]; | ||
const res = arguments[resArgIdx]; | ||
const next = arguments[nextArgIdx]; | ||
const rpcMetadata = core_1.getRPCMetadata(api_1.context.active()); | ||
@@ -122,5 +126,11 @@ if (routeName && (rpcMetadata === null || rpcMetadata === void 0 ? void 0 : rpcMetadata.type) === core_1.RPCType.HTTP) { | ||
res.addListener('close', finishSpan); | ||
arguments[2] = instrumentation._patchNext(next, finishSpan); | ||
arguments[nextArgIdx] = instrumentation._patchNext(next, finishSpan); | ||
return middleWare.apply(this, arguments); | ||
}; | ||
} | ||
Object.defineProperty(patchedMiddleware, 'length', { | ||
value: middleWare.length, | ||
writable: false, | ||
configurable: true, | ||
}); | ||
return patchedMiddleware; | ||
} | ||
@@ -127,0 +137,0 @@ _patchUse(original) { |
@@ -1,2 +0,2 @@ | ||
export declare const VERSION = "0.29.0"; | ||
export declare const VERSION = "0.30.0"; | ||
//# sourceMappingURL=version.d.ts.map |
@@ -20,3 +20,3 @@ "use strict"; | ||
// this is autogenerated file, see scripts/version-update.js | ||
exports.VERSION = '0.29.0'; | ||
exports.VERSION = '0.30.0'; | ||
//# sourceMappingURL=version.js.map |
# Changelog | ||
## [0.30.0](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-connect-v0.29.0...instrumentation-connect-v0.30.0) (2022-09-02) | ||
### Features | ||
* update experimental Otel deps to ^0.31.0 ([#1096](https://github.com/open-telemetry/opentelemetry-js-contrib/issues/1096)) ([4c8843b](https://github.com/open-telemetry/opentelemetry-js-contrib/commit/4c8843be14896d1159a622c07eb3a049401ccba1)) | ||
* update experimental Otel deps to ^0.32.0 ([#1143](https://github.com/open-telemetry/opentelemetry-js-contrib/issues/1143)) ([6fb1911](https://github.com/open-telemetry/opentelemetry-js-contrib/commit/6fb191139aed2ca763300dcf9adb51121a88f97e)) | ||
### Bug Fixes | ||
* connect's error handling middleware not called properly (opentel… ([#1076](https://github.com/open-telemetry/opentelemetry-js-contrib/issues/1076)) ([012eafb](https://github.com/open-telemetry/opentelemetry-js-contrib/commit/012eafb2ff4022220a4e26351ad66f1b1d080aec)) | ||
## [0.29.0](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-connect-v0.28.0...instrumentation-connect-v0.29.0) (2022-06-08) | ||
@@ -4,0 +17,0 @@ |
{ | ||
"name": "@opentelemetry/instrumentation-connect", | ||
"version": "0.29.0", | ||
"version": "0.30.0", | ||
"description": "OpenTelemetry connect automatic instrumentation package.", | ||
@@ -58,3 +58,3 @@ "main": "build/src/index.js", | ||
"rimraf": "3.0.2", | ||
"ts-mocha": "8.0.0", | ||
"ts-mocha": "10.0.0", | ||
"typescript": "4.3.5" | ||
@@ -64,3 +64,3 @@ }, | ||
"@opentelemetry/core": "^1.0.0", | ||
"@opentelemetry/instrumentation": "^0.29.2", | ||
"@opentelemetry/instrumentation": "^0.32.0", | ||
"@opentelemetry/semantic-conventions": "^1.0.0", | ||
@@ -70,3 +70,3 @@ "@types/connect": "3.4.35" | ||
"homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-instrumentation-connect#readme", | ||
"gitHead": "9633cf49c4099e97dd2a285d0399455e17a593e3" | ||
"gitHead": "4a9442ceea7f8555ad6e5f731f92834f3398d5b9" | ||
} |
@@ -6,6 +6,5 @@ # OpenTelemetry Connect Instrumentation for Node.js | ||
This module provides automatic instrumentation for [`connect`](https://github.com/senchalabs/connect). | ||
This module provides automatic instrumentation for the [`connect`](https://github.com/senchalabs/connect) module, which may be loaded using the [`@opentelemetry/sdk-trace-node`](https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-sdk-trace-node) package and is included in the [`@opentelemetry/auto-instrumentations-node`](https://www.npmjs.com/package/@opentelemetry/auto-instrumentations-node) bundle. | ||
For automatic instrumentation see the | ||
[@opentelemetry/sdk-trace-node](https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-sdk-trace-node) package. | ||
If total installation size is not constrained, it is recommended to use the [`@opentelemetry/auto-instrumentations-node`](https://www.npmjs.com/package/@opentelemetry/auto-instrumentations-node) bundle with [@opentelemetry/sdk-node](`https://www.npmjs.com/package/@opentelemetry/sdk-node`) for the most seamless instrumentation experience. | ||
@@ -12,0 +11,0 @@ Compatible with OpenTelemetry JS API and SDK `1.0+`. |
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
32407
281
65
+ Added@opentelemetry/api-metrics@0.32.0(transitive)
+ Added@opentelemetry/instrumentation@0.32.0(transitive)
- Removed@opentelemetry/api-metrics@0.29.2(transitive)
- Removed@opentelemetry/instrumentation@0.29.2(transitive)