Skip to content

Instantly share code, notes, and snippets.

@danhunsaker
Created March 2, 2017 17:09
Show Gist options
  • Save danhunsaker/f908d3207f7c13e2fc5cbb922b9c78d9 to your computer and use it in GitHub Desktop.
Save danhunsaker/f908d3207f7c13e2fc5cbb922b9c78d9 to your computer and use it in GitHub Desktop.
NewRelic on Nanobox

== NewRelic on Nanobox ==

There are three ways to use this gist:

  1. If you just want to monitor a PHP application, all you need to do is merge php-extension.boxfile.yml into your Boxfile.
  2. If you just want to monitor the web and/or worker components - and not your code - merge newrelic-daemon.boxfile.yml into your Boxfile, and place newrelic.cfg at the root of your code base.
  3. If you want to do both of the above, merge both.boxfile.yml into your Boxfile, and place newrelic.cfg at the root of your code base.

Note, again, that the above items are alternatives, not steps. You should not find yourself merging more than one of the YAML variants here into your Boxfile.

Good luck!

run.config:
engine: php
engine.config:
extensions:
- newrelic
extra_packages:
- newrelic
deploy.config:
transform:
- sed -i -e "s:license=.*:license=\"${NEWRELIC_LICENSE}\":" -e "s:appname=.*:appname=\"${APP_NAME}\":" /data/etc/php.*/newrelic.ini
- sed -i "s:license_key=.*:license_key=\"${NEWRELIC_LICENSE}\":" /app/newrelic.cfg
web.<name>:
start:
newrelic: newrelic-daemon -f -c newrelic.cfg
app: <command>
log_watch:
newrelic: /data/var/log/newrelic/nrsysmond.log
worker.<name>:
start:
newrelic: newrelic-daemon -f -c newrelic.cfg
app: <command>
log_watch:
newrelic: /data/var/log/newrelic/nrsysmond.log
run.config:
extra_packages:
- newrelic
deploy.config:
transform:
- sed -i "s:license_key=.*:license_key=\"${NEWRELIC_LICENSE}\":" /app/newrelic.cfg
web.<name>:
start:
newrelic: newrelic-daemon -f -c newrelic.cfg
app: <command>
log_watch:
newrelic: /data/var/log/newrelic/nrsysmond.log
worker.<name>:
start:
newrelic: newrelic-daemon -f -c newrelic.cfg
app: <command>
log_watch:
newrelic: /data/var/log/newrelic/nrsysmond.log
license_key=${NEWRELIC_LICENSE}
loglevel=info
logfile=/data/var/log/newrelic/nrsysmond.log
#proxy=
#ssl=true
#hostname=nanobox
#docker_connection=
#docker_cert_path=
#docker_cert=
#docker_key=
#docker_cacert=
#ssl_ca_bundle=
#ssl_ca_path=
#pidfile=/data/var/run/newrelic/nrsysmond.pid
#collector_host=collector.newrelic.com
#labels=
#disable_nfs=false
#disable_docker=false
#cgroup_root=
#ignore_reclaimable=true
#host_root=/
run.config:
engine: php
engine.config:
extensions:
- newrelic
deploy.config:
transform:
- sed -i -e "s:license=.*:license=\"${NEWRELIC_LICENSE}\":" -e "s:appname=.*:appname=\"${APP_NAME}\":" /data/etc/php.*/newrelic.ini
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment