RuntimeTools / appmetrics

Node Application Metrics provides a foundational infrastructure for collecting resource and performance monitoring data for Node.js-based applications.
https://developer.ibm.com/open/node-application-metrics/
Apache License 2.0
970 stars 125 forks source link

'http' event triggered twice #611

Open yuecchen opened 4 years ago

yuecchen commented 4 years ago

here is our code to using appmetrics:

var appmetrics = require('appmetrics');
var monitor = appmetrics.monitor();
monitor.on('http', function(data){console.info(data.time, data.duration, data.url, data.statusCode)});

I triggered request manually, and each trigger will generate two exactly same request:

[root@joycevm1 server]# node server-test.js
[Mon Sep 16 22:52:50 2019] com.ibm.diagnostics.healthcenter.loader INFO: Node Application Metrics 5.0.3.201908020747 (Agent Core 4.0.3)
[Mon Sep 16 22:52:50 2019] com.ibm.diagnostics.healthcenter.mqtt INFO: Connecting to broker localhost:1883
Web server listening at: http://0.0.0.0:3001
1568699579362 32.80413 /api/pets/1 304
1568699579362 32.80413 /api/pets/1 304
1568699624992 6.686025 /api/pets/1 304
1568699624992 6.686025 /api/pets/1 304

it would happen when I do /api/pets or /api/pets/xxx request, only one event is trigger when I use /

a sample application will is uploaded: pets.zip