Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
zipkin-instrumentation-axiosjs
Advanced tools
Library to instrument the axios HTTP-client to support zipkin.
Adds Zipkin tracing support for the axios JS HTTP client library. It supports all features of axios
.
npm install zipkin-instrumentation-axiosjs --save
You need to use wrapAxios
function to wrap the native axios
instance, and the axios
instance's type/functions/attributes are not affected. As a result, you can use zipkinAxios
the same as axios
For example:
const axios = require('axios');
const wrapAxios = require('zipkin-instrumentation-axiosjs');
const { Tracer, ExplicitContext, ConsoleRecorder } = require('zipkin');
const ctxImpl = new ExplicitContext(); // the in-process context
const recorder = new ConsoleRecorder();
const localServiceName = 'service-a'; // name of this application
const tracer = new Tracer({ ctxImpl, recorder, localServiceName });
const remoteServiceName = 'weather-api'; // name of the application you are
// calling (optional)
const zipkinAxios = wrapAxios(axios, { tracer, remoteServiceName });
zipkinAxios.get('/user?ID=12345')
.then(function (response) {
console.log(response);
})
.catch(function (error) {
console.log(error);
});
let axiosInstance = axios.create({
baseURL: 'https://some-domain.com/api/',
timeout: 1000,
headers: {'X-Custom-Header': 'foobar'}
});
axiosInstance = wrapAxios(axiosInstance, {tracer, remoteServiceName});
You can intercept requests or responses before they are handled by then or catch.
// Add a request interceptor
axios.interceptors.request.use(function (config) {
// Do something before request is sent
return config;
}, function (error) {
// Do something with request error
return Promise.reject(error);
});
// Add a response interceptor
axios.interceptors.response.use(function (response) {
// Do something with response data
return response;
}, function (error) {
// Do something with response error
return Promise.reject(error);
});
FAQs
Library to instrument the axios HTTP-client to support zipkin.
The npm package zipkin-instrumentation-axiosjs receives a total of 431 weekly downloads. As such, zipkin-instrumentation-axiosjs popularity was classified as not popular.
We found that zipkin-instrumentation-axiosjs 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.