No commit activity in last 3 years
No release in over 3 years
New Relic client v2 Rest API: https://docs.newrelic.com/docs/apis/rest-api-v2.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.11
>= 0
~> 10.0
~> 3.0

Runtime

 Project Readme

NewRelic::RestApi

New Relic client for the v2 Rest API:

https://docs.newrelic.com/docs/apis/rest-api-v2.

Installation

Add this line to your application's Gemfile:

gem 'new_relic-rest_api', require: 'new_relic/rest_api'

And then execute:

$ bundle

Or install it yourself as:

$ gem install new_relic-rest_api

Usage

You need to setup your new relic api key:

require 'new_relic/rest_api'

NewRelic::RestApi.config do |config|
  config.key = '<your-api-key>'
end

There other options you can setup like:

timeout, open_timeout, retries, ssl_options.

Then you can play with the application resource:

  applications = NewRelic::RestApi::Application.all

In order to get the metric names for each application:

  applications.map(&:metric_names)

In order to get the metrics data for each application you need to pass some metric names from the previous step:

  applications.map { |app| app.metric_data(names: ['<some-metric-name-from-above>']) }