opentelemetry-instrumentation-express
Advanced tools
Comparing version 0.0.0-2021-06-23--15-11 to 0.0.0-2021-08-01--12-54
@@ -6,2 +6,43 @@ # Change Log | ||
# [0.23.0](https://github.com/aspecto-io/opentelemetry-ext-js/compare/opentelemetry-instrumentation-express@0.22.1...opentelemetry-instrumentation-express@0.23.0) (2021-07-05) | ||
### Features | ||
* upgrade to opentelemetry@0.23.0 ([#149](https://github.com/aspecto-io/opentelemetry-ext-js/issues/149)) ([c56258e](https://github.com/aspecto-io/opentelemetry-ext-js/commit/c56258eba8885fa7ac9a2d26e4860c30f33fe513)) | ||
## [0.22.1](https://github.com/aspecto-io/opentelemetry-ext-js/compare/opentelemetry-instrumentation-express@0.22.0...opentelemetry-instrumentation-express@0.22.1) (2021-07-04) | ||
### Bug Fixes | ||
* Adding source maps ([#147](https://github.com/aspecto-io/opentelemetry-ext-js/issues/147)) ([90a1814](https://github.com/aspecto-io/opentelemetry-ext-js/commit/90a1814f30b1fbc78a10e6f9e2f7acd7d798e53a)) | ||
# [0.22.0](https://github.com/aspecto-io/opentelemetry-ext-js/compare/opentelemetry-instrumentation-express@0.21.1...opentelemetry-instrumentation-express@0.22.0) (2021-06-28) | ||
**Note:** Version bump only for package opentelemetry-instrumentation-express | ||
## [0.21.1](https://github.com/aspecto-io/opentelemetry-ext-js/compare/opentelemetry-instrumentation-express@0.21.0...opentelemetry-instrumentation-express@0.21.1) (2021-06-27) | ||
### Bug Fixes | ||
* **instrumentation-express:** explicitly depend on used express util packages ([#141](https://github.com/aspecto-io/opentelemetry-ext-js/issues/141)) ([2ae18cb](https://github.com/aspecto-io/opentelemetry-ext-js/commit/2ae18cb36b455eedfde5db0e80e05b7529632358)) | ||
# [0.21.0](https://github.com/aspecto-io/opentelemetry-ext-js/compare/opentelemetry-instrumentation-express@0.5.1...opentelemetry-instrumentation-express@0.21.0) (2021-06-20) | ||
@@ -8,0 +49,0 @@ |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ExpressInstrumentationAttributes = exports.ExpressInstrumentation = void 0; | ||
var express_1 = require("./express"); | ||
@@ -4,0 +5,0 @@ Object.defineProperty(exports, "ExpressInstrumentation", { enumerable: true, get: function () { return express_1.ExpressInstrumentation; } }); |
@@ -7,3 +7,3 @@ "use strict"; | ||
const types_1 = require("../types"); | ||
exports.getRouteAttributes = (routeState) => { | ||
const getRouteAttributes = (routeState) => { | ||
const attributes = {}; | ||
@@ -33,5 +33,6 @@ const resolvedRoute = exports.getResolvedRoute(routeState); | ||
}; | ||
exports.getRouteAttributes = getRouteAttributes; | ||
// might contain data with high cardinality, such as ids etc. | ||
// this might happen on early termination due to authorization middlewares etc. | ||
exports.getFullRoute = (expressRoutState) => { | ||
const getFullRoute = (expressRoutState) => { | ||
// exit when missing | ||
@@ -45,5 +46,7 @@ if (!expressRoutState) | ||
}; | ||
exports.getFullRoute = getFullRoute; | ||
const getConfiguredRoute = (expressRoutState) => expressRoutState === null || expressRoutState === void 0 ? void 0 : expressRoutState.configuredRoute; | ||
exports.getResolvedRoute = (expressRoutContext) => expressRoutContext === null || expressRoutContext === void 0 ? void 0 : expressRoutContext.resolvedRoute; | ||
exports.getHttpSpanAttributeFromRes = (res) => { | ||
const getResolvedRoute = (expressRoutContext) => expressRoutContext === null || expressRoutContext === void 0 ? void 0 : expressRoutContext.resolvedRoute; | ||
exports.getResolvedRoute = getResolvedRoute; | ||
const getHttpSpanAttributeFromRes = (res) => { | ||
return { | ||
@@ -53,3 +56,4 @@ [semantic_conventions_1.SemanticAttributes.HTTP_STATUS_CODE]: res.statusCode, | ||
}; | ||
exports.getSpanNameOnResEnd = (req, routeState) => { | ||
exports.getHttpSpanAttributeFromRes = getHttpSpanAttributeFromRes; | ||
const getSpanNameOnResEnd = (req, routeState) => { | ||
var _a; | ||
@@ -63,7 +67,9 @@ // route.path will give use | ||
}; | ||
exports.getSpanInitialName = (req) => { | ||
exports.getSpanNameOnResEnd = getSpanNameOnResEnd; | ||
const getSpanInitialName = (req) => { | ||
var _a, _b, _c; | ||
return `${(_b = (_a = req === null || req === void 0 ? void 0 : req.method) === null || _a === void 0 ? void 0 : _a.toUpperCase()) !== null && _b !== void 0 ? _b : ''} ${(_c = req === null || req === void 0 ? void 0 : req.path) !== null && _c !== void 0 ? _c : ''}`; | ||
}; | ||
exports.createHostAttribute = (req) => { | ||
exports.getSpanInitialName = getSpanInitialName; | ||
const createHostAttribute = (req) => { | ||
var _a, _b; | ||
@@ -78,3 +84,4 @@ // prefer to use host from incoming headers | ||
}; | ||
exports.getHttpSpanAttributesFromReq = (req) => { | ||
exports.createHostAttribute = createHostAttribute; | ||
const getHttpSpanAttributesFromReq = (req) => { | ||
return { | ||
@@ -89,5 +96,6 @@ [semantic_conventions_1.SemanticAttributes.HTTP_METHOD]: req.method.toUpperCase(), | ||
}; | ||
exports.getHttpSpanAttributesFromReq = getHttpSpanAttributesFromReq; | ||
// from @opentelemetry/instrumentation-http | ||
// https://github.com/open-telemetry/opentelemetry-js/blob/main/packages/opentelemetry-instrumentation-http/src/utils.ts#L70 | ||
exports.parseResponseStatus = (statusCode) => { | ||
const parseResponseStatus = (statusCode) => { | ||
// 1xx, 2xx, 3xx are OK | ||
@@ -100,2 +108,3 @@ if (statusCode >= 100 && statusCode < 400) { | ||
}; | ||
exports.parseResponseStatus = parseResponseStatus; | ||
//# sourceMappingURL=attributes.js.map |
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getLayerPathFromFirstArg = void 0; | ||
const path_to_regexp_1 = __importDefault(require("path-to-regexp")); | ||
const pathStringToDisplayValue = (pathInput, options) => { | ||
@@ -13,3 +17,2 @@ if (!options.strict && pathInput !== '/' && pathInput.endsWith('/')) { | ||
const getLayerPathAlternativeFromFirstArg = (pathInput, options) => { | ||
const pathRegexp = require('path-to-regexp'); | ||
if (typeof pathInput === 'string') { | ||
@@ -19,3 +22,3 @@ return { | ||
displayValue: pathStringToDisplayValue(pathInput, options), | ||
regexp: pathRegexp(pathInput, [], options), | ||
regexp: path_to_regexp_1.default(pathInput, [], options), | ||
}; | ||
@@ -27,3 +30,3 @@ } | ||
displayValue: pathInput.toString(), | ||
regexp: pathRegexp(pathInput, [], options), | ||
regexp: path_to_regexp_1.default(pathInput, [], options), | ||
}; | ||
@@ -38,3 +41,3 @@ if (Array.isArray(pathInput)) { | ||
: undefined, | ||
regexp: pathRegexp(alternativePath, [], options), | ||
regexp: path_to_regexp_1.default(alternativePath, [], options), | ||
})); | ||
@@ -44,3 +47,3 @@ } | ||
}; | ||
exports.getLayerPathFromFirstArg = (path, options) => { | ||
const getLayerPathFromFirstArg = (path, options) => { | ||
const alternatives = getLayerPathAlternativeFromFirstArg(path, options); | ||
@@ -57,2 +60,3 @@ if (!alternatives) | ||
}; | ||
exports.getLayerPathFromFirstArg = getLayerPathFromFirstArg; | ||
//# sourceMappingURL=layer-path.js.map |
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.createInitialRouteState = exports.consumeLayerPathAndUpdateState = exports.getUsedPathFromLayerPath = void 0; | ||
exports.getUsedPathFromLayerPath = (layerPath, actualUrl) => { | ||
const parseurl_1 = __importDefault(require("parseurl")); | ||
const getUsedPathFromLayerPath = (layerPath, actualUrl) => { | ||
var _a; | ||
@@ -26,3 +30,4 @@ if (Array.isArray(layerPath === null || layerPath === void 0 ? void 0 : layerPath.alternatives)) { | ||
}; | ||
exports.consumeLayerPathAndUpdateState = (currentParts, req, currentLayerPath) => { | ||
exports.getUsedPathFromLayerPath = getUsedPathFromLayerPath; | ||
const consumeLayerPathAndUpdateState = (currentParts, req, currentLayerPath) => { | ||
var _a; | ||
@@ -52,10 +57,11 @@ const currentReqPath = req.path; | ||
}; | ||
exports.createInitialRouteState = (req) => { | ||
exports.consumeLayerPathAndUpdateState = consumeLayerPathAndUpdateState; | ||
const createInitialRouteState = (req) => { | ||
// at this point, we have the raw http req object, and not the express req. | ||
// thus, we cannot call req.path | ||
// we use parseurl(req).pathname which is exactly what express is doing | ||
const parseurl = require('parseurl'); | ||
const path = parseurl(req).pathname; | ||
const path = parseurl_1.default(req).pathname; | ||
return { resolvedRoute: '', remainingRoute: path, configuredRoute: '', params: {} }; | ||
}; | ||
exports.createInitialRouteState = createInitialRouteState; | ||
//# sourceMappingURL=route-context.js.map |
@@ -1,2 +0,2 @@ | ||
export declare const VERSION = "0.0.0-2021-06-23--15-11"; | ||
export declare const VERSION = "0.0.0-2021-08-01--12-54"; | ||
//# sourceMappingURL=version.d.ts.map |
@@ -5,3 +5,3 @@ "use strict"; | ||
// this is autogenerated file, see scripts/version-update.js | ||
exports.VERSION = '0.0.0-2021-06-23--15-11'; | ||
exports.VERSION = '0.0.0-2021-08-01--12-54'; | ||
//# sourceMappingURL=version.js.map |
{ | ||
"name": "opentelemetry-instrumentation-express", | ||
"version": "0.0.0-2021-06-23--15-11", | ||
"version": "0.0.0-2021-08-01--12-54", | ||
"description": "enhanced open telemetry instrumentation for the `express` web framework", | ||
@@ -12,2 +12,3 @@ "author": "Aspecto.io", | ||
"dist/src/**/*.d.ts", | ||
"dist/src/**/*.js.map", | ||
"LICENSE", | ||
@@ -35,13 +36,15 @@ "README.md" | ||
"peerDependencies": { | ||
"@opentelemetry/api": "^0.21.0" | ||
"@opentelemetry/api": "^1.0.1" | ||
}, | ||
"dependencies": { | ||
"@opentelemetry/core": "^0.21.0", | ||
"@opentelemetry/instrumentation": "^0.21.0", | ||
"@opentelemetry/semantic-conventions": "^0.21.0" | ||
"@opentelemetry/core": "^0.24.0", | ||
"@opentelemetry/instrumentation": "^0.24.0", | ||
"@opentelemetry/semantic-conventions": "^0.24.0", | ||
"parseurl": "~1.3.3", | ||
"path-to-regexp": "0.1.7" | ||
}, | ||
"devDependencies": { | ||
"@opentelemetry/api": "^0.21.0", | ||
"@opentelemetry/instrumentation-http": "^0.21.0", | ||
"@opentelemetry/tracing": "^0.21.0", | ||
"@opentelemetry/api": "^1.0.2", | ||
"@opentelemetry/instrumentation-http": "^0.24.0", | ||
"@opentelemetry/tracing": "^0.24.0", | ||
"@types/express": "4.17.8", | ||
@@ -54,5 +57,6 @@ "@types/mocha": "^8.2.2", | ||
"mocha": "^8.4.0", | ||
"opentelemetry-instrumentation-mocha": "0.0.1-rc.2", | ||
"opentelemetry-instrumentation-testing-utils": "^0.0.0-2021-06-23--15-11", | ||
"test-all-versions": "^5.0.1" | ||
"opentelemetry-instrumentation-mocha": "0.0.1-rc.5", | ||
"opentelemetry-instrumentation-testing-utils": "^0.0.0-2021-08-01--12-54", | ||
"test-all-versions": "^5.0.1", | ||
"typescript": "4.3.4" | ||
}, | ||
@@ -69,3 +73,3 @@ "mocha": { | ||
}, | ||
"gitHead": "7faff48d9d7740fef1b799dbbaf1dddc673aa97e" | ||
"gitHead": "1c0b880a714e23ed5ba1ca97c35f49dc21064d8f" | ||
} |
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
100655
25
621
6
14
+ Addedparseurl@~1.3.3
+ Addedpath-to-regexp@0.1.7
+ Added@opentelemetry/api@1.9.0(transitive)
+ Added@opentelemetry/api-metrics@0.24.0(transitive)
+ Added@opentelemetry/core@0.24.0(transitive)
+ Added@opentelemetry/instrumentation@0.24.0(transitive)
+ Added@opentelemetry/semantic-conventions@0.24.0(transitive)
+ Addedparseurl@1.3.3(transitive)
+ Addedpath-to-regexp@0.1.7(transitive)
- Removed@opentelemetry/api@0.21.0(transitive)
- Removed@opentelemetry/api-metrics@0.21.0(transitive)
- Removed@opentelemetry/core@0.21.0(transitive)
- Removed@opentelemetry/instrumentation@0.21.0(transitive)
- Removed@opentelemetry/semantic-conventions@0.21.0(transitive)
Updated@opentelemetry/core@^0.24.0