npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

jaeger-tracer

v1.1.8

Published

client library for jaegar to ease out the instrumenting in express and any other backend application based on express in nodejs

Downloads

37

Readme

Jaeger-tracer

This is a module for jaeger instrumentation to allow your node backend with just four lines of code and the require statements included to be able to send the incoming and outgoing requests and responses data to the jaeger backend.

npm version Dependency Status

Table of contents

Installation

npm install jaeger-tracer

Usage

All you need to do is include the following middleware in your app with the following way

let { jaegarTracerMiddleware } = require('jaeger-tracer');
let http = require('http');
let https = require('https');


// some middlewares
// body parser middleware

// jaeger tracer middleware here
app.use(jaegarTracerMiddleware({ http, https }, '<app name here>', {
	reporter: {
	    // host name of your 
		agentHost:  'jaegar'
	}
}
));

This is the simplest usage of package you can customize the collector host and many other data through the configs which we will be describing later.


How the package works

Inside the package we just log the incoming requests and their responses from this backend the middleware takes the http or https to be able to monkey patch the http.request or https.request functions and put the tracer headers in any outgoing requests to third party backends. Also the it extracts the headers from any incoming requests to relate spans with the parent child relations. basically everything from extracting and injecting the headers happens inside.

Important notes

The package inside use the continuation-local-storage so , be careful to lose the context also there is a function which gets you the context to be able to pass it over if its lost in some place in your code.

API Reference

The package exports the following functions to give you full control and flexibility below we will list the function telling what is the usage of each one and what do they do.

jaegarTracerMiddleware

initTracer

makeSpan

makeSpanWithParent

spanMaker

getContext

unirestWrapper

requestWrapper

getInjectionHeaders