Authored by htoooth

fix

... ... @@ -74,11 +74,18 @@ module.exports = {
if (isProduction) {
Object.assign(module.exports, {
report: {
reportApi: {
host: '10.66.0.139',
port: 8086,
db: 'web-apm',
measurement: 'api-duration',
measurement: 'api-info',
duration: 2000,
records: 10
},
reportRoute: {
host: '10.66.0.139',
db: '8086',
measurement: 'route-info',
duration: 2000,
records: 10
},
... ... @@ -95,10 +102,17 @@ if (isProduction) {
}
if (isTest) {
Object.assign(module.exports, {
report: {
reportApi: {
host: 'influxdblog.web.yohoops.org',
db: 'web-apm',
measurement: 'api-info',
duration: 2000,
records: 10
},
reportRoute: {
host: 'influxdblog.web.yohoops.org',
db: 'web-apm',
measurement: 'api-duration',
measurement: 'route-info',
duration: 2000,
records: 10
},
... ...
... ... @@ -11,7 +11,8 @@ function slowRouter(m) {
udid: _.get(m, 'fields.udid', ''),
api: _.get(m, 'tags.api', ''),
route: _.get(m, 'tags.route', ''),
duration: _.get(m, 'fields.duration', '')
duration: _.get(m, 'fields.duration', ''),
create_time: _.get(m, 'time')
};
}
... ... @@ -28,7 +29,8 @@ function errorRouter(m) {
column: _.get(m, 'fields.column', ''),
script: _.get(m, 'fields.script', ''),
message: _.get(m, 'fields.message', ''),
stack: _.get(m, 'fields.stack', '')
stack: _.get(m, 'fields.stack', ''),
create_time: _.get(m, 'time')
};
}
... ...
... ... @@ -8,7 +8,7 @@ const msg2row = require('./msg2row');
const errorSender = new MysqlSender(config.table.error);
const slowRouterSender = new MysqlSender(config.table.slow);
const influxSender = new Sender(config.report);
const influxSender = new Sender(config.reportRoute);
const server = {
async handle(data) {
... ... @@ -35,4 +35,4 @@ module.exports = function(req, res, next) {
server.handle(data).then(() => {
res.json();
}).catch(next);
};
\ No newline at end of file
};
... ...