Influx Express Middleware
This repository contains express middleware for logging request and response metrics to InfluxDB.
Usage
First add influx-express
to your project:
$ cd /path/to/node/project$ npm install --save influx-express
To enable the express logging middleware do the following:
var express = var influxExpress = var app = app app app
Changing the client defaults
var influxOpts = protocol: "https" host: "fourbyfour-923ah8ar.influxcloud.net" port: 8086 database: "mydb" username: "myuser" password: "mypass" batchSize: 10 app
Data
Currently this example implementation only gathers the following data. If you have some data you would like to see gathered by this plugin please open an issue.
database: 'node' measurement: 'requests' tags: - path: req.path - host: req.hostname - verb: req.method - status: req.statusCode fields: - responseTime: req.startTime - res.finishTime