Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
monitor-dog
Advanced tools
Wraps dogstatsd to provide environment based event scoping (prefixing) and timers.
// Assume `process.env.MONITOR_PREFIX === 'myProject'`, then all events
// triggered via monitor dog will be prefixed with `myProject.`.
var monitor = require('monitor-dog');
// Trigger an increment (`myProject.requests`)
monitor.increment('requests');
// Trigger an increment with additional parameters
monitor.increment('requests', 1, ['env:prod', 'host': '127.0.0.1']);
// Trigger an increment with tags as object
monitor.increment('requests', 1, {env: 'prod', host: '127.0.0.1'});
// Trigger a gauge event (`myProject.404s`)
monitor.gauge('404s');
// Time requests...
var timer = monitor.timer('request.time');
request('http://example.com', function(req, res) {
// Triggers a histogram event to `myProject.request.time`
timer.stop();
});
These methods behave exactly as you would expect on a regular dogstatsd Client.
Creates and returns new timer with the given name
. Optional boolean
startNow
can be provided to start the timer at a later date using the
.start
method.
// Create the timer
var sumTimer = monitor.timer('sum.time');
// Perform a computation
var sum = 0;
for (var i = 0; i < 1000000; i++) {
sum += i;
}
// Call .stop() to send a histogram event named 'sum.time'
// with the recorded duration...
sumTimer.stop();
var requestTimer = monitor.timer('request.time');
request('/some/endpoint', function (err, res) {
requestTimer.stop();
});
var delayedTime = monitor.timer('delayed.timer', false);
// ... Do some other stuff ...
delayedTimer.start();
// ... Do some more stuff ...
delayedTimer.stop();
Automatically track number of open & pending sockets and open files.
// start monitoring once you start web server
// default interval defined by `process.env.MONITOR_INTERVAL`
monitor.startSocketsMonitor();
// stop monitoring before stopping web server
monitor.stopSocketsMonitor();
MIT
FAQs
A helpful wrapper for dogstatsd.
The npm package monitor-dog receives a total of 10 weekly downloads. As such, monitor-dog popularity was classified as not popular.
We found that monitor-dog 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
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.