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 4.0. For APM Insight agent versions below 4.0 refer here.
{
"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 ECMAScript:
import apminsight from 'apminsight';
If using TypeScript
import AgentAPI from apminsight';
AgentAPI.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" ]
We highly recommend you to download the latest version of APM Insight Node.js agent. But if you are looking to download agent versions above 1.7.2 and below 4.0.0 for some specific reasons, refer the below given steps:
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.
{
"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.
We highly recommend you to download the latest version of APM Insight Node.js agent. But if you are looking to download agent version 1.7.2 and below for some specific reasons, refer the below given steps:
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" ]