Showing
1 changed file
with
20 additions
and
0 deletions
@@ -21,6 +21,23 @@ const server = { | @@ -21,6 +21,23 @@ 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 | + | ||
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') { | ||
24 | influxSender.addMessage({ | 41 | influxSender.addMessage({ |
25 | measurement: 'route-info', | 42 | measurement: 'route-info', |
26 | tags: { | 43 | tags: { |
@@ -33,8 +50,11 @@ const server = { | @@ -33,8 +50,11 @@ const server = { | ||
33 | duration: m.duration | 50 | duration: m.duration |
34 | } | 51 | } |
35 | }); | 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 | } |
-
Please register or login to post a comment