npm install @middleware.io/node-apm --save
const tracker = require('@middleware.io/node-apm'); tracker.track({ projectName: "your-project-name", serviceName: "your-service-name", });
Step 2
tracker.info('Info sample'); tracker.warn('Warning sample'); tracker.debug('Debugging Sample'); tracker.error('Error Sample');
tracker.error(new Error('Error sample with stack trace'));
mw-agent-ns-{FIRST-5-LETTERS-OF-API-KEY}
mw-agent-ns
MW_AGENT_SERVICE=mw-service.NAMESPACE.svc.cluster.local
app.get('/error', function (req, res) { try{ throw new Error('oh error!'); }catch (e) { track.errorRecord(e) } res.status(500).send("wrong"); });
Was this page helpful?