Sha256: 52d15653b8fd9dc47ff0f51182f1eab20cea253d3888138d290f8f6753927043

Contents?: true

Size: 970 Bytes

Versions: 1

Compression:

Stored size: 970 Bytes

Contents

# 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:

```ruby
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:

```ruby
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:

```ruby
  applications = NewRelic::RestApi::Application.all
```

In order to get the metric names for each application:

```ruby
  applications.map(&:metric_names)
```

In order to get the metrics data for each application:

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
new_relic-rest_api-0.1.0 README.md