New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@bookmate/zipkin-express-helpers

Package Overview
Dependencies
Maintainers
3
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bookmate/zipkin-express-helpers

Add zipkin headers to Express request object and read them back

  • 0.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
3
Created
Source

zipkin-express-helpers

Instruments for adding zipkin headers to an Express request object and for reading them back.

Installation

npm install --save @bookmate/zipkin-express-helpers

Usage

If all you need is just to add zipkin headers to requests in Express (e.g. if you are using Express as a proxy), the most convenient way is to use a middleware:

const express = require('express');
const { createZipkinExpressMiddleware } = require('@bookmate/zipkin-express-helpers');

const localServiceName = 'name of this application';

const app = express();

app.use(createZipkinExpressMiddleware({localServiceName}));

For more fine-grained control, you may want to use ZipkinRequestDecorator (which is used in the middleware):

const express = require('express');
const { ZipkinRequestDecorator } = require('@bookmate/zipkin-express-helpers');

const localServiceName = 'name of this application';
const zipkinRequestDecorator = new ZipkinRequestDecorator({ localServiceName });

const customMiddleware = (req, res, next) => {
  zipkinRequestDecorator.addZipkinHeadersToRequest(req);
  // some custom logic
  next();
}

const app = express();

app.use(customMiddleware);

To read zipkin headers from a request, use readZipkinHeadersFromRequest function:

const { readZipkinHeadersFromRequest } = require('@bookmate/zipkin-express-helpers');

function myFunc(req) {
  const zipkinHeaders = readZipkinHeadersFromRequest(req);
  // do something with the headers
}

FAQs

Package last updated on 05 Feb 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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