jaeger-tracer
Advanced tools
Comparing version 1.0.10 to 1.0.11
"use strict"; | ||
var __assign = (this && this.__assign) || function () { | ||
__assign = Object.assign || function(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) | ||
t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
return __assign.apply(this, arguments); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -24,17 +35,14 @@ var express_mung_1 = require("express-mung"); | ||
error: err, | ||
headers: res.getHeaders() | ||
headers: this.getHeaders(), | ||
statusCode: this.statusCode | ||
}); | ||
span.finish(); | ||
}); | ||
var responseSpanLog = {}; | ||
res.once('finish', function () { | ||
span.log(__assign({}, responseSpanLog, { headers: this.getHeaders(), statusCode: this.statusCode })); | ||
span.finish(); | ||
}); | ||
var responseInterceptor = function (body, req, res) { | ||
span.log({ | ||
event: 'response', | ||
status: 'normal', | ||
statusCode: res.statusCode, | ||
body: body, | ||
headers: res.getHeaders(), | ||
}); | ||
responseSpanLog = __assign({}, responseSpanLog, { event: 'response', status: 'normal', body: body }); | ||
return body; | ||
@@ -41,0 +49,0 @@ }; |
{ | ||
"name": "jaeger-tracer", | ||
"version": "1.0.10", | ||
"version": "1.0.11", | ||
"description": "client library for jaegar to ease out the instrumenting in express and any other backend application based on express in nodejs", | ||
@@ -5,0 +5,0 @@ "main": "build/index.js", |
@@ -23,3 +23,3 @@ import { Request, Response } from "express"; | ||
// listening to the error | ||
res.once('error', (err) => { | ||
res.once('error', function (this: Response, err: Error) { | ||
span.log({ | ||
@@ -29,3 +29,4 @@ event: 'response', | ||
error: err, | ||
headers: res.getHeaders() | ||
headers: this.getHeaders(), | ||
statusCode: this.statusCode | ||
}); | ||
@@ -35,4 +36,11 @@ span.finish(); | ||
res.once('finish', () => { | ||
let responseSpanLog = {}; | ||
res.once('finish', function (this: Response) { | ||
// just finishing the span in case the mung did not work | ||
span.log({ | ||
...responseSpanLog, | ||
headers: this.getHeaders(), | ||
statusCode: this.statusCode | ||
}); | ||
span.finish(); | ||
@@ -43,9 +51,8 @@ }); | ||
let responseInterceptor = (body: any, req: Request, res: Response) => { | ||
span.log({ | ||
responseSpanLog = { | ||
...responseSpanLog, | ||
event: 'response', | ||
status: 'normal', | ||
statusCode: res.statusCode, | ||
body, | ||
headers: res.getHeaders(), | ||
}); | ||
}; | ||
@@ -52,0 +59,0 @@ return body; |
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
67763
981