To install APM Insight Node.js agent on Docker container, follow the steps given below:
Note: The below given instructions work only for APM insight Node.js agent versions above 1.7.2. For APM Insight agent versions 1.7.2 and below, refer here.
npm install <Node.js-Agent-unzipped-path>/agent_minified
npm install /users/joe/agent_minified
npm install -g <Node.js-Agent-unzipped-path>/agent_minified
npm install -g /users/joe/agent_minified
{
"licenseKey" : "[LICENSE-KEY]",
"appName" : "[APPLICATION-NAME]",
"port" : "[APPLICATION-PORT]",
"apmHost": "[APM-HOST-NAME]",
"apmPort": "[APM-SSL-PORT]"
}
Example:
{
"licenseKey" : "APMI_ee420aaaaaaaaaabbbbbbbbbbbbbcccccccccddddddddbe1ea",
"appName" : "APMInsight_NodeJSapp",
"port" : "3000",
"apmHost": "localhost",
"apmPort": "8443"
}
{
"licenseKey" : "[LICENSE-KEY]",
"appName" : "[APPLICATION-NAME]",
"port" : "[APPLICATION-PORT]",
"apmHost": "[APM-HOST-NAME]",
"apmPort": "[APM-SSL-PORT]"
"proxyServerHost" : "[PROXY-SERVER]",
"proxyServerPort" : "[PROXY-PORT]",
"proxyAuthUser" : "[PROXY-USERNAME]",
"proxyAuthPassword" : "[PROXY-PASSWORD]"
}
If using Common JS:
require('apminsight')()
If using ES:
import apminsight from 'apminsight';
apminsight.config()
RUN cd /usr wget https://www.manageengine.com/products/applications_manager/54974026/apm_insight_agent_nodejs.zip
RUN unzip apm_insight_agent_nodejs.zip
RUN cd <Node.js-app-path> && npm install /usr/agent_minified
Example:
Following is an example of the commands used for configuring the agent into the image file Dockerfile:
FROM node:16
WORKDIR /usr/src/app
COPY . .
RUN cd /usr wget https://www.manageengine.com/products/applications_manager/54974026/apm_insight_agent_nodejs.zip
RUN unzip apm_insight_agent_nodejs.zip
RUN cd /usr/src/app && npm install /usr/agent_minified
EXPOSE 8080
CMD [ "node", "server.js" ]
require(‘apminsight’)
(
{port:<application port>}
)However other parameters like license key and app name should be added only in apminsightnode.json file.
For APM Insight agent versions 1.7.2 and below:
We highly recommend you to download the lastest version of APM Insight Node.js agent. But if you are looking to download agent verison 1.7.2 and below for some specific reasons, refer the below given steps:
npm install <Node.js-Agent-unzipped-path>/agent_minified
npm install /users/joe/agent_minified
npm install -g <Node.js-Agent-unzipped-path>/agent_minified
npm install -g /users/joe/agent_minified
require('apminsight')({
licenseKey : '[LICENSE-KEY]',
appName : '[APPLICATION-NAME]',
port : [APPLICATION-PORT],
apmHost: '[APM-HOST-NAME]',
apmPort: [APM-SSL-PORT]
})
Example:
require('apminsight')({
licenseKey : 'APMI_ee42094f83dd841d16b9c56796c22b63bef00ac6918f547280947d1f6c2be1ea',
appName : 'Insight_NodeJS',
port : 3000,
apmHost: 'localhost',
apmPort: 8443
})
require('apminsight')({
licenseKey : '[LICENSE-KEY]',
appName : '[APPLICATION-NAME]',
port : [APPLICATION-PORT],
apmHost: '[APM-HOST-NAME]',
apmPort: [APM-SSL-PORT]
proxyServerHost : '[PROXY-SERVER]',
proxyServerPort : [PROXY-PORT],
proxyAuthUser : '[PROXY-USERNAME]',
proxyAuthPassword : '[PROXY-PASSWORD]'
})
RUN cd /usr wget https://www.manageengine.com/products/applications_manager/54974026/apm_insight_agent_nodejs.zip
RUN unzip apm_insight_agent_nodejs.zip
RUN cd <Node.js-app-path> && npm install /usr/agent_minified
Example:
Following is an example of the commands used for configuring the agent into the image file Dockerfile:
FROM node:16
WORKDIR /usr/src/app
COPY . .
RUN cd /usr wget https://www.manageengine.com/products/applications_manager/54974026/apm_insight_agent_nodejs.zip
RUN unzip apm_insight_agent_nodejs.zip
RUN cd /usr/src/app && npm install /usr/agent_minified
EXPOSE 8080
CMD [ "node", "server.js" ]