Authored by htoooth

fix

@@ -21,20 +21,40 @@ const server = { @@ -21,20 +21,40 @@ const server = {
21 if (duration > config.slowRoute.min || duration < config.slowRoute.max) { 21 if (duration > config.slowRoute.min || duration < config.slowRoute.max) {
22 slowRouterSender.addMessage(msg2row.slowRouter(m)); 22 slowRouterSender.addMessage(msg2row.slowRouter(m));
23 } 23 }
24 - influxSender.addMessage({  
25 - measurement: 'route-info',  
26 - tags: {  
27 - app: m.tags.app,  
28 - hostname: m.tags.hostname,  
29 - route: m.tags.route  
30 -  
31 - },  
32 - fields: {  
33 - duration: m.duration  
34 - }  
35 - }); 24 +
  25 + if (m.tags.type.toLowerCase() === 'api') {
  26 + influxSender.addMessage({
  27 + measurement: 'api-info',
  28 + tags: {
  29 + app: m.tags.app,
  30 + hostname: m.tags.hostname,
  31 + api: m.tags.api
  32 + },
  33 + fields: {
  34 + duration: m.duration,
  35 + times: 1
  36 + }
  37 + });
  38 + }
  39 +
  40 + if (m.tags.type.toLowerCase() === 'route') {
  41 + influxSender.addMessage({
  42 + measurement: 'route-info',
  43 + tags: {
  44 + app: m.tags.app,
  45 + hostname: m.tags.hostname,
  46 + route: m.tags.route
  47 +
  48 + },
  49 + fields: {
  50 + duration: m.duration
  51 + }
  52 + });
  53 + }
36 } else if (m.measurement === 'error-report') { 54 } else if (m.measurement === 'error-report') {
37 errorSender.addMessage(msg2row.errorRouter(m)); 55 errorSender.addMessage(msg2row.errorRouter(m));
  56 + } else if (m.measurement === 'process-info') {
  57 + influxSender.addMessage(m);
38 } 58 }
39 } 59 }
40 } 60 }