hapi process monitoring
good is a hapi plugin to monitor and report on a variety of hapi server events as well as ops information from the host machine. It listens for events emitted by hapi server instances and pushes standardized events to a collection of streams.
const Hapi = require('@hapi/hapi');
const server = Hapi.server();
const options = {
ops: {
interval: 1000
},
reporters: {
myConsoleReporter: [
{
module: '@hapi/good-squeeze',
name: 'Squeeze',
args: [{ log: '*', response: '*' }]
},
{
module: '@hapi/good-console'
},
'stdout'
]
}
};
await server.register({
plugin: require('@hapi/good'),
options,
});
await server.start();
console.info(`Server started at ${ server.info.uri }`);
See the Reporter Interface section of the API documentation on how to configure reporters.
Looking for more examples? Check out the examples folder.
The following streams are maintained by the hapi community and are known to work with good. Any transform or write stream can work with good, these are just a few inside the hapijs organization.
See the API Reference.