6

I'd like to get Craft working with New Relic so I can play with my two favorite apps. My web host (EngineHosting) got the New Relic daemons et al going; has anyone tackled getting the Craft side going so that it reports in?

Let me know, please? I may be doing some learning in order to do this integration down the line; but if someone has tackled it, I could dive right on in a bit more quickly.

Lisa
  • 211
  • 1
  • 9
  • 1
    Can't say I've done more than just install the standard php monitor but it seems to work fine for me, the only downside is everything on the front end gets run through /Craft\TemplatesController/render so that kind of makes the transaction monitoring part a bit useless. – Josh Angell Jun 25 '14 at 10:20
  • Alright awesome. I'll use this to do some troubleshooting and figure out what is going on. Thanks Josh! – Lisa Jun 25 '14 at 14:39
  • @nicael Please flag questions as you see fit but we aren't closing questions immediately because of a flag. – Anna_MediaGirl Jul 11 '14 at 18:30
  • @Anna I know. I already flagged, my flag was helpful, but no action was taken. If you aren't closing, my flag should have been declined. – nicael Jul 11 '14 at 18:31
  • 2
    "Helpful" doesn't mean immediate closing by moderators for what it's worth. Closing questions is a community process so the question will stay open until it hits the flag limit that closes it or when a moderator agrees it's off topic. – Anna_MediaGirl Jul 11 '14 at 18:34
  • Also, a flag can be deemed "helpful" without action taken by a moderator. It's a hat tip, thanking you for taking the time. – Anna_MediaGirl Jul 11 '14 at 18:38
  • Nicael and all others who voted to close, could you please leave a comment on why you want a question to be closed? This gives the author a hint on what's wrong with the question and we all can @discuss it in the comments? – carlcs Jul 11 '14 at 19:11
  • This question does not appear to be about Craft CMS, within the scope defined in the help center. – nicael Jul 11 '14 at 19:18
  • @nicael do you think we shouldn't have questions about integrating Craft with other software? Maybe I don't get it but what is different with this question here to others like "How do I configure Varnish to work with Craft" or this one "Craft CMS and JS/MVVM frameworks"? – carlcs Jul 11 '14 at 19:24
  • @nicael is there a more definite list of questions considered being on- and off-topic? You link was no help for me. – carlcs Jul 11 '14 at 19:30
  • @ChristianSeelbach This question is not about "How do I integrate {something} in Craft?", it is about "What is heard about integrating New Relic in Craft CMS from official sources?" - "Brandon did this and this so now all is ok! Ask questions!". It is announcement, not really a question. – nicael Jul 11 '14 at 19:36
  • 1
    "Has anyone tackled getting the Craft side going so that it reports in?" was the question, @nicael. Which is pretty similar to "How do I integrate Craft in {something}?" and I wouldn't consider this being an announcement. And answering your own questions is totally fine, as you already know. – carlcs Jul 11 '14 at 19:56
  • This was absolutely a question about how to integrate Craft and New Relic on EngineHosting. The fact is, EngineHosting does the entire New Relic setup because it is a fully managed server (as opposed to something like cPanel or Plesk). I asked them to make it happen, and it did.

    Craft itself doesn't integrate specifically with New Relic: I mostly get information about index.php. A plugin (or core integration) would be required to get more sent from Craft to New Relic; a project that I'm unlikely to tackle myself but am considering.

    – Lisa Jul 12 '14 at 19:26

2 Answers2

5

Not quite sure what happened here; Brandon over at EngineHosting re-ran the installation and now I see my info in RPM.

So for future New Relic users that want to integrate with Craft on EngineHosting - at its most basic, ask EH to get New Relic installed for you.

Exciting! Thanks @joshangell for the help. Sometimes knowing it should just work is the key. :)

__

Editing as requested. EngineHosting fully manages my site/server. I don't have root via SSH so asked them to get the New Relic PHP agent installated (the agent installation requires root). EH did install NR for me, but the first installation did not work and I do not know why. When EngineHosting re-ran the installation, the PHP agent worked and Craft (and other PHP apps, mostly the 'index.php' file for each) started reporting to APM.

That's not helpful for people on cPanel or Plesk hosts, admittedly, nor is it helpful for people with root access doing their own installations. But if you can get the New Relic PHP agent installed where Craft is, then it will report to APM. Looking forward to getting more specific metrics from Craft to New Relic down the line, but that is not likely to come from me :)


With that very basic installation I get information like this:

Craft in NR APM


I hope that helps.

Lisa
  • 211
  • 1
  • 9
  • Wanted to add to this: so far this is a very basic integration. As those of you that know me well know, I learn by playing, so step 1 is done. Now I can help figure out further integration in my copious spare time. And by copious I mean this could be a while. If anyone else works with NR and Craft, let me know, here or privately! – Lisa Jun 25 '14 at 18:11
  • Lisa, could you please edit your answer so that it makes more sense to people not using the same web host as you do? It's too specific I think. – carlcs Jul 11 '14 at 20:41
  • I also want to add, that I don't know you (should I) or what your job is (interesting?) and I definitely don't know this Brandon guy from that host shop. So please express questions and answers in a way understandable by all of us. – carlcs Jul 11 '14 at 20:44
  • Did your host let you know what was wrong with the first install? Any insights you could give, pointing future readers of this Q/A in the right direction? – carlcs Jul 11 '14 at 20:58
  • Hi Christian; I don't know anything about the installation, my site is on a fully managed server (currently run by EngineHosting (enginehosting.com is my web host) Brandon is one of the support folks at EngineHosting.

    I was told they simply re-did the New Relic installation and got it working. I wish I had more information, but as this is a fully managed server and they have infrastructure that is totally alien to me, I just don't know.

    – Lisa Jul 12 '14 at 19:20
  • 1
    Edited my answer. – Lisa Jul 12 '14 at 19:30
4

If you've got New Relic installed on a server containing more than one site, I've found adding:

if (extension_loaded('newrelic')) {
  newrelic_set_appname('NAME OF SITE');
}

at the top of Craft's index.php allows me to track them individually in New Relic.

Clive Portman
  • 2,908
  • 17
  • 36
  • 1
    Awesome Clive, thank you! :) You can also do that in .htaccess, fyi, especially if the installations are in different directories; then it's very easy. – Lisa May 18 '15 at 21:11