cookbook 'newrelic-infra', '= 0.3.1'
newrelic-infra
(19) Versions
0.3.1
-
Follow3
Installs/Configures the New Relic Infrastructure agent and on-host integrations
cookbook 'newrelic-infra', '= 0.3.1', :supermarket
knife supermarket install newrelic-infra
knife supermarket download newrelic-infra
newrelic-infra Cookbook
This cookbook installs and configures the New Relic Infrastructure agent as well as new Relic provided and custom on-host integrations for the Infrastructure agent can be installed.
See the [CHANGELOG][11] for information on the latest changes.
Requirements
Platforms
- RHEL
- Red Hat 7
- Red Hat 6
- Oracle 7
- Oracle 6
- CentOS 7
- CentOS 6
- Amazon Linux (all versions)
- Ubuntu
- 16 Xenial
- 14 Trusty
- 12 Precise
- Debian
- 10 Buster
- 9 Stretch
- 8 Jessie
- 7 Wheezy
Chef
- Chef 12.15+
Cookbooks
Recipes
newrelic-infra::default
Determines the platform and includes the appropriate platform specific recipe.
This is the only recipe that should be included in a node's run list.
newrelic-infra::agent_linux
Installs and configures the Infrastructure agent on a Linux host.
This recipe should NOT be directly included in a node's run list.
The default recipe will automatically determine which platform specific recipe to apply.
- Adds the
newrelic-infra
package repository source - Can install, upgrade, or remove the
newrelic-infra
package. By default, the package is only installed. - Enables and starts the
newrelic_infra
agent service - Generates the agent configuration file
- Includes the
newrelic-infra::host_integrations
recipe to install and configure any on-host integrations
newrelic-infra::agent_windows
Installs and configures the Infrastructure agent on a Windows host.
This recipe should NOT be directly included in a node's run list.
The default recipe will automatically determine which platform specific recipe to apply.
Currently, Windows host configuration is NOT supported by this cookbook.
An error will be raised and fail the chef-client
run for any detected Windows nodes.
newrelic-infra::host_integrations
Installs New Relic provided and custom on-host integrations if the associated feature flag is enabled (i.e., default['newrelic_infra']['features]['host_integrations']
).
Generates configuration for any of the available on-host integrations from New Relic.
Installs any custom integrations defined with attributes.
For more infromation on the available custom resource for installing and configuring custom on-host integrations see the Custom resources documentation.
Example configuration for a custom on-host integration installed and configured via attributes:
default['newrelic_infra']['custom_integrations']['test_integration'] = { integration_name: 'com.test.integration', remote_url: 'https://url-to-a-tarball-for-install.com/test.tar.gz', instances: [ { name: 'test_integration_metrics', command: 'metrics', arguments: { test: true }, labels: { environment: 'test' } } ], commands: { metrics: %w[--metrics] } }
For more information on the available New Relic on-host integrations and configuration see:
Attributes
See [attributes/defaults.rb][3] for more details and default values.
Name | Default value | Description |
---|---|---|
default['newrelic_infra']['features']['manage_service_account'] |
true |
Manage a local service account for running the agent |
default['newrelic_infra']['features']['host_integrations'] |
false |
Install New Relic on-host integrations |
default['newrelic_infra']['user']['name'] |
newrelic_infra |
Service account user name |
default['newrelic_infra']['group']['name'] |
newrelic_infra |
Service account group name |
default['newrelic_infra']['config']['license_key'] |
nil |
Account license key to send metrics to |
default['newrelic_infra']['config']['display_name'] |
nil |
Override the auto-generated hostname for reporting |
default['newrelic_infra']['config']['proxy'] |
nil |
Use a proxy to communicate with New Relic |
default['newrelic_infra']['config']['verbose'] |
nil |
When set to 1, enables verbose logging for the agent |
default['newrelic_infra']['config']['debug'] |
nil |
Enable Golang debugging |
default['newrelic_infra']['config']['log_file'] |
nil |
To log to another location; when not set, the agent logs to the system log files |
default['newrelic_infra']['config']['custom_attributes'] |
{} |
A hash of custom attributes to annotate the data from this agent instance |
default['newrelic_infra']['agent']['config']['file'] |
agent.yaml |
File name for the agent configuration |
default['newrelic_infra']['agent']['config']['mode'] |
0640 |
File permissions for the agent configuration |
default['newrelic_infra']['agent']['directory']['path'] |
/etc/newrelic-infra |
Directory path for the agent configuration |
default['newrelic_infra']['agent']['directory']['mode'] |
0750 |
Directory permissions for the agent configuration |
default['newrelic_infra']['packages']['agent']['action'] |
[:install] |
Action(s) to perform on the agent package |
default['newrelic_infra']['packages']['agent']['version'] |
nil |
Verion of the agent package to install |
default['newrelic_infra']['packages']['host_integrations']['action'] |
[:install] |
Action(s) to perform on the agent on-host integrations package |
default['newrelic_infra']['packages']['host_integrations']['version'] |
nil |
Verion of the on-host integrations package to install |
default['newrelic_infra']['host_integrations']['config_dir'] |
/etc/newrelic-infra/integrations.d |
Directory for the New Relic provided on-host integration configurations |
default['newrelic_infra']['host_integrations']['config'] |
{} |
New Relic provided on-host integration configuration |
default['newrelic_infra']['custom_integrations'] |
{} |
New Relic Infrastructure on-host custom integration configuration |
apt repository attributes
The apt_repository
Chef resource is built using metaprogramming, so that the configuration can be extended via attributes.
Any property available to the resource can be passed in via attributes.
Attributes that cannot be passed to the resource are logged out as warnings in order to prevent potential failes from typos, older Chef versions, etc.
For more information, refer to the Chef documentation on the apt_repository resource.
Name | Default value | Description |
---|---|---|
default['newrelic_infra']['apt']['uri'] |
https://download.newrelic.com/infrastructure_agent/linux/apt |
Repository base URL |
default['newrelic_infra']['apt']['key'] |
https://download.newrelic.com/infrastructure_agent/gpg/newrelic-infra.gpg |
Repository GPG key URL |
default['newrelic_infra']['apt']['distribution'] |
node['lsb']['codename'] |
Distribution code name |
default['newrelic_infra']['apt']['components'] |
['main'] |
Repository components |
default['newrelic_infra']['apt']['arch'] |
'amd64' |
Package architecture to install |
default['newrelic_infra']['apt']['action'] |
[:add] |
apt_repository resource actions to perform |
YUM repository attributes
The yum_repository
Chef resource is built using metaprogramming, so that the configuration can be extended via attributes.
Any property available to the resource can be passed in via attributes.
Attributes that cannot be passed to the resource are logged out as warnings in order to prevent potential failes from typos, older Chef versions, etc.
For more information, refer to the Chef documentation on the yum_repository resource.
Name | Default value | Description |
---|---|---|
default['newrelic_infra']['yum']['description'] |
'New Relic Infrastructure' | Repository description |
default['newrelic_infra']['yum']['baseurl'] |
Default is determined by distribution see [attributes/default.rb][3] for more information. | Repository base URL |
default['newrelic_infra']['yum']['gpgkey'] |
'https://download.newrelic.com/infrastructure_agent/gpg/newrelic-infra.gpg' |
Repository GPG key URL |
default['newrelic_infra']['yum']['gpgcheck'] |
true |
Perform a GPG check on installed packages |
default['newrelic_infra']['yum']['repo_gpgcheck'] |
true |
Perform a GPG check on the package repository |
default['newrelic_infra']['yum']['action'] |
[:add, :makecache] |
yum_repository resource actions to perform |
Custom Resources
newrelic_infra_integration
Installs and configures a custom New Relic Infrastructure on-host integration.
Example:
newrelic_infra_integration 'test' do integration_name 'test_integration' remote_url 'https://url-to-a-tarball-for-install.com/test.tar.gz' commands { metrics: %w[--metrics] } instances( [ { name: 'test_integration_metrics', command: 'metrics', arguments: { test: true }, labels: { environment: 'test' } } ] ) end
Supported properties:
Property name | Required | Type | Default |
---|---|---|---|
integration_name |
true |
String | nil |
remote_url |
true |
String | nil |
instances |
true |
Array | nil |
commands |
true |
Hash | nil |
description |
false |
[String, nil] | nil |
cli_options |
false |
[Hash, nil] | nil |
interval |
false |
Integer | 10 |
prefix |
false |
String | integration/#{integration_name} |
install_method |
true |
'tarball' or 'binary'
|
'tarball' |
os |
false |
'linux' |
'linux' |
protocol_version |
false |
Integer | 1 |
user |
false |
String | 'newrelic_infra' |
group |
false |
String | 'newrelic_infra' |
base_dir |
false |
String | '/var/db/newrelic-infra/custom-integrations' |
bin_dir |
false |
String | /opt/newrelic-infra |
bin |
false |
String | The folder is #{bin_dir}/#{name} and the file name is the tarball or binary without any extension |
definition_file |
false |
String | #{base_dir}/#{resource_name).yaml |
config_dir |
false |
String | '/etc/newrelic-infra/integrations.d/' |
config_file |
false |
String | #{config_dir}/#{resource_name).yaml |
Usage
Cookbook usage
- Set any attributes necessary for your desired configuration
- Add the
newrelic-infra::default
recipe your run list - For wrapper cookbooks, add the
newrelic-infra
cookbook as a dependency to yourmetadata.rb
orBerksfile
, then includenewrelic-infra::default
recipe.
Custom resource usage
- Add the
newrelic-infra
cookbook as a dependency to yourmetadata.rb
orBerksfile
- Configure the custom resource(s) using the supported properties
Testing
See [CONTRIBUTING.md][10] for details on how to test and contribute to this cookbook.
Copyright (c) 2016-2017 New Relic, Inc. All rights reserved.
Dependent cookbooks
poise-service ~> 1.5 |
poise-archive ~> 1.5 |
Contingent cookbooks
There are no cookbooks that are contingent upon this one.
newrelic-infra Cookbook CHANGELOG
This file is used to list changes made in each version of the newrelic-infra
cookbook.
0.3.1
IMPROVEMENTS:
- Add .kitchen.dokken.yml to allow Test Kitchen tests in Docker
- Add .travis.yml to run tests in Travis CI
- Typo fixes
- Change "LWRP" to "custom resource" in documentation
- Automatically deploy with Travis CI to supermarket
0.3.0
BREAKING CHANGES:
- The minimum supported Chef version is now 12.15+ instead of 12.14+.
- The prefix name for custom on-host integrations has been changed to use the name of the Chef resource instead of the integration name since the New Relic Infrastructure API does not accept prefix names with
.
's.
FEATURES:
- Add
sensitive
to all configuration file resources as well as associated unit testing for thesensitive
property.
BUG FIXES:
- Remove the use of
Hash#compact
, which only works with Ruby >= 2.4. No versions of Chef 12.x ship with a version of Ruby this new. Replace with monkey patched methodHash.delete_blank
(#18). - Modify the generated YAML configuration files to generate a format that is compatible with the Infrastructure agent's Go YAML parser (#19).
0.2.0
FEATURES:
- Add
sensitive
to agent configuration file resource
0.1.0
NOTE: Versions prior to 0.1.0 were not tagged or released on the Chef supermarket.
BREAKING CHANGES:
-
Attribute namespace changed: The top-level attribute key was changed from
newrelic-infra
tonewrelic_infra
in order to be used as both strings and symbols. - Only
chef-client
versions>= 12.14
are supported. - Lots of attribute changes to help simplify configuration generation. See the [README][2] for more details.
FEATURES:
- Testing added: Unit and integration tests added. See the [CONTRIBUTING][3] guide for more details.
- newrelic_infra_integration LWRP added: An LWRP for installing and configuring custom New Relic Infrastructure on-host integrations. Custom integrations can also be installed using by including the default recipe and the appropriate attributes.
- New Relic On-Host integrations: Added the capability to install and configure the New Relic provided on-host integrations. See the [README][3] for more details on what attributes to set.
IMPROVEMENTS:
- Updated the apt and YUM repository resources to use metaprogramming. This allows all properties available for each of the respective resources to be available as attributes.
- Resolved all Rubocop and Foodcritic violations.
BUG FIXES:
Collaborator Number Metric
0.3.1 failed this metric
Failure: Cookbook has 1 collaborators. A cookbook must have at least 2 collaborators to pass this metric.
Contributing File Metric
0.3.1 passed this metric
Foodcritic Metric
0.3.1 passed this metric
License Metric
0.3.1 failed this metric
newrelic-infra does not have a valid open source license.
Acceptable licenses include Apache-2.0, apachev2, Apache 2.0, MIT, mit, GPL-2.0, gplv2, GNU Public License 2.0, GPL-3.0, gplv3, GNU Public License 3.0.
No Binaries Metric
0.3.1 failed this metric
Failure: Cookbook should not contain binaries. Found:
newrelic-infra/newrelic.pem.enc
Testing File Metric
0.3.1 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
0.3.1 passed this metric
0.3.1 failed this metric
0.3.1 passed this metric
Foodcritic Metric
0.3.1 passed this metric
License Metric
0.3.1 failed this metric
newrelic-infra does not have a valid open source license.
Acceptable licenses include Apache-2.0, apachev2, Apache 2.0, MIT, mit, GPL-2.0, gplv2, GNU Public License 2.0, GPL-3.0, gplv3, GNU Public License 3.0.
No Binaries Metric
0.3.1 failed this metric
Failure: Cookbook should not contain binaries. Found:
newrelic-infra/newrelic.pem.enc
Testing File Metric
0.3.1 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
0.3.1 passed this metric
0.3.1 passed this metric
0.3.1 failed this metric
newrelic-infra does not have a valid open source license.
Acceptable licenses include Apache-2.0, apachev2, Apache 2.0, MIT, mit, GPL-2.0, gplv2, GNU Public License 2.0, GPL-3.0, gplv3, GNU Public License 3.0.
No Binaries Metric
0.3.1 failed this metric
Failure: Cookbook should not contain binaries. Found:
newrelic-infra/newrelic.pem.enc
Testing File Metric
0.3.1 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
0.3.1 passed this metric
0.3.1 failed this metric
newrelic-infra/newrelic.pem.enc
0.3.1 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
0.3.1 passed this metric
0.3.1 passed this metric