Skip to content

Developing a Plugin

Gavin M. Roy edited this page May 16, 2014 · 3 revisions

Writing new plugins for the agent is comprised of multiple steps:

  1. Setting up the development environment
  2. Creating the plugin for the agent
  3. Creating dashboards for the agent

Setup the Development Environment

The development environment for the newrelic-plugin-agent uses Vagrant and docker to provide a repeatable, automated setup for the environment required for the new plugin. If you're writing a plugin for "Daemon X", getting an environment setup where the maintainers and other developers can work with your code against "Daemon X" is an important first step. It will not only help with testing your pull-request, but it will also provide a way for other developers to work with your code.

Getting Started

In the newrelic-plugin-agent source top-level directory start the Vagrant VM:

vagrant up

You'll be prompted for your password to share the source folder with the VM. Once entered, the VM will finish booting and you can ssh into the VM with:

vagrant ssh

Once in the VM, you'll want to set your NewRelic license key. Supposing your license key is ABCD1234:

core@core-01 ~ $ newrelic-key ABCD1234
Key updated, run "source ~/.newrelic-key" to activate
core@core-01 ~ $ source ~/.newrelic-key 
Clone this wiki locally