Skip to content
This repository has been archived by the owner on Feb 19, 2020. It is now read-only.

Require the New Relic PHP agent. #923

Merged
merged 1 commit into from
Nov 28, 2018
Merged

Require the New Relic PHP agent. #923

merged 1 commit into from
Nov 28, 2018

Conversation

DFurnes
Copy link
Contributor

@DFurnes DFurnes commented Nov 28, 2018

What's this PR do?

This pull request requires the ext-newrelic extension in Longshot, so we can get this set up properly on Heroku (which has some frustrating gotchas when using the add-on as we've done elsewhere, described in DoSomething/infrastructure#59).

This will now require the New Relic agent to be installed on our locals as well (since Composer checks for ext-* on installs), which is probably a good idea for dev-prod parity anyways. Add in Homestead's after.sh & run a homestead provision (will update docs as well!):

# Install New Relic agent:
sudo sh -c "echo 'deb http://apt.newrelic.com/debian/ newrelic non-free' > /etc/apt/sources.list.d/newrelic.list"
wget -O- https://download.newrelic.com/548C16BF.gpg | sudo apt-key add -
sudo apt-get update

sudo DEBIAN_FRONTEND=noninteractive apt-get -y install newrelic-php5

How should this be reviewed?

We can see whether this installs the extension as it should when deployed to Longshot QA.

Any background context you want to provide?

N/A

Relevant tickets

References DoSomething/infrastructure#49.

Checklist

  • Tested on Whitelabel.

Copy link
Contributor

@katiecrane katiecrane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yay for NewRelic!

@sheyd
Copy link

sheyd commented Nov 28, 2018

Ugh, the module is still newrelic-php5 🙄.

@DFurnes
Copy link
Contributor Author

DFurnes commented Nov 28, 2018

Haha yeah that threw me for a loop, so silly. 🙃

@DFurnes DFurnes merged commit 8831a92 into master Nov 28, 2018
@DFurnes DFurnes deleted the ext-newrelic branch November 28, 2018 19:27
@DFurnes
Copy link
Contributor Author

DFurnes commented Nov 28, 2018

Confirming this gets included on builds now!

-----> Installing platform packages...
       - php (7.1.24)
       - ext-gd (bundled with php)
       - ext-mbstring (bundled with php)
       - ext-newrelic (8.3.0.226)
       - nginx (1.8.1)
       - apache (2.4.37)

@DFurnes
Copy link
Contributor Author

DFurnes commented Nov 28, 2018

Ah, a gotcha:

Nov 28 14:53:52 longshot-qa app/queue.1: 2018-11-28 19:53:52.488 +0000 (1572 1572) info: New Relic 8.3.0.226 ("carrot" - "56d5a21db092") [daemon='@newrelic-daemon'  php='7.1.24' zts=no sapi='cli'  pid=1572 ppid=1571 uid=36386 euid=36386 gid=36386 egid=36386 backtrace=yes startup=agent os='Linux' rel='4.4.0-1031-aws' mach='x86_64' ver='#34-Ubuntu SMP Tue Sep 25 09' node='a881bd6a-ed58-450d-9d27-138f56a5a52a'] 
Nov 28 14:53:53 longshot-qa app/queue.1: 2018-11-28 19:53:52.488 +0000 (1572 1572) warning: A global default license has not been set or has invalid format. Please add a 'newrelic.license' key in the global php.ini or in the newrelic.ini file, or ensure that a valid license is provided on a per-virtual host or per-directory basis. 

The environment variables were used in the Heroku buildpack to customize how the New Relic agent works (they're not standard). Looking into how we can do this without needing a newrelic.ini in the repo...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants