# Newrelic plugin

**URL:** https://meta.discourse.org/t/newrelic-plugin/12986
**Category:** Plugin
**Tags:** broken
**Created:** [February 23, 2014, 8:28am UTC](https://meta.discourse.org/t/newrelic-plugin/12986 "2014-02-23T08:28:19Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [February 23, 2014, 8:28am UTC](https://meta.discourse.org/t/newrelic-plugin/12986/1 "2014-02-23T08:28:19Z")

</div>

New Relic support

Author: Sam Saffron

Support for [http://newrelic.com](http://newrelic.com)

### plugins/newrelic/plugin.rb

```plaintext
# name: enable New Relic rpm
# about: New Relic support
# version: 0.1
# authors: Sam Saffron

ENV["NRCONFIG"] = File.expand_path('../newrelic.yml', __FILE__ )
gem "newrelic_rpm", "3.6.7.152"

NewRelic::Control.instance.init_plugin :config => Rails.configuration

after_initialize do
  ForumsController.newrelic_ignore :only => [:status]
end

```

### plugins/newrelic/newrelic.yml

The file you got from newrelic

TODO: move this to git

---

<div class="post-metadata">

### Author: ![watchmanmonitor](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/watchmanmonitor/32/430970_2.png) [@watchmanmonitor](https://meta.discourse.org/u/watchmanmonitor)
#### Post date: [February 24, 2014, 4:36am UTC](https://meta.discourse.org/t/newrelic-plugin/12986/2 "2014-02-24T04:36:53Z")

</div>

For the documentation:

## Installation

Copy this file into  
`plugins/newrelic/plugin.rb`

Retrieve a copy of your `newrelic.yml` file:

> `https://rpm.newrelic.com/accounts/[123456]/newrelic.yml`

Where you need to replace 123456 with the application number you see in your NewRelic interface.

Save this to config/newrelic.yml`

(unless there’s some reason to keep it at the root of the install, as shown above)

Otherwise I’d change that 6th line to:  
`../config/newrelic.yml`

## Activation

The Newrelic gem will be installed the next time bundler is called.

> cd /var/www/discourse (or or where you’ve installed discourse)  
> bundle install --without test --deployment

(is that correct?)

---

<div class="post-metadata">

### Author: ![watchmanmonitor](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/watchmanmonitor/32/430970_2.png) [@watchmanmonitor](https://meta.discourse.org/u/watchmanmonitor)
#### Post date: [February 26, 2014, 3:18am UTC](https://meta.discourse.org/t/newrelic-plugin/12986/3 "2014-02-26T03:18:34Z")

</div>

Would I need to do anything else besides what’s outlined?

Is that bundle command needed?

---

<div class="post-metadata">

### Author: ![patrick](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/patrick/32/107726_2.png) [@patrick](https://meta.discourse.org/u/patrick)
#### Post date: [March 6, 2014, 7:31pm UTC](https://meta.discourse.org/t/newrelic-plugin/12986/4 "2014-03-06T19:31:56Z")

</div>

New Relic is wicked. Thanks for the plugin!

---

<div class="post-metadata">

### Author: ![davidcelis](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/davidcelis/32/454421_2.png) [@davidcelis](https://meta.discourse.org/u/davidcelis)
#### Post date: [March 12, 2014, 10:42pm UTC](https://meta.discourse.org/t/newrelic-plugin/12986/5 "2014-03-12T22:42:35Z")

</div>

I took it upon myself to create a GitHub repository for this; it’s pretty much unchanged, but it does use the most up-to-date Ruby agent version while also providing a `newrelic.yml` file that will look for `NEW_RELIC_LICENSE_KEY` and `NEW_RELIC_APP_NAME` variables.

Bonus: installation instructions for the Docker image. Thanks for the initial version, @sam!

[https://github.com/davidcelis/new\_relic-discourse](https://github.com/davidcelis/new_relic-discourse)

---

<div class="post-metadata">

### Author: ![cooper](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cooper/32/108400_2.png) [@cooper](https://meta.discourse.org/u/cooper)
#### Post date: [March 14, 2014, 7:42pm UTC](https://meta.discourse.org/t/newrelic-plugin/12986/6 "2014-03-14T19:42:03Z")

</div>

Nice!

@davidcelis would you mind if we added this to [http://newrelic.com/connect/](http://newrelic.com/connect/) ?

---

<div class="post-metadata">

### Author: ![davidcelis](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/davidcelis/32/454421_2.png) [@davidcelis](https://meta.discourse.org/u/davidcelis)
#### Post date: [March 14, 2014, 7:48pm UTC](https://meta.discourse.org/t/newrelic-plugin/12986/7 "2014-03-14T19:48:18Z")

</div>

Yep, we should do that.

---

<div class="post-metadata">

### Author: ![hunterowens](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hunterowens/32/108417_2.png) [@hunterowens](https://meta.discourse.org/u/hunterowens)
#### Post date: [March 17, 2014, 6:07pm UTC](https://meta.discourse.org/t/newrelic-plugin/12986/8 "2014-03-17T18:07:18Z")

</div>

@davidcelis

Is there anyway to use your github version without restarting and loosing the content of an initial app with a container?

---

<div class="post-metadata">

### Author: ![davidcelis](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/davidcelis/32/454421_2.png) [@davidcelis](https://meta.discourse.org/u/davidcelis)
#### Post date: [March 17, 2014, 8:05pm UTC](https://meta.discourse.org/t/newrelic-plugin/12986/9 "2014-03-17T20:05:37Z")

</div>

You won’t lose the content, as both the PostgreSQL and Redis databases are stored in a folder that’s shared with the host. You will have to destroy the container and re-bootstrap it, but all your data (posts, users, topics, etc.) will still be there.

I wish there was a better way.

---

<div class="post-metadata">

### Author: ![evaryont](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/evaryont/32/122402_2.png) [@evaryont](https://meta.discourse.org/u/evaryont)
#### Post date: [March 24, 2014, 3:17am UTC](https://meta.discourse.org/t/newrelic-plugin/12986/10 "2014-03-24T03:17:54Z")

</div>

For anyone else looking to further integrate New Relic, they offer an availability monitoring service. This way you can get alerts if Discourse ever goes down. (Ideally, that would be never!)

Discourse already has an OK status URL that works wonderfully for this purpose. If you go to your Discourse application in New Relic, then Settings → Availability Monitoring, New Relic asks for a URL to monitor. You can use `/srv/status` from your application, like [`https://meta.discourse.org/srv/status`](https://meta.discourse.org/srv/status) and hit “Save”.

---

<div class="post-metadata">

### Author: ![Nacho\_Caballero](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nacho_caballero/32/130189_2.png) [@Nacho\_Caballero](https://meta.discourse.org/u/Nacho_Caballero)
#### Post date: [October 19, 2020, 7:30am UTC](https://meta.discourse.org/t/newrelic-plugin/12986/11 "2020-10-19T07:30:11Z")

</div>

@davidcelis @sam  
This plugin is now incompatible with discourse. Are there any other proposed solutions for monitoring performance?

---

<div class="post-metadata">

### Author: ![valsha](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/valsha/32/230631_2.png) [@valsha](https://meta.discourse.org/u/valsha)
#### Post date: [September 2, 2021, 7:03am UTC](https://meta.discourse.org/t/newrelic-plugin/12986/12 "2021-09-02T07:03:30Z")

</div>

Hi, any news about new version of this plugin? Thank you.
