Provided by: bonitoo.io
This template provides a simple monitoring of Node.js application. Dashboard is showing basic process metrics and response time of http requests including response code.
The process metrics are generated from process.memoryUsage()))
, process.cpuUsage()
and process.resourceUsage()
functions.
In the InfluxDB UI, go to Settings->Templates and enter this URL: https://github.com/influxdata/community-templates/tree/master/Node.js/Node.js.yml
If you have your InfluxDB credentials configured in the CLI, you can install this template with:
influx apply https://github.com/influxdata/community-templates/tree/master/Node.js/Node.js.yml
This template includes the following:
- 1 Bucket:
iot_center
- 1 Label:
Node.js
- 1 Dashboards:
Node.js Application Monitoring
- 2 Variables:
Node_Service
, andNode_Host
- Load the dashboard according to the the paragraph above
- Copy monitor.js and env.js files
- Update InfluxDB credentials in
env.js
- Register
monitor.js
code - see the following example
const onboardInfluxDB = require('./influxdb/onboarding')
const {logEnvironment, INFLUX_URL} = require('./env')
const monitor = require('./monitor')
async function startApplication() {
const app = express()
// monitor application
monitor(app)
...
}
Author: Miroslav Malecha, https://www.bonitoo.io