APM Insight Node.js agent - Basic Troubleshooting tips

Basic troubleshooting tips for the APM Insight Node.js agent

If you are experiencing issues after installing the APM Insight Node.js agent, follow these troubleshooting tips.

Verify agent installation and connectivity

  1. To verify the agent installation status, you can execute the following command from the root directory of your application (from the package.json file location):
$ npm list | grep apminsight
Sample output: 
├── apminsight@4.9
Notes
For the latest updates and fixes, see the Release Notes.
Once the command executes, you can confirm that the agent installation is successful.
  1. After you install the agent, restart your application so the agent can start using the new monitoring setup.
  2. The apminsightnode.json file must not contain any line comments. Since JSON is a data-only format, it doesn't support comment styles like //, #, or /* */. If you need to include comments, you can add them as custom JSON fields, but those comments will be treated as data.
  3. Check the agent logs (inside the apminsightdata directory) for network communication messages. If the MANAGE_AGENT message is printed in the log, this confirms that the agent is connected to Site24x7. Your application will now be automatically added to your Site24x7 account.

Folder not created

There are situations where the apminsightdata folder is not created. This might happen due to file write permission restrictions on your machine. In that case, the apminsightdata folder will be created in the temporary directory on your machine. A temporary folder will be created in your local drive. 
To know the path of this temporary folder, you can execute the command below in your terminal:
$ node -e "console.log(require('os').tmpdir())"

Warning message
Reason
Corrective action
LICENSE_EXPIRED
Your license has expired, or there has been a delay in bill payments.
Upgrade your plan.
LICENSE_INSTANCES_ EXCEEDED
The limit on the number of advanced monitors has been reached. Agent communication happens once every 15 minutes, so invalid licenses won't be reflected immediately.
Ensure you have sufficient advanced monitor licenses, or else upgrade your plan.
MARKED_FOR_DELETE
You have deleted the application from the Site24x7 account.
If you deleted it intentionally, no action is needed. If not, you can re-add the monitor by following the steps below,
1. Navigate to the apminsightdata folder to locate the apminsight.json file. 
2. Delete it and restart the application. (This will recycle the app pools.) 

UNMANAGED_AGENT
Your application has been suspended.
If it is suspended due to autoscaling, it will be activated automatically. If not, please activate it from the Site24x7 account.
INSTANCE_ADD_FAILED
An Internal server error occurred while evaluating the license.
This issue will be resolved within a few minutes. If not, kindly contact our support team.
INVALID_AGENT
1. Mismatch in the entered license key (inside apminsightnode.json file) 
or
2. The instance is removed from the server (the instance is no longer mapped to the application). 
1. Enter the valid license key.
2. If the same error continues, you can delete the apminsightdata folder and restart the application.

Proxy and Firewall settings

  1. If your server has a proxy configuration, provide the proxy details in the apminsightnode.json file. For more information, check the help document.
  1. Check your firewall settings. The Site24x7 agent collects and sends data to the Site24x7 servers (plusinsight site domains) via port 443. If your firewall settings block connections over these ports, modify your settings accordingly.

System settings

  1. Check whether the app server and your Site24x7 account are in the same time zone. Go to Admin > My Account to change your time zone.
  2. If your APM instance is not receiving data, please perform some transactions on your server and check the Site24x7 console after a few minutes.
Check out more on how to manage your Node.js applications efficiently using PM2 Process Manager.