New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.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.8 to 1.0.9

11

build/spanDataSetter.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var _a = require('opentracing'), Tags = _a.Tags, FORMAT_HTTP_HEADERS = _a.FORMAT_HTTP_HEADERS;
var express_mung_1 = require("express-mung");
var Tags = require('opentracing').Tags;
exports.setReqSpanData = function (req, res, span) {
span.setTag(Tags.HTTP_URL, req.path);
span.setTag(Tags.HTTP_METHOD, req.method);
span.setTag('Hostname', req.hostname);
span.log({

@@ -13,2 +14,3 @@ event: 'request',

query: req.query,
headers: req.headers
});

@@ -23,5 +25,9 @@ return span;

error: err,
headers: res.getHeaders
});
span.finish();
});
res.once('finish', function () {
span.finish();
});
var responseInterceptor = function (body, req, res) {

@@ -31,5 +37,6 @@ span.log({

status: 'normal',
statusCode: res.statusCode,
body: body,
headers: res.getHeaders,
});
span.finish();
return body;

@@ -36,0 +43,0 @@ };

2

package.json
{
"name": "jaeger-tracer",
"version": "1.0.8",
"version": "1.0.9",
"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",

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

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

span.setTag(Tags.HTTP_METHOD, req.method);
span.setTag('Hostname', req.hostname);
span.log({

@@ -15,2 +16,3 @@ event: 'request',

query: req.query,
headers: req.headers
});

@@ -28,3 +30,3 @@ return span;

error: err,
// body: ''
headers: res.getHeaders
});

@@ -34,2 +36,7 @@ span.finish();

res.once('finish', () => {
// just finishing the span in case the mung did not work
span.finish();
});
// do not forget the error case test

@@ -40,5 +47,6 @@ let responseInterceptor = (body: any, req: Request, res: Response) => {

status: 'normal',
statusCode: res.statusCode,
body,
headers: res.getHeaders,
});
span.finish();

@@ -45,0 +53,0 @@ return body;

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