Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jaeger-tracer

Package Overview
Dependencies
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jaeger-tracer - npm Package Compare versions

Comparing version 1.0.6 to 1.0.7

2

build/ClsManager.js

@@ -10,3 +10,3 @@ "use strict";

session.set(constants_1.constants.mainSpan, mainSpan);
interceptorMiddleware(req, res, next);
next();
};

@@ -13,0 +13,0 @@ exports.saveToCls = function (key, value) {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var _a = require('opentracing'), Tags = _a.Tags, FORMAT_HTTP_HEADERS = _a.FORMAT_HTTP_HEADERS;
var interceptor = require('express-interceptor');
var express_mung_1 = require("express-mung");
exports.setReqSpanData = function (req, res, span) {

@@ -25,3 +25,6 @@ span.setTag(Tags.HTTP_URL, req.path);

});
var responseInterceptor = function (body, send) {
res.once('finish', function () {
mainInterceptorMW(req, res, function () { });
});
var responseInterceptor = function (body, req, res) {
span.log({

@@ -33,11 +36,6 @@ event: 'response',

span.finish();
return send(body);
return body;
};
return interceptor(function (req, res) {
return {
isInterceptable: function () { return true; },
intercept: responseInterceptor
};
});
var mainInterceptorMW = express_mung_1.json(responseInterceptor);
};
//# sourceMappingURL=spanDataSetter.js.map
{
"name": "jaeger-tracer",
"version": "1.0.6",
"version": "1.0.7",
"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",

@@ -32,6 +32,6 @@ import { createNamespace } from 'continuation-local-storage';

// this middleware should call next inside it automatically
interceptorMiddleware(req, res, next);
// interceptorMiddleware(req, res, next);
// going to the next middleware normally
// next();
next();
// });

@@ -38,0 +38,0 @@ }

import { Request, Response } from "express";
import { Span } from "./interfaces/jaegaer-span.interface";
const { Tags, FORMAT_HTTP_HEADERS } = require('opentracing');
let interceptor = require('express-interceptor');
import { json } from 'express-mung';

@@ -31,3 +31,7 @@ export let setReqSpanData = (req: Request, res: Response, span: Span) => {

let responseInterceptor = (body: any, send: Function) => {
res.once('finish', () => {
mainInterceptorMW(req, res, () => { });
});
let responseInterceptor = (body: any, req: Request, res: Response) => {
span.log({

@@ -40,13 +44,6 @@ event: 'response',

return send(body);
return body;
}
return interceptor((req: Request, res: Response) => {
return {
// just return true means that any kind of response need to be intercepted
isInterceptable: () => true,
// this is the function that will happen on response interception
intercept: responseInterceptor
};
});
let mainInterceptorMW = json(responseInterceptor);
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc