UNPKG

elastic-apm-node

Version:

The official Elastic APM agent for Node.js

14 lines (9 loc) 299 B
'use strict' const Stats = require('./stats') module.exports = function createSystemMetrics (registry) { const stats = new Stats() registry.registerCollector(stats) for (let metric of Object.keys(stats.toJSON())) { registry.getOrCreateGauge(metric, () => stats.toJSON()[metric]) } }