@gravity-ui/expresskit
Advanced tools
Comparing version 2.1.0 to 2.2.0
@@ -9,2 +9,3 @@ "use strict"; | ||
expressApp.use((req, res, next) => { | ||
var _a, _b; | ||
try { | ||
@@ -17,3 +18,3 @@ req.id = (req.headers[constants_1.DEFAULT_REQUEST_ID_HEADER] || (0, uuid_1.v4)()); | ||
const startTime = Date.now(); | ||
const userAgent = req.get('user-agent'); | ||
const userAgent = (_a = req.get('user-agent')) !== null && _a !== void 0 ? _a : 'unknown'; | ||
const parentSpanContext = ctx.extractSpanContext(req.headers); | ||
@@ -23,2 +24,3 @@ req.originalContext = req.ctx = ctx.create(`Express ${req.method}`, { | ||
loggerPostfix: `[${req.id}]`, | ||
spanKind: 1, // SERVER | ||
}); | ||
@@ -31,3 +33,3 @@ req.ctx.set(nodekit_1.REQUEST_ID_PARAM_NAME, req.id); | ||
req.ctx.setTag('referer', ctx.utils.redactSensitiveQueryParams(req.get('referer'))); | ||
req.ctx.setTag('remote_ip', req.ip); | ||
req.ctx.setTag('remote_ip', (_b = req.ip) !== null && _b !== void 0 ? _b : 'unknown'); | ||
req.ctx.setTag('request_id', req.id); | ||
@@ -43,3 +45,3 @@ req.ctx.setTag('user_agent', userAgent); | ||
method: req.method, | ||
url: ctx.utils.redactSensitiveQueryParams(req.url), | ||
url: ctx.utils.redactSensitiveQueryParams(req.path), | ||
}); | ||
@@ -46,0 +48,0 @@ const requestStartedExtra = ctx.config.appDevMode |
{ | ||
"name": "@gravity-ui/expresskit", | ||
"version": "2.1.0", | ||
"version": "2.2.0", | ||
"description": "Express.js wrapper for NodeKit-based apps", | ||
@@ -29,2 +29,3 @@ "main": "dist/index.js", | ||
"@gravity-ui/eslint-config": "^3.2.0", | ||
"@gravity-ui/nodekit": "^2.0.0", | ||
"@gravity-ui/prettier-config": "^1.1.0", | ||
@@ -59,3 +60,3 @@ "@gravity-ui/tsconfig": "^1.0.0", | ||
"peerDependencies": { | ||
"@gravity-ui/nodekit": "^1.6.0" | ||
"@gravity-ui/nodekit": "^1.6.0 || ^2.0.0" | ||
}, | ||
@@ -62,0 +63,0 @@ "nano-staged": { |
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
45367
951
22