Authored by htoooth

fix

@@ -60,7 +60,7 @@ function handleClientError(scope, item) { @@ -60,7 +60,7 @@ function handleClientError(scope, item) {
60 }, 60 },
61 fields: Object.assign({ 61 fields: Object.assign({
62 message: item.msg, 62 message: item.msg,
63 - useragent: scope.app, 63 + useragent: scope.useragent,
64 stack: item.st ? item.st.replace(/"/g, '') : '', 64 stack: item.st ? item.st.replace(/"/g, '') : '',
65 script: item.sc, 65 script: item.sc,
66 line: _.parseInt(item.ln || 0), 66 line: _.parseInt(item.ln || 0),
@@ -68,8 +68,11 @@ function handleClientError(scope, item) { @@ -68,8 +68,11 @@ function handleClientError(scope, item) {
68 }) 68 })
69 }); 69 });
70 70
71 - logger.debug('[client] error info [%s]', JSON.stringify(data));  
72 - errorRouterSqlSender.addMessage(msg2row.errorRouter(data)); 71 + const ipInfo = ipService.getIsp(scope.ip);
  72 + const row = Object.assign(msg2row.errorRouter(data), ipInfo, {ip: scope.ip});
  73 +
  74 + logger.debug('[client] error info [%s]', JSON.stringify(row));
  75 + errorRouterSqlSender.addMessage(row);
73 } 76 }
74 77
75 function handleClientFirst(scope, item) { 78 function handleClientFirst(scope, item) {
@@ -12,4 +12,13 @@ ON SCHEDULE EVERY 1 DAY STARTS '2018-5-24 0:0:0' @@ -12,4 +12,13 @@ ON SCHEDULE EVERY 1 DAY STARTS '2018-5-24 0:0:0'
12 ON COMPLETION PRESERVE DISABLE 12 ON COMPLETION PRESERVE DISABLE
13 DO CALL p_del_perf (3); 13 DO CALL p_del_perf (3);
14 14
15 -alter event e_del_perf_report on completion preserve enable;  
  15 +alter event e_del_perf_report on completion preserve enable;
  16 +
  17 +
  18 +
  19 +
  20 +ALTER TABLE error_report ADD ip varchar(15);
  21 +ALTER TABLE error_report ADD country varchar(15);
  22 +ALTER TABLE error_report ADD region varchar(20);
  23 +ALTER TABLE error_report ADD city varchar(20);
  24 +ALTER TABLE error_report ADD isp varchar(20);