newrelic_api 1.2.1 → 1.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +7 -1
- data/README.rdoc +12 -11
- data/VERSION +1 -1
- data/lib/new_relic_api.rb +8 -1
- data/newrelic_api.gemspec +9 -7
- metadata +4 -4
data/CHANGELOG
CHANGED
@@ -8,5 +8,11 @@
|
|
8
8
|
1.1.2
|
9
9
|
- Update deployments to support an app id # as well as app name
|
10
10
|
- Updated documentation
|
11
|
+
1.2.0
|
12
|
+
- Added support for metric names and metric data API
|
11
13
|
1.2.1
|
12
|
-
|
14
|
+
- Updated for new product names
|
15
|
+
- Minor bugs and compatibility fixes
|
16
|
+
1.2.2
|
17
|
+
- Add support for querying multiple applications in the data api
|
18
|
+
- Support for proxies (thanks to Wei Feng)
|
data/README.rdoc
CHANGED
@@ -384,7 +384,7 @@ Restrictions:: This API should be called at most once per minute.
|
|
384
384
|
|
385
385
|
=== Data Returned
|
386
386
|
|
387
|
-
Note: Metric names will only be returned to
|
387
|
+
Note: Metric names will only be returned to Pro customers.
|
388
388
|
|
389
389
|
Sample requests:
|
390
390
|
|
@@ -465,7 +465,7 @@ Apdex metrics support a particular set of fields:
|
|
465
465
|
|
466
466
|
Returns the data values for metrics collected by New Relic for your application. You can use this API to build your own view of almost any metric data tracked by New Relic.
|
467
467
|
|
468
|
-
URL:: <code>https://api.newrelic.com/api/v1/
|
468
|
+
URL:: <code>https://api.newrelic.com/api/v1/accounts/:account_id/data.:format</code> Replace +:account_id+ and +:format+ with your New Relic account ID (found in the URL when you access New Relic), and for format use one of (+json+, +xml+, +csv+).
|
469
469
|
Method:: GET
|
470
470
|
Restrictions:: This API is rate-limited per minute, and the limit is subject to change at any point.
|
471
471
|
|
@@ -478,6 +478,7 @@ Restrictions:: This API is rate-limited per minute, and the limit is subject t
|
|
478
478
|
|
479
479
|
=== Request Parameters
|
480
480
|
|
481
|
+
* +app+ or +app_id+: Application name, or application ID, respectively. The application name must be an exact match. You can pass in an array of apps to query by specifying app[]=First&app[]=Second or app_id[]=1234&app_id[]=2345
|
481
482
|
* +begin+: Begin time, in XML UTC format. For example: <tt>2011-04-20T15:47:00Z</tt> (note that the New Relic site graphs are NOT in UTC format, so when comparing results, be sure to convert)
|
482
483
|
* +end+: End time, in XML UTC format. For example: <tt>2011-04-20T15:52:00Z</tt>
|
483
484
|
* +metrics+: Included one or many times, this lists the metrics you are interested in. If you specify multiple metrics, the request parameter should look like <tt>metrics[]=foo&metrics[]=bar</tt> (append '[]' to the end of the name of the parameter). You can specify <tt>metrics[]</tt> even if there is a single metric.
|
@@ -486,42 +487,42 @@ Restrictions:: This API is rate-limited per minute, and the limit is subject t
|
|
486
487
|
|
487
488
|
=== Data Returned
|
488
489
|
|
489
|
-
Note: Metric data will only be returned to
|
490
|
+
Note: Metric data will only be returned to Pro customers.
|
490
491
|
|
491
492
|
Sample time series request:
|
492
493
|
|
493
|
-
https://api.newrelic.com/api/v1/
|
494
|
+
https://api.newrelic.com/api/v1/accounts/ACCOUNT_ID/data.xml?begin=2011-04-20T15:47:19Z&end=2011-04-20T15:52:19Z&metrics[]=ActiveRecord/all&field=average_response_time&app=My%20Application
|
494
495
|
|
495
496
|
Sample time series data:
|
496
497
|
|
497
498
|
<?xml version="1.0" encoding="UTF-8"?>
|
498
499
|
<metrics type="array">
|
499
|
-
<metric begin="2011-04-20T15:47:00Z" end="2011-04-20T15:48:00Z" name="ActiveRecord/all">
|
500
|
+
<metric app="My Application" begin="2011-04-20T15:47:00Z" end="2011-04-20T15:48:00Z" name="ActiveRecord/all">
|
500
501
|
<field type="integer" name="average_response_time">0</field>
|
501
502
|
</metric>
|
502
|
-
<metric begin="2011-04-20T15:48:00Z" end="2011-04-20T15:49:00Z" name="ActiveRecord/all">
|
503
|
+
<metric app="My Application" begin="2011-04-20T15:48:00Z" end="2011-04-20T15:49:00Z" name="ActiveRecord/all">
|
503
504
|
<field type="integer" name="average_response_time">0</field>
|
504
505
|
</metric>
|
505
|
-
<metric begin="2011-04-20T15:49:00Z" end="2011-04-20T15:50:00Z" name="ActiveRecord/all">
|
506
|
+
<metric app="My Application" begin="2011-04-20T15:49:00Z" end="2011-04-20T15:50:00Z" name="ActiveRecord/all">
|
506
507
|
<field type="integer" name="average_response_time">0</field>
|
507
508
|
</metric>
|
508
|
-
<metric begin="2011-04-20T15:50:00Z" end="2011-04-20T15:51:00Z" name="ActiveRecord/all">
|
509
|
+
<metric app="My Application" begin="2011-04-20T15:50:00Z" end="2011-04-20T15:51:00Z" name="ActiveRecord/all">
|
509
510
|
<field type="integer" name="average_response_time">0</field>
|
510
511
|
</metric>
|
511
|
-
<metric begin="2011-04-20T15:51:00Z" end="2011-04-20T15:52:00Z" name="ActiveRecord/all">
|
512
|
+
<metric app="My Application" begin="2011-04-20T15:51:00Z" end="2011-04-20T15:52:00Z" name="ActiveRecord/all">
|
512
513
|
<field type="integer" name="average_response_time">0</field>
|
513
514
|
</metric>
|
514
515
|
</metrics>
|
515
516
|
|
516
517
|
Sample summary request:
|
517
518
|
|
518
|
-
https://api.newrelic.com/api/v1/
|
519
|
+
https://api.newrelic.com/api/v1/accounts/ACCOUNT_ID/data.xml?begin=2011-04-20T15:47:19Z&end=2011-04-20T15:52:19Z&metrics[]=ActiveRecord/all&field=average_response_time&app=My%20Application&summary=1
|
519
520
|
|
520
521
|
Sample summary data:
|
521
522
|
|
522
523
|
<?xml version="1.0" encoding="UTF-8"?>
|
523
524
|
<metrics type="array">
|
524
|
-
<metric name="ActiveRecord/all">
|
525
|
+
<metric app="My Application" name="ActiveRecord/all">
|
525
526
|
<field type="integer" name="average_response_time">0</field>
|
526
527
|
</metric>
|
527
528
|
</metrics>
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.2.
|
1
|
+
1.2.2
|
data/lib/new_relic_api.rb
CHANGED
@@ -31,7 +31,7 @@ require 'active_resource_associations'
|
|
31
31
|
module NewRelicApi
|
32
32
|
|
33
33
|
class << self
|
34
|
-
attr_accessor :api_key, :ssl, :host, :port
|
34
|
+
attr_accessor :api_key, :ssl, :host, :port, :proxy
|
35
35
|
|
36
36
|
# Resets the base path of all resources. This should be called when overridding the newrelic.yml settings
|
37
37
|
# using the ssl, host or port accessors.
|
@@ -50,6 +50,7 @@ module NewRelicApi
|
|
50
50
|
include ActiveResourceAssociations
|
51
51
|
|
52
52
|
class << self
|
53
|
+
|
53
54
|
def inherited(klass) #:nodoc:
|
54
55
|
NewRelicApi.track_resource(klass)
|
55
56
|
end
|
@@ -68,8 +69,13 @@ module NewRelicApi
|
|
68
69
|
def reset!
|
69
70
|
self.site = self.site_url
|
70
71
|
end
|
72
|
+
|
73
|
+
def proxy
|
74
|
+
NewRelicApi.proxy
|
75
|
+
end
|
71
76
|
end
|
72
77
|
self.site = self.site_url
|
78
|
+
self.proxy = self.proxy
|
73
79
|
end
|
74
80
|
ACCOUNT_RESOURCE_PATH = '/accounts/:account_id/' #:nodoc:
|
75
81
|
ACCOUNT_AGENT_RESOURCE_PATH = ACCOUNT_RESOURCE_PATH + 'agents/:agent_id/' #:nodoc:
|
@@ -216,6 +222,7 @@ module NewRelicApi
|
|
216
222
|
# NewRelicApi::Deployment.create :app_name => "My Application", :description => "Update production", :user => "Big Mike"
|
217
223
|
#
|
218
224
|
class Deployment < BaseResource
|
225
|
+
self.format = ActiveResource::Formats::XmlFormat
|
219
226
|
end
|
220
227
|
|
221
228
|
class Subscription < BaseResource
|
data/newrelic_api.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{newrelic_api}
|
8
|
-
s.version = "1.
|
8
|
+
s.version = "1.2.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["New Relic"]
|
12
|
-
s.date = %q{2011-
|
12
|
+
s.date = %q{2011-09-07}
|
13
13
|
s.description = %q{Use this gem to access New Relic application information via a REST api}
|
14
14
|
s.email = %q{support@newrelic.com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -35,7 +35,7 @@ Gem::Specification.new do |s|
|
|
35
35
|
s.licenses = ["MIT"]
|
36
36
|
s.rdoc_options = ["--line-numbers", "--title", "Documentation and helper code for the New Relic API", "-m", "README.rdoc"]
|
37
37
|
s.require_paths = ["lib"]
|
38
|
-
s.rubygems_version = %q{1.
|
38
|
+
s.rubygems_version = %q{1.6.2}
|
39
39
|
s.summary = %q{Documentation and helper code for the New Relic API}
|
40
40
|
s.test_files = [
|
41
41
|
"test/integration/newrelic_api_test.rb",
|
@@ -43,11 +43,10 @@ Gem::Specification.new do |s|
|
|
43
43
|
]
|
44
44
|
|
45
45
|
if s.respond_to? :specification_version then
|
46
|
-
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
47
46
|
s.specification_version = 3
|
48
47
|
|
49
48
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
50
|
-
s.add_development_dependency(%q<rails>, ["= 3.0.
|
49
|
+
s.add_development_dependency(%q<rails>, ["= 3.0.7"])
|
51
50
|
s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
|
52
51
|
s.add_development_dependency(%q<jeweler>, ["~> 1.5.2"])
|
53
52
|
s.add_development_dependency(%q<rcov>, [">= 0"])
|
@@ -55,8 +54,9 @@ Gem::Specification.new do |s|
|
|
55
54
|
s.add_development_dependency(%q<ci_reporter>, ["= 1.6.0"])
|
56
55
|
s.add_development_dependency(%q<rdiscount>, [">= 0"])
|
57
56
|
s.add_development_dependency(%q<rdoc>, [">= 3.3"])
|
57
|
+
s.add_development_dependency(%q<logging>, [">= 0"])
|
58
58
|
else
|
59
|
-
s.add_dependency(%q<rails>, ["= 3.0.
|
59
|
+
s.add_dependency(%q<rails>, ["= 3.0.7"])
|
60
60
|
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
61
61
|
s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
|
62
62
|
s.add_dependency(%q<rcov>, [">= 0"])
|
@@ -64,9 +64,10 @@ Gem::Specification.new do |s|
|
|
64
64
|
s.add_dependency(%q<ci_reporter>, ["= 1.6.0"])
|
65
65
|
s.add_dependency(%q<rdiscount>, [">= 0"])
|
66
66
|
s.add_dependency(%q<rdoc>, [">= 3.3"])
|
67
|
+
s.add_dependency(%q<logging>, [">= 0"])
|
67
68
|
end
|
68
69
|
else
|
69
|
-
s.add_dependency(%q<rails>, ["= 3.0.
|
70
|
+
s.add_dependency(%q<rails>, ["= 3.0.7"])
|
70
71
|
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
71
72
|
s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
|
72
73
|
s.add_dependency(%q<rcov>, [">= 0"])
|
@@ -74,6 +75,7 @@ Gem::Specification.new do |s|
|
|
74
75
|
s.add_dependency(%q<ci_reporter>, ["= 1.6.0"])
|
75
76
|
s.add_dependency(%q<rdiscount>, [">= 0"])
|
76
77
|
s.add_dependency(%q<rdoc>, [">= 3.3"])
|
78
|
+
s.add_dependency(%q<logging>, [">= 0"])
|
77
79
|
end
|
78
80
|
end
|
79
81
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: newrelic_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 27
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 1.2.
|
9
|
+
- 2
|
10
|
+
version: 1.2.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- New Relic
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-10-06 00:00:00 -07:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|