AOEpeople/newrelic

Name: newrelic

Owner: AOE

Description: Repository for New Relic cookbook

Created: 2014-08-04 15:17:41.0

Updated: 2016-04-05 11:46:03.0

Pushed: 2014-08-04 15:21:41.0

Homepage: http://community.opscode.com/cookbooks/newrelic

Size: 378

Language: null

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Build Status

Description

This cookbook provides an easy way to install various New Relic agents and the New Relic server monitor.

More information?

Requirements

Chef version:

Make sure you run Chef >= 0.10.0.

Cookbooks:

This cookbook recommends on the following cookbooks:

Depending on your environment, these recommended cookbooks are actual dependencies (depends):
Platforms:

Attributes

default.rb:
BASIC
ADVANCED
repository.rb:
php-agent.rb:
python-agent.rb:
dotnet-agent.rb:
server-monitor-agent.rb:
java-agent.rb:
nodejs-agent.rb

eg.


 'app_name' => 'My Application', 'app_path' => "/path/to/app/root" }

You then need to modify your application “main” file to add the following on the first line:

script
ire('newrelic');
ruby-agent.rb:
meetme-plugin.rb:

eg.


emcached" => {
"name" => "localhost",
"host" => "host",
"port" => 11211

edis" => [
{
  "name" => "localhost",
  "host" => "localhost",
  "port" => 6379,
  "db_count" => 16,
  "password" => "foobar"
},
{
  "name" => "localhost",
  "host" => "localhost",
  "port" => 6380,
  "db_count" => 16,
  "password" => "foobar"
}


Resources / Providers

This cookbook includes an LWRP for notifying New Relic of a deployment

newrelic_deployment
Actions Attribute parameters Example(s)
elic_deployment "my-application" do
api_key "abcdef"
#app_name "my-application"
app_id 1234567
description "some description"
revision "some revision"
changelog "some changelog"
user "chef-client"
action :notify

This cookbook includes an LWRP for generating the newrelic.yml configuration file in a specific path, which can be used to generate multiple configurations when deploying multiple different applications

newrelic_yml
Actions
Example usage - Java agent
  1. Install the Java Agent: add the newrelic::java-agent recipe to your run list. A newrelic.yml will be generated but not linked to anything.
  2. In your application cookbook, generate the newrelic.yml for this application:
elicyml="#{my_app_path}/newrelic.yml"
elic_yml newrelicyml do
ent_type 'java'
p_name 'my-super-duper-application'

  1. Configure your app for newrelic using your config file and newrelic.jar:
a -Dnewrelic.config.file=#{newrelicyml}  -javaagent:#{node['newrelic']['install_dir']}/newrelic.jar [rest of your args]

Usage

1) include recipe[newrelic] in a run list to implicly run recipe[newrelic:repository] and recipe[newrelic::server-monitor-agent] — OR — include the bits and pieces explicitly in a run list:

ipe[newrelic::repository]`
ipe[newrelic::server-monitor-agent]`
ipe[newrelic::dotnet-agent]`
ipe[newrelic::java-agent]`
ipe[newrelic::meetme-plugin]`
ipe[newrelic::nodejs-agent]`
ipe[newrelic::php-agent]`
ipe[newrelic::python-agent]`
ipe[newrelic::ruby-agent]`

2) change the node['newrelic']['license'] attribute to your New Relic license keys — OR — override the attributes on a higher level (http://wiki.opscode.com/display/chef/Attributes#Attributes-AttributesPrecedence)

References

License and Authors

Author: David Joos david.joos@escapestudios.com Author: Escape Studios Development dev@escapestudios.com Copyright: 2012-2014, Escape Studios

Unless otherwise noted, all files are released under the MIT license, possible exceptions will contain licensing information in them.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.