Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Report metrics based on events generated by a given event emitter. Supports StatsD, Cloudwatch & custom backends.
Install using npm
npm install metromatic
var Metromatic = require('metromatic');
const backends = [
{
type: 'statsd',
host: 'localhost',
port: 8125
},
{
type: 'cloudwatch'
region: 'us-west-1',
groupName: 'MyService'
dimensions: { environment: NODE_ENV },
accessKeyId: AWS_CLOUDWATCH_KEY_ID,
secretAccessKey: AWS_CLOUDWATCH_ACCESS_KEY,
},
{
type: 'custom',
send: (type, name, data) => {
// handle metric storage
},
}
];
Metromatic.instrument(myEventEmitter, {
backends: backends,
metrics: [{
name: 'request_time',
type: 'timing', // timing or gauge currently supported
eventStart: 'request',
eventStop: 'response'
}, {
name: 'gauge_foo',
type: 'gauge',
eventGauge: 'hey'
}]
});
Eventually, timings and gauges metrics will be sent when myEventEmitter
emits the request
and response
events (for timing) or hey
event (for gauge).
If you just want to stop listening the object:
Metromatic.restore(myEventEmitter);
To keep track of multiple timings of the same event pass any id string as a parameter when emitting the events to differentiate them.
Run the tests using
npm test
At the moment supports timing
and gauges
metric types. You're more than welcome to express some code love in a Pull Request to make it even more awesome.
Also, if you feel like something is quite not right or want to suggest something, leave us an open issue.
FAQs
Listen events on an object and report metrics to StatsD
The npm package metromatic receives a total of 2 weekly downloads. As such, metromatic popularity was classified as not popular.
We found that metromatic demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers 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
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.