opentelemetry-instrumentation-express
Advanced tools
Comparing version 0.22.0 to 0.22.1
@@ -6,2 +6,13 @@ # Change Log | ||
## [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) | ||
@@ -8,0 +19,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 |
@@ -43,3 +43,3 @@ "use strict"; | ||
}; | ||
exports.getLayerPathFromFirstArg = (path, options) => { | ||
const getLayerPathFromFirstArg = (path, options) => { | ||
const alternatives = getLayerPathAlternativeFromFirstArg(path, options); | ||
@@ -56,2 +56,3 @@ if (!alternatives) | ||
}; | ||
exports.getLayerPathFromFirstArg = getLayerPathFromFirstArg; | ||
//# sourceMappingURL=layer-path.js.map |
@@ -8,3 +8,3 @@ "use strict"; | ||
const parseurl_1 = __importDefault(require("parseurl")); | ||
exports.getUsedPathFromLayerPath = (layerPath, actualUrl) => { | ||
const getUsedPathFromLayerPath = (layerPath, actualUrl) => { | ||
var _a; | ||
@@ -31,3 +31,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; | ||
@@ -57,3 +58,4 @@ 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. | ||
@@ -65,2 +67,3 @@ // thus, we cannot call req.path | ||
}; | ||
exports.createInitialRouteState = createInitialRouteState; | ||
//# sourceMappingURL=route-context.js.map |
@@ -1,2 +0,2 @@ | ||
export declare const VERSION = "0.22.0"; | ||
export declare const VERSION = "0.22.1"; | ||
//# sourceMappingURL=version.d.ts.map |
@@ -5,3 +5,3 @@ "use strict"; | ||
// this is autogenerated file, see scripts/version-update.js | ||
exports.VERSION = '0.22.0'; | ||
exports.VERSION = '0.22.1'; | ||
//# sourceMappingURL=version.js.map |
{ | ||
"name": "opentelemetry-instrumentation-express", | ||
"version": "0.22.0", | ||
"version": "0.22.1", | ||
"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", | ||
@@ -56,4 +57,5 @@ "README.md" | ||
"opentelemetry-instrumentation-mocha": "0.0.1-rc.3", | ||
"opentelemetry-instrumentation-testing-utils": "^0.22.0", | ||
"test-all-versions": "^5.0.1" | ||
"opentelemetry-instrumentation-testing-utils": "^0.22.1", | ||
"test-all-versions": "^5.0.1", | ||
"typescript": "4.3.4" | ||
}, | ||
@@ -70,3 +72,3 @@ "mocha": { | ||
}, | ||
"gitHead": "e9f830a131164f45fcfff1a527a0ade411e5e977" | ||
"gitHead": "1b95f429902c848b03570501648d88c82ce78d46" | ||
} |
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
100153
25
621
14