hapi-service-toolkit
Hapi plugin adding common functionality to a service
- /healthz endpoint will be added automatically for service health checking
- /metrics endpoint showing a set of different server/process/os metrics
Getting started
npm i --save hapi-service-toolkit
Example:
const Hapi.server load: sampleInterval: 1000 ; // register the plugin in your hapi serviceawait server;
Options
- metrics //metrics options
- opsInterval //interval in ms for capturing ops events
Endpoints
/healthz
OK
/metrics
In order to have a full metrics view, load.sampleInterval
must be provided at service creation time as well as metrics.opsInterval
when registering the plugin.