Skip to content

Instantly share code, notes, and snippets.

@aa6my
Created August 27, 2021 02:14
Show Gist options
  • Save aa6my/5878b70555eeb52f97c45efe0692d1a5 to your computer and use it in GitHub Desktop.
Save aa6my/5878b70555eeb52f97c45efe0692d1a5 to your computer and use it in GitHub Desktop.
Elastic Beanstalk + New Relic + PHP Agent

#Elastic Beanstalk + New Relic PHP

Elastic Beanstalk environment variables

Add an environment variable called "NR_INSTALL_KEY" and set the value as your New Relic license key.

Add newrelic.config to .ebextensions folder

Copy the config file into .ebextensions as newrelic.config.

Optional: Change Application Name

Edit Line: 6 and replace "Application Name" with your applications name.

files:
"/etc/php.d/newrelicappname.ini" :
mode: "000644"
owner: root
group: root
content: 'newrelic.appname="Application Name"'
packages:
yum:
newrelic-php5: []
newrelic-sysmond: []
rpm:
newrelic: http://yum.newrelic.com/pub/newrelic/el5/x86_64/newrelic-repo-5-3.noarch.rpm
container_commands:
newrelic1:
command: "newrelic-install install"
newrelic3:
command: "/usr/sbin/nrsysmond-config --set license_key=$NR_INSTALL_KEY"
newrelic4:
command: "/etc/init.d/newrelic-sysmond start"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment