Skip to content

Latest commit

 

History

History
74 lines (55 loc) · 3.36 KB

File metadata and controls

74 lines (55 loc) · 3.36 KB

New Relic Agent Framework

The New Relic Agent Framework causes an application to be automatically configured to work with a bound New Relic Service.

Detection CriterionExistence of a single bound New Relic service.
  • Existence of a New Relic service is defined as the VCAP_SERVICES payload containing a service who's name, label or tag has newrelic as a substring.
Tags new-relic-agent=<version>
Tags are printed to standard output by the buildpack detect script

User-Provided Service (Optional)

Users may optionally provide their own New Relic service. A user-provided New Relic service must have a name or tag with newrelic in it so that the New Relic Agent Framework will automatically configure the application to work with the service.

The credential payload of the service may contain the following entries:

Name Description
license_key (Optional) Either this credential or licenseKey must be provided. If both are provided then the value for license_key will always win. The license key to use when authenticating.
licenseKey (Optional) As above.
*** (Optional) Any additional entries will be applied as a system property appended to -Dnewrelic.config. to allow full configuration of the agent.

Configuration

For general information on configuring the buildpack, including how to specify configuration values through environment variables, refer to Configuration and Extension.

The framework has no user-configurable buildpack options for version selection. The New Relic agent version is managed by the buildpack manifest.

Extensions

Custom New Relic instrumentation in the form of Extension XML Files (or JARs) may be provided via a custom repository.

Example in a manifest.yml

env:
  JBP_CONFIG_NEW_RELIC_AGENT: '{ extensions: { repository_root: "http://repository..." } }'

The artifacts that the repository provides must be in TAR format and must include the extension files in a directory, with a structure like:

extensions
|- my-extension.xml
|- my-other-extension.jar
|...

Additional Configuration

Default Configuration

The buildpack includes a default newrelic.yml configuration file that is embedded at compile time. This provides sensible defaults for Cloud Foundry deployments.

The default configuration file is located in src/java/resources/files/new_relic_agent/newrelic.yml.

Customizing Default Configuration via Fork

To customize the default New Relic configuration across all applications using your buildpack:

  1. Fork the java-buildpack repository
  2. Modify the configuration file in src/java/resources/files/new_relic_agent/
  3. Build and package your custom buildpack
  4. Upload the custom buildpack to your Cloud Foundry foundation

This approach is useful for operators who want to enforce organization-wide New Relic settings.