@opentelemetry/instrumentation-express
Advanced tools
Comparing version 0.32.4 to 0.33.0
@@ -17,17 +17,8 @@ "use strict"; | ||
*/ | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
__exportStar(require("./instrumentation"), exports); | ||
__exportStar(require("./enums/ExpressLayerType"), exports); | ||
__exportStar(require("./enums/AttributeNames"), exports); | ||
__exportStar(require("./types"), exports); | ||
const tslib_1 = require("tslib"); | ||
(0, tslib_1.__exportStar)(require("./instrumentation"), exports); | ||
(0, tslib_1.__exportStar)(require("./enums/ExpressLayerType"), exports); | ||
(0, tslib_1.__exportStar)(require("./enums/AttributeNames"), exports); | ||
(0, tslib_1.__exportStar)(require("./types"), exports); | ||
//# sourceMappingURL=index.js.map |
@@ -139,10 +139,5 @@ "use strict"; | ||
const rpcMetadata = (0, core_1.getRPCMetadata)(api_1.context.active()); | ||
if (metadata.attributes[AttributeNames_1.AttributeNames.EXPRESS_TYPE] === | ||
ExpressLayerType_1.ExpressLayerType.REQUEST_HANDLER && | ||
if (type === ExpressLayerType_1.ExpressLayerType.REQUEST_HANDLER && | ||
(rpcMetadata === null || rpcMetadata === void 0 ? void 0 : rpcMetadata.type) === core_1.RPCType.HTTP) { | ||
const name = instrumentation._getSpanName({ | ||
request: req, | ||
route, | ||
}, `${req.method} ${route.length > 0 ? route : '/'}`); | ||
rpcMetadata.span.updateName(name); | ||
rpcMetadata.route = route || '/'; | ||
} | ||
@@ -194,5 +189,2 @@ // verify against the config if the layer should be ignored | ||
const callbackIdx = args.findIndex(arg => typeof arg === 'function'); | ||
const newContext = (rpcMetadata === null || rpcMetadata === void 0 ? void 0 : rpcMetadata.type) === core_1.RPCType.HTTP | ||
? (0, core_1.setRPCMetadata)(api_1.context.active(), Object.assign(rpcMetadata, { route: route })) | ||
: api_1.context.active(); | ||
if (callbackIdx >= 0) { | ||
@@ -210,3 +202,3 @@ arguments[callbackIdx] = function () { | ||
const callback = args[callbackIdx]; | ||
return api_1.context.bind(newContext, callback).apply(this, arguments); | ||
return callback.apply(this, arguments); | ||
}; | ||
@@ -213,0 +205,0 @@ } |
@@ -9,6 +9,3 @@ import type { Request } from 'express'; | ||
route: string; | ||
/** | ||
* If layerType is undefined, SpanNameHook is being invoked to rename the original root HTTP span. | ||
*/ | ||
layerType?: ExpressLayerType; | ||
layerType: ExpressLayerType; | ||
}; | ||
@@ -15,0 +12,0 @@ export declare type SpanNameHook = (info: ExpressRequestInfo, |
@@ -1,2 +0,2 @@ | ||
export declare const VERSION = "0.32.4"; | ||
export declare const VERSION = "0.33.0"; | ||
//# sourceMappingURL=version.d.ts.map |
@@ -20,3 +20,3 @@ "use strict"; | ||
// this is autogenerated file, see scripts/version-update.js | ||
exports.VERSION = '0.32.4'; | ||
exports.VERSION = '0.33.0'; | ||
//# sourceMappingURL=version.js.map |
{ | ||
"name": "@opentelemetry/instrumentation-express", | ||
"version": "0.32.4", | ||
"version": "0.33.0", | ||
"description": "OpenTelemetry express automatic instrumentation package.", | ||
@@ -69,8 +69,9 @@ "main": "build/src/index.js", | ||
"@opentelemetry/core": "^1.8.0", | ||
"@opentelemetry/instrumentation": "^0.40.0", | ||
"@opentelemetry/instrumentation": "^0.41.0", | ||
"@opentelemetry/semantic-conventions": "^1.0.0", | ||
"@types/express": "4.17.13" | ||
"@types/express": "4.17.13", | ||
"tslib": "^2.3.1" | ||
}, | ||
"homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-instrumentation-express#readme", | ||
"gitHead": "efdfc727a49090accee7fea8ff93011b6b84c1e4" | ||
"gitHead": "f81f8a76a8f0af2101c62dbc73cde442f875d833" | ||
} |
@@ -79,3 +79,3 @@ # OpenTelemetry Express Instrumentation for Node.js | ||
- `info: ExpressRequestInfo` containing the incoming Express.js request, the current route handler creating a span and `ExpressLayerType` - the type of the handling layer or undefined when renaming the root HTTP instrumentation span. | ||
- `info: ExpressRequestInfo` containing the incoming Express.js request, the current route handler creating a span and `ExpressLayerType` - the type of the handling layer. | ||
- `defaultName: string` - original name proposed by the instrumentation. | ||
@@ -82,0 +82,0 @@ |
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
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
81725
6
656
+ Addedtslib@^2.3.1
+ Added@opentelemetry/instrumentation@0.41.2(transitive)
+ Addedacorn@8.12.1(transitive)
+ Addedacorn-import-assertions@1.9.0(transitive)
+ Addedcjs-module-lexer@1.4.1(transitive)
+ Addedimport-in-the-middle@1.4.2(transitive)
+ Addedtslib@2.7.0(transitive)
- Removed@opentelemetry/instrumentation@0.40.0(transitive)
- Removedimport-in-the-middle@1.3.5(transitive)