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
974 stars 125 forks source link

appmetrics have conflict with appmetrics-zipkin when enable trace #589

Closed yuecchen closed 5 years ago

yuecchen commented 5 years ago

appmetrics have conflict with appmetrics-zipkin when enable trace

here is the error message:

/root/joyce/pets/node_modules/appmetrics/probes/trace-probe.js:57
  ret.__ddProbeAttached__ = function() {
                          ^

TypeError: Cannot create property '__ddProbeAttached__' on boolean 'false'
    at TraceProbe.attach (/root/joyce/pets/node_modules/appmetrics/probes/trace-probe.js:57:27)
    at /root/joyce/pets/node_modules/appmetrics/index.js:158:27
    at Module.newFunc (/root/joyce/pets/node_modules/appmetrics/lib/aspect.js:102:14)
    at Module.newFunc [as require] (/root/joyce/pets/ibmapm/appmetrics-zipkin/lib/aspect.js:101:26)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/root/joyce/pets/node_modules/cross-spawn/lib/parse.js:4:27)
    at Module._compile (module.js:653:30)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)

code may like the following:

var appmetrics = require('appmetrics');
var zipkin = require('appmetrics-zipkin');
//composing zipkinOptions
...
//composed zipkinOptions
zipkin(zipkinOptions);
appmetrics.enable('trace');
rwalle61 commented 5 years ago

Thanks, we will recreate this then let you know the resolution

tobespc commented 5 years ago

I don't think these 2 play well together. You probably need to disable the trace probe in app metrics if using zipkin as that has similar functions

yuecchen commented 5 years ago

Didn't find same problem in appmetrics 5.0.3