dataflux(https://www.dataflux.cn) express middleware, collect data push to dataway(dataflux data getaway)
npm install dataflux-node-express- 版本说明
该版本为初版,还未在生产级环境下使用
- 使用说明
1. 安装
```
npm i dataflux-node-express
2. 使用
`
const express = require('express');
const app = express();
const dataflux = require('dataflux-node-express');
app.use(dataflux({
"dataway": "http://10.100.64.106:19528/v1/write/metrics",
"measurement": "dataflux-node-express",
"appName": "express-test"
}));
app.get('/', function (req, res) {
res.send('Hello World!');
});
app.listen(3000, function () {
console.log('Example app listening on port 3000!');
});
``
3. 中间件参数说明
- dataway:
dataway地址 // 参考:https://help.dataflux.cn/doc/71d7cf4ae44cebf9acb0a6a770254ed2837c10ee
- measurement:
指标集名称 // 默认值:dataflux-node-express
-appName:
app应用 // express
4. 采集数据
| 指标 | 描述 | 类型 | 单位 | Tag |
| :-- | ---- | ---- | ---- | ----- |
| method | 请求方法 | string | - | appname, host |
| path | 请求路由 | string | - | appname,host |
| status | 状态 | int | - | appname,host |
| responseTime | 处理时长 | string | - | appname,host |