
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
node-instrument
Advanced tools
Library to instrument your node application for graphite reporting
npm install node-instrument
var instrument = require('node-instrument')();
var options = {
carbonHost : '127.0.0.1',
carbonPort : 2003,
type : 'udp4', // [udp4, tcp4]
prefix : '',
suffix : '',
verbose : false,
interval : 5000,
callback : null,
localAddress: '0.0.0.0' // for tcp binding to specific network adapter
};
var instrument = require('node-instrument')({prefix: 'localhost'});
instrument.addObject({myMetric: 1});
instrument.send();
var instrument = require('node-instrument')({prefix: 'localhost'});
instrument.start();
instrument.addObject({myMetric: 1});
The 'put' and 'add' methods act slightly different.
put and putObject - replaces the value of a metric if it already exists in the queue.
add and addObject - adds to the value of a metric if it already exists in the queue.
instrument.add('server.metric1', 1);
instrument.addObject({myMetric: 1});
// or
instrument.addObject({myMetric: {sub: 1}});
// or
instrument.addObject({myMetric: {sub: 1},
deep: {
down: 1
}
});
Add metric name/values together
instrument.add('server.metric1', 1); // 'server.metric1' == 1
instrument.add('server.metric1', 1); // 'server.metric1' == 2
instrument.add('server.metric1', 1); // 'server.metric1' == 3
Add metric object/values together
instrument.addObject({myMetric: {sub: 1}}); // 'myMetric.sub' == 1
instrument.addObject({myMetric: {sub: 1}}); // 'myMetric.sub' == 2
instrument.addObject({myMetric: {sub: 1}}); // 'myMetric.sub' == 3
Returns a text readout of the current queue
Returns the number of metrics waiting in queue
Returns the current value of a metric in the queue
instrument.getValueByName('myMetric.sub'); // number
Internal logging function
Inserts or replaces the value of a metric in queue
Inserts or replaces each flattened metric in a queue
Manually flush the node-instrument queue and send to Graphite
instrument.send(); // Flushes the internal queue to the Graphite instance
Internal function to execute the options.callback
Convenience method for setting the Graphite Client after node-instrument has been initialized
Start the interval reporting of node-instrument
Stops the interval reporting of node-instrument
FAQs
A library to instrument your node application for Graphite reporting
The npm package node-instrument receives a total of 10 weekly downloads. As such, node-instrument popularity was classified as not popular.
We found that node-instrument 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.