Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
koa-actuator
Advanced tools
Readme
Healthcheck and monitoring middleware for koa inspired by java spring's actuators
$ npm install koa-actuator --save
const Koa = require('koa');
const actuator = require('koa-actuator');
const app = new Koa();
//...
app.use(actuator());
//...
app.listen(3000);
Ones you start your koa application, it will add several service endpoints such as /health, /env, etc.
The list of service endpoints and examples of responses is below:
Performs health checks and returns the results:
{
"status": "UP",
"db": {
"status": "UP",
"freeConnections": 10
},
"redis": {
"status": "UP",
"usedMemory": "52m",
"uptimeDays": 16
}
}
The statuses of the health checks are aggregated in a root-level status
field. If at least one check yields DOWN
status, the aggregated status will become DOWN
. Health checks can be defined on actuator construction:
const healthChecks = {
db: async () => {
return {
status: (await isDbAlive()) ? 'UP' : 'DOWN',
freeConnections: await freeDbConnectionsLeft()
}
},
//...
};
app.use(actuator(healthChecks));
A check can return an object of an arbitrary structure. If the returned structure contains status
field, it will be counted in the aggregated status.
Exposes environment properties and command line arguments. Variables that likely to be secure (contain 'user', 'password', 'pass' etc in their names) will be replaced by *******
{
"systemEnvironment": {
"OLDPWD": "*******",
"NVM_DIR": "/Users/yyyy/.nvm",
"USER": "*******",
"NVM_BIN": "/Users/yyyy/.nvm/versions/node/v7.9.0/bin",
"HTTP_PORT": "3000"
},
"arguments": [
"/Users/yyyy/.nvm/versions/node/v7.9.0/bin/node",
"/Users/yyyy/nodeProjects/koa-act-test/index",
"myarg=test"
]
}
Main application info from package.json
{
"build": {
"version": "1.0.0",
"name": "koa-act-test",
"main": "index.js",
"description": "test"
}
}
{
"timestamp": 1494242326200,
"uptime": 8.017,
"processors": 8,
"heap": 10403840,
"heap.used": 7057224,
"resources": {
"memory": {
"rss": 27021312,
"heapTotal": 10403840,
"heapUsed": 7057224,
"external": 43578
},
"loadavg": [
1.89794921875,
1.7880859375,
1.75634765625
],
"cpu": "...",
"nics": "..."
}
}
FAQs
Healthcheck and monitoring middleware for koa inspired by java spring's actuators
The npm package koa-actuator receives a total of 435 weekly downloads. As such, koa-actuator popularity was classified as not popular.
We found that koa-actuator 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.