Security News
The Push to Ban Ransom Payments Is Gaining Momentum
Ransomware costs victims an estimated $30 billion per year and has gotten so out of control that global support for banning payments is gaining momentum.
c3d-opentracing-auto
Advanced tools
Readme
Out of the box distributed tracing for Node.js applications with OpenTracing. Support multiple Tracers.
WARNING: experimental library, do not use in production yet
Requirements
npm install c3d-opentracing-auto
// must be in the first two lines of your application
const Instrument = require('c3d-opentracing-auto')
const { Tracer } = require('opentracing') // or any OpenTracing compatible tracer like jaeger-client
const tracer1 = new Tracer()
const tracer2 = new Tracer()
const instrument = new Instrument({
tracers: [tracer1, tracer2]
})
// rest of your code
const express = require('express')
// ...
This package depends on require-in-the-middle and shimmer to monkeypatch tracing information onto the modules listed below. Therefore it is crucial that you require() supported modules after creating the tracing instrument.
If you are using node 8.5+'s experimental module support, you will need to manually hook supported modules:
import Instrument from '@risingstack/opentracing-auto';
import jaeger from 'jaeger-client';
import UDPSender from 'jaeger-client/dist/src/reporters/udp_sender';
import http from 'http';
const instrument = new Instrument({
tracers: [
new jaeger.Tracer(
'my-service-name',
new jaeger.RemoteReporter(new UDPSender.default({ host: 'my-jaeger-host' })),
new jaeger.RateLimitingSampler(1),
{}
),
],
});
instrument.hookModule(http, 'http');
Instrument modules.
tracers
: Array of OpenTracing compatible tracers
httpTimings
: Adds HTTP timings (DNS lookup, Connect, TLS, Time to first byte, Content transfer)
Unpatch instrumentations
The example require a running MongoDB and Jaeger.
To start Jaeger and visit it's dashboard:
docker run -d -p5775:5775/udp -p6831:6831/udp -p6832:6832/udp -p5778:5778 -p16686:16686 -p14268:14268 jaegertracing/all-in-one:latest && open http://localhost:16686
npm run example
curl http://localhost:3000
open http://localhost:16686
You can enable it with the httpTimings: true
Start your application with the DEBUG=opentracing-auto*
environment variable.
FAQs
Out of the box OpenTracing instrumentation for Node.js
We found that c3d-opentracing-auto demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Ransomware costs victims an estimated $30 billion per year and has gotten so out of control that global support for banning payments is gaining momentum.
Application Security
New SEC disclosure rules aim to enforce timely cyber incident reporting, but fear of job loss and inadequate resources lead to significant underreporting.
Security News
The Python Software Foundation has secured a 5-year sponsorship from Fastly that supports PSF's activities and events, most notably the security and reliability of the Python Package Index (PyPI).