Nextapm
Monitor the nodejs application built in any framework and supports node version 14 and above.
Installation
npm i nodeapm
Instrument
Include the nodeapm module in the fire line of application start file.
require('nodeapm'); // should be in first line
... your app imports...
For Typescript/ES6 application use import rather than require.
import 'nodeapm'; // should be in first line
... your app imports...
Track Exceptions
Inorder to track exception, use following agent api.
const nodeapm = require('nodeapm');
... your app imports...
try {
...your app code ...
} catch (e) {
nodeapm.trackException(e);
}
import { trackException } from 'nodeapm';
... your app imports...
try {
...your app code ...
} catch (e) {
trackException(e);
}
Evnironment variables
Configure following environment values, you can get it from https://app.nextapm.dev after creating monitor NEXTAPM_LICENSE_KEY NEXTAPM_PROJECT_ID
Restart/ Redeploy
Finally restart/redeploy the application and perform transaction and check metrics in https://app.nextapm.dev dashboard