
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
express-zipkin-instrumentation
Advanced tools
Convenience package for instrumenting an Express application with Zipkin request tracing used in the MCF project.
npm add express-zipkin-instrumentation --save;
const server = express();
// ...
const expressZipkinInstrumentation = require('express-zipkin-instrumentation');
server.use(expressZipkinInstrumentation(
'service-name',
'http://zipkin.yourdomain.com',
));
The above will result in a service identified in the Zipkin dashboard as
service-name
.
const server = express();
// ...
const expressZipkinInstrumentation = require('express-zipkin-instrumentation');
server.use(expressZipkinInstrumentation(
'service-name',
'http://zipkin.yourdomain.com',
{
serviceNamePostfix: 'development'
}
))
The above will result in a service identified in the Zipkin dashboard as
service-name-development
.
.constructor()
Using the following to include the package:
const expressZipkinInstrumentation = require('express-zipkin-instrumentation');
The expressZipkinInstrumentation
variable will be a function that returns the correct middleware. The arguments are:
:serviceName
:zipkinHostname
null
(the default behaviour if this is not specified), the trace logs will be routed to stdout
instead via console.trace
.:options
(optional)
:serviceNamePostfix
: this will be appended to the :serviceName
parameter in dashed-case.const expressZipkinInstrumentation = require('express-zipkin-instrumentation');
const server = require('express')();
server.use(expressZipkinInstrumentation(/* ... */));
// ...
.getContext()
Retrieves the context used to initialise the zipkin instrumentation.
const expressZipkinInstrumentation = require('express-zipkin-instrumentation');
const server = require('express')();
server.use(expressZipkinInstrumentation(/* ... */));
expressZipkinInstrumentation.getContext();
// ...
.getInstance()
Retrieves the zipkin instrumentation instance.
const expressZipkinInstrumentation = require('express-zipkin-instrumentation');
const server = require('express')();
server.use(expressZipkinInstrumentation(/* ... */));
expressZipkinInstrumentation.getInstance();
// ...
.getParentId()
Retrieves the parent trace ID of the current request.
const expressZipkinInstrumentation = require('express-zipkin-instrumentation');
const server = require('express')();
server.use(expressZipkinInstrumentation(/* ... */));
server.use((req, res, next) => {
console.info(expressZipkinInstrumentation.getParentId()); // matches /[0-9a-f]{16}/gi
next();
});
// ...
Throws an error if
expressZipkinInstrumentation(/* ... */)
was not called yet.
.getRecorder()
Retrieves the recorder used to initialise the zipkin instrumentation.
const expressZipkinInstrumentation = require('express-zipkin-instrumentation');
const server = require('express')();
server.use(expressZipkinInstrumentation(/* ... */));
expressZipkinInstrumentation.getRecorder();
// ...
.getSpanId()
Retrieves the span ID of the current request.
const expressZipkinInstrumentation = require('express-zipkin-instrumentation');
const server = require('express')();
server.use(expressZipkinInstrumentation(/* ... */));
server.use((req, res, next) => {
console.info(expressZipkinInstrumentation.getSpanId()); // matches /[0-9a-f]{16}/gi
next();
});
// ...
Throws an error if
expressZipkinInstrumentation(/* ... */)
was not called yet.
.getTraceId()
Retrieves the trace ID of the current request.
const expressZipkinInstrumentation = require('express-zipkin-instrumentation');
const server = require('express')();
server.use(expressZipkinInstrumentation(/* ... */));
server.use((req, res, next) => {
console.info(expressZipkinInstrumentation.getTraceId()); // matches /[0-9a-f]{16}/gi
next();
});
// ...
Throws an error if
expressZipkinInstrumentation(/* ... */)
was not called yet.
Run tests using:
npm run test
To run them in watch mode:
npm run test-watch
The following environment variables have to be set in Travis for the pipeline to work
GH_USERNAME
: GitHub usernameGH_ACCESS_TOKEN
: GitHub personal access tokenNPM_PACKAGE_PUBLISH_NAME
: Package name to publish this asNPM_REGISTRY_URL
: Hostname of NPM registry being usedNPM_TOKEN
: NPM access tokenGIT_ORIGIN_REMOTE_PATH
: Path to repository in GitHubThis package is licensed under the MIT license.
FAQs
Convenience package for instrumenting an Express application with Zipkin request tracing used in the MCF project.
The npm package express-zipkin-instrumentation receives a total of 0 weekly downloads. As such, express-zipkin-instrumentation popularity was classified as not popular.
We found that express-zipkin-instrumentation 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
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.