Provided by: bonitoo.io
This template provides a dashboard for simple monitoring of a Node.js application. The dashboard charts basic process metrics and the response time of http requests and their response status 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.jscode - 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
