This document explains the steps taken to implement New relic and AWS infra monitoring on prod2 resources.
New relic instructions
For setting up in ECS:
Download the new relic java agent zip file and extract it from the new relic docs : https://docs.newrelic.com/docs/agents/java-agent/installation/install-java-agent
configure the agent with newrelic.yml file and add the add the license key and app name as per the instructions in the above link.
Place the new relic folder inside the docker folder.
Copy the new relic in to the app.Dockerfile by adding the following lines.
COPY docker/newrelic /opt/jboss/wildfly/newrelic
Add the java arguments in the docker-compose.yml in order to make the new relic agent work.
JAVA_OPTS: "-javaagent:/opt/jboss/wildfly/standalone/newrelic/newrelic.jar"
Then build the by using the docker-compose up app (for more info on building image refer : prod2 documentation)
Once the image is built and tested push it to ECR and restart the ECS service based on prod2 documentation.
Create a revision of the task-definition and add the java argument in the environment section of the app container.
For setting up in Solr:
Download the java agent for solr with
curl -O https://download.newrelic.com/newrelic/java-agent/newrelic-agent/current/newrelic-java.zip
Extract the zip file and configure the newrelic.yml with the license key and application name.
Set the java argument for solr based on the version of solr.
#for Standalone Solr 5.x or higher SOLR_OPTS="$SOLR_OPTS -javaagent:/full/path/to/newrelic.jar" #for Standalone Solr 4.x or lower java -javaagent:/full/path/to/newrelic.jar -jar start.jar
(Reference : https://docs.newrelic.com/docs/agents/java-agent/installation/include-java-agent-jvm-argument#Installing_on_solr)
Once it is setup restart the solr application to get data into newrelic APM.
For setting up in Batch server:
Download the new relic java agent inside the batch server with
curl -O https://download.newrelic.com/newrelic/java-agent/newrelic-agent/current/newrelic-java.zip
Extract the zip file and configure the newrelic.yml with the license key and application name.
Set the java argument for batch server in the batchstarter.sh
-javaagent:/full/path/to/newrelic.jar
AWS Cloudwatch agent setup for infrastructure monitoring:
For setting up cloudwatch agent:
SSH into the instance.
Download the cloudwatch agent according to the platform from the below link
Install the package.
#If its an RPM package sudo rpm -U ./amazon-cloudwatch-agent.rpm
#If its an DEB package sudo dpkg -i -E ./amazon-cloudwatch-agent.deb
Once the agent is downloaded we can create and modify the configuration file.
Steps to configure the agent : https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/create-cloudwatch-agent-configuration-file-wizard.html
To enable the CloudWatch agent to send data from the instance, we must attach an IAM role to the instance. The role to attach is CloudWatchAgentServerRole.
0 Comments