UNPKG

ca-apm-probe

Version:

CA APM Node.js Agent monitors real-time health and performance of Node.js applications

37 lines (29 loc) 1.2 kB
var reporter = require('./metrics').getReporter(); var envInfo = require('./envinfo'); var configData = require('./configdata'); function reportPlatformMetrics() { if (!reporter) { reporter = require('./metrics').getReporter(); } if (!envInfo) { envInfo = require('./envinfo'); } reporter.reportStringMetric('Node Version', process.version); reporter.reportStringMetric('Platform', envInfo.getPlatformInfo()); if (envInfo.getProbePackage()) { reporter.reportStringMetric('Probe Version', envInfo.getProbePackage().version); } var probeOptions = configData.getProbeOptions(); var config = configData.getConfigData(); // report collector agent info if (probeOptions.hasOwnProperty("currentHost")) { reporter.reportStringMetric('Collector Host', probeOptions.currentHost); } if (probeOptions.hasOwnProperty("currentPort")) { reporter.reportStringMetric('Collector Port', probeOptions.currentPort); } if (probeOptions.hasOwnProperty("protocol")) { reporter.reportStringMetric('Protocol', probeOptions.protocol); } } module.exports.reportPlatformMetrics = reportPlatformMetrics;