rpm_contrib 2.1.7 → 2.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG +12 -7
- data/README.md +27 -7
- data/lib/rpm_contrib/instrumentation/aws.rb +8 -2
- data/lib/rpm_contrib/instrumentation/mongo.rb +9 -5
- data/lib/rpm_contrib/instrumentation/mongoid.rb +21 -0
- metadata +43 -66
- data/lib/rpm_contrib/instrumentation/redis.rb +0 -42
- data/test/test_redis.rb +0 -34
data/CHANGELOG
CHANGED
@@ -1,12 +1,17 @@
|
|
1
|
+
* Version 2.1.8
|
2
|
+
- Removed redis instrumenation in favor of https://github.com/evanphx/newrelic-redis
|
3
|
+
- [FIX] adding check for aws-sdk (Tom Caspy)
|
4
|
+
- Improved Mongo instrumenation from pull request #16 titanous/mongoid-instrumentation
|
5
|
+
|
1
6
|
* Version 2.1.7
|
2
7
|
|
3
|
-
Community contributed instrumentation
|
4
|
-
- ThinkingSphinx instrumentation improvement (Martin Sarsale)
|
5
|
-
- Picky search engine instrumentation (Niko Dittmann)
|
6
|
-
Community Contributed Bug Fixes
|
7
|
-
- Fix instrumentation injection for ActiveMessaging (W. Andrew Loe III)
|
8
|
-
Other
|
9
|
-
- Improvements to resque instrumentation detection of if its in a forking ruby implementation
|
8
|
+
Community contributed instrumentation
|
9
|
+
- ThinkingSphinx instrumentation improvement (Martin Sarsale)
|
10
|
+
- Picky search engine instrumentation (Niko Dittmann)
|
11
|
+
Community Contributed Bug Fixes
|
12
|
+
- Fix instrumentation injection for ActiveMessaging (W. Andrew Loe III)
|
13
|
+
Other
|
14
|
+
- Improvements to resque instrumentation detection of if its in a forking ruby implementation
|
10
15
|
|
11
16
|
* Version 2.1.6
|
12
17
|
|
data/README.md
CHANGED
@@ -3,6 +3,29 @@
|
|
3
3
|
The `rpm_contrib` gem contains instrumentation for the New Relic RPM agent
|
4
4
|
contributed by the community of RPM users. It requires the RPM Agent to run.
|
5
5
|
|
6
|
+
## Deprecation of RPM Contrib
|
7
|
+
|
8
|
+
Over the next several months we are planning to phase out the rpm_contrib gem.
|
9
|
+
We plan to migrate the existing instrumentation into separate projects that
|
10
|
+
instrument indivdual libraries or frameworks. We see this as having a number of
|
11
|
+
advantages for newrelic users. We will provide a list of recommended
|
12
|
+
instrumentation projects.
|
13
|
+
|
14
|
+
### Removal of Redis Instrumenation
|
15
|
+
|
16
|
+
As of version 2.1.8 Redis instrumentation has been removed from rpm_contrib.
|
17
|
+
Please use Evan Phoenix's `newrelic-redis` gem instead.
|
18
|
+
https://github.com/evanphx/newrelic-redis
|
19
|
+
|
20
|
+
### Request for Maintainers
|
21
|
+
|
22
|
+
If you're interested in maintaining instrumentation for a specific
|
23
|
+
library/framework, please let us know. We'd love to work with you and promote
|
24
|
+
your project. -The New Relic Ruby Agent Team
|
25
|
+
|
26
|
+
|
27
|
+
## Getting Started
|
28
|
+
|
6
29
|
To use the rpm_contrib gem, install the `rpm_contrib` gem from rubygems.org.
|
7
30
|
It will also install the required version of the `newrelic_rpm` gem if it's not
|
8
31
|
already installed.
|
@@ -23,9 +46,6 @@ require the rpm_contrib gem:
|
|
23
46
|
require 'rubygems'
|
24
47
|
require 'rpm_contrib'
|
25
48
|
|
26
|
-
When you load the rpm_contrib gem, the `newrelic_rpm` gem will also be
|
27
|
-
initialized. No need for a separate require statement for `newrelic_rpm`.
|
28
|
-
|
29
49
|
In non-Rails frameworks, it's important that the New Relic Agent gets
|
30
50
|
loaded as late as possible, or that the final initialization hook is called
|
31
51
|
after all other frameworks have loaded:
|
@@ -43,6 +63,7 @@ fix the auto-detection logic.
|
|
43
63
|
If this does not help then set the `log_level` to `debug` in the `newrelic.yml` file
|
44
64
|
and examine the `newrelic_agent.log` file for errors after restarting your app.
|
45
65
|
|
66
|
+
|
46
67
|
## Supported Frameworks
|
47
68
|
|
48
69
|
A number of frameworks are supported in the contrib gem. They are all turned on
|
@@ -122,11 +143,10 @@ To disable resque, set 'disable_resque' to true in your newrelic.yml file.
|
|
122
143
|
|
123
144
|
### Redis
|
124
145
|
|
125
|
-
Redis instrumentation
|
126
|
-
summary metrics under the `Database/Redis` metric namespace. This instrumentation
|
127
|
-
supports Redis versions 1.x and 2.x.
|
146
|
+
Redis instrumentation has been removed from rpm_contrib.
|
128
147
|
|
129
|
-
|
148
|
+
Please use Evan Phoenix's `newrelic-redis` gem instead.
|
149
|
+
https://github.com/evanphx/newrelic-redis
|
130
150
|
|
131
151
|
### Riak
|
132
152
|
|
@@ -13,8 +13,14 @@ DependencyDetection.defer do
|
|
13
13
|
|
14
14
|
executes do
|
15
15
|
# Instrument connections to the AWS-S3 service
|
16
|
-
::AWS::S3::Connection
|
17
|
-
|
16
|
+
if defined?(::AWS::S3::Connection)
|
17
|
+
::AWS::S3::Connection::Management::ClassMethods.module_eval do
|
18
|
+
add_method_tracer :establish_connection!, 'AWS-S3/establish_connection!'
|
19
|
+
end
|
20
|
+
else #using aws-sdk
|
21
|
+
::AWS::S3.class_eval do
|
22
|
+
add_method_tracer :initialize, 'AWS-S3/establish_connection!'
|
23
|
+
end
|
18
24
|
end
|
19
25
|
|
20
26
|
# Instrument methods on Bucket
|
@@ -11,7 +11,7 @@ DependencyDetection.defer do
|
|
11
11
|
end
|
12
12
|
|
13
13
|
executes do
|
14
|
-
::Mongo::
|
14
|
+
::Mongo::Logging.class_eval do
|
15
15
|
include NewRelic::Agent::MethodTracer
|
16
16
|
|
17
17
|
def instrument_with_newrelic_trace(name, payload = {}, &blk)
|
@@ -32,17 +32,21 @@ DependencyDetection.defer do
|
|
32
32
|
alias_method :instrument_without_newrelic_trace, :instrument
|
33
33
|
alias_method :instrument, :instrument_with_newrelic_trace
|
34
34
|
end
|
35
|
+
class Mongo::Collection; include Mongo::Logging; end
|
36
|
+
class Mongo::Connection; include Mongo::Logging; end
|
37
|
+
class Mongo::Cursor; include Mongo::Logging; end
|
35
38
|
|
39
|
+
# cursor refresh is not currently instrumented in mongo driver, so not picked up by above - have to add our own here
|
36
40
|
::Mongo::Cursor.class_eval do
|
37
41
|
include NewRelic::Agent::MethodTracer
|
38
42
|
|
39
|
-
def
|
43
|
+
def send_get_more_with_newrelic_trace
|
40
44
|
trace_execution_scoped("Database/#{collection.name}/refresh") do
|
41
|
-
|
45
|
+
send_get_more_without_newrelic_trace
|
42
46
|
end
|
43
47
|
end
|
44
|
-
alias_method :
|
45
|
-
alias_method :
|
48
|
+
alias_method :send_get_more_without_newrelic_trace, :send_get_more
|
49
|
+
alias_method :send_get_more, :send_get_more_with_newrelic_trace
|
46
50
|
add_method_tracer :close, 'Database/#{collection.name}/close'
|
47
51
|
end
|
48
52
|
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
DependencyDetection.defer do
|
2
|
+
@name = :mongoid
|
3
|
+
|
4
|
+
depends_on do
|
5
|
+
defined?(::Mongoid) and not NewRelic::Control.instance['disable_mongoid']
|
6
|
+
end
|
7
|
+
|
8
|
+
executes do
|
9
|
+
NewRelic::Agent.logger.debug 'Installing Mongoid instrumentation'
|
10
|
+
end
|
11
|
+
|
12
|
+
executes do
|
13
|
+
Mongoid::Collection.class_eval do
|
14
|
+
include NewRelic::Agent::MethodTracer
|
15
|
+
|
16
|
+
(Mongoid::Collections::Operations::ALL - [:<<, :[]]).each do |method|
|
17
|
+
add_method_tracer method, "ActiveRecord/\#{@klass}/#{method}"
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
metadata
CHANGED
@@ -1,69 +1,53 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: rpm_contrib
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 2.1.8
|
5
5
|
prerelease:
|
6
|
-
segments:
|
7
|
-
- 2
|
8
|
-
- 1
|
9
|
-
- 7
|
10
|
-
version: 2.1.7
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Bill Kayser
|
14
9
|
- Jon Guymon
|
15
10
|
autorequire:
|
16
11
|
bindir: bin
|
17
12
|
cert_chain: []
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
13
|
+
date: 2012-03-19 00:00:00.000000000 Z
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: newrelic_rpm
|
17
|
+
requirement: &70251204964480 !ruby/object:Gem::Requirement
|
23
18
|
none: false
|
24
|
-
requirements:
|
25
|
-
- -
|
26
|
-
- !ruby/object:Gem::Version
|
27
|
-
hash: 1
|
28
|
-
segments:
|
29
|
-
- 3
|
30
|
-
- 1
|
31
|
-
- 1
|
19
|
+
requirements:
|
20
|
+
- - ! '>='
|
21
|
+
- !ruby/object:Gem::Version
|
32
22
|
version: 3.1.1
|
33
|
-
name: newrelic_rpm
|
34
|
-
prerelease: false
|
35
23
|
type: :runtime
|
36
|
-
|
37
|
-
|
38
|
-
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: *70251204964480
|
26
|
+
- !ruby/object:Gem::Dependency
|
27
|
+
name: newrelic_rpm
|
28
|
+
requirement: &70251204963860 !ruby/object:Gem::Requirement
|
39
29
|
none: false
|
40
|
-
requirements:
|
41
|
-
- -
|
42
|
-
- !ruby/object:Gem::Version
|
43
|
-
hash: 1
|
44
|
-
segments:
|
45
|
-
- 3
|
46
|
-
- 1
|
47
|
-
- 1
|
30
|
+
requirements:
|
31
|
+
- - ! '>='
|
32
|
+
- !ruby/object:Gem::Version
|
48
33
|
version: 3.1.1
|
49
|
-
name: newrelic_rpm
|
50
|
-
prerelease: false
|
51
34
|
type: :runtime
|
52
|
-
|
53
|
-
|
54
|
-
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: *70251204963860
|
37
|
+
description: ! 'Community contributed instrumentation for various frameworks based
|
38
|
+
on
|
39
|
+
|
55
40
|
the New Relic Ruby monitoring gem newrelic_rpm.
|
56
41
|
|
42
|
+
'
|
57
43
|
email: support@newrelic.com
|
58
44
|
executables: []
|
59
|
-
|
60
45
|
extensions: []
|
61
|
-
|
62
|
-
extra_rdoc_files:
|
46
|
+
extra_rdoc_files:
|
63
47
|
- CHANGELOG
|
64
48
|
- LICENSE
|
65
49
|
- README.md
|
66
|
-
files:
|
50
|
+
files:
|
67
51
|
- CHANGELOG
|
68
52
|
- Gemfile
|
69
53
|
- LICENSE
|
@@ -84,9 +68,9 @@ files:
|
|
84
68
|
- lib/rpm_contrib/instrumentation/elastic_search.rb
|
85
69
|
- lib/rpm_contrib/instrumentation/kyototycoon.rb
|
86
70
|
- lib/rpm_contrib/instrumentation/mongo.rb
|
71
|
+
- lib/rpm_contrib/instrumentation/mongoid.rb
|
87
72
|
- lib/rpm_contrib/instrumentation/paperclip.rb
|
88
73
|
- lib/rpm_contrib/instrumentation/picky.rb
|
89
|
-
- lib/rpm_contrib/instrumentation/redis.rb
|
90
74
|
- lib/rpm_contrib/instrumentation/resque.rb
|
91
75
|
- lib/rpm_contrib/instrumentation/riak_client.rb
|
92
76
|
- lib/rpm_contrib/instrumentation/ripple.rb
|
@@ -102,46 +86,39 @@ files:
|
|
102
86
|
- test/schema.rb
|
103
87
|
- test/test_curb.rb
|
104
88
|
- test/test_picky.rb
|
105
|
-
- test/test_redis.rb
|
106
89
|
- test/test_resque.rb
|
107
90
|
- test/test_workling.rb
|
108
91
|
homepage: http://github.com/newrelic/rpm_contrib
|
109
92
|
licenses: []
|
110
|
-
|
111
93
|
post_install_message:
|
112
|
-
rdoc_options:
|
94
|
+
rdoc_options:
|
113
95
|
- --line-numbers
|
114
96
|
- --inline-source
|
115
97
|
- --title
|
116
98
|
- Contributed Instrumentation for New Relic RPM
|
117
99
|
- -m
|
118
100
|
- README.md
|
119
|
-
require_paths:
|
101
|
+
require_paths:
|
120
102
|
- lib
|
121
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
103
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
122
104
|
none: false
|
123
|
-
requirements:
|
124
|
-
- -
|
125
|
-
- !ruby/object:Gem::Version
|
126
|
-
|
127
|
-
segments:
|
105
|
+
requirements:
|
106
|
+
- - ! '>='
|
107
|
+
- !ruby/object:Gem::Version
|
108
|
+
version: '0'
|
109
|
+
segments:
|
128
110
|
- 0
|
129
|
-
|
130
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
111
|
+
hash: 1487779751657344136
|
112
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
131
113
|
none: false
|
132
|
-
requirements:
|
133
|
-
- -
|
134
|
-
- !ruby/object:Gem::Version
|
135
|
-
|
136
|
-
segments:
|
137
|
-
- 0
|
138
|
-
version: "0"
|
114
|
+
requirements:
|
115
|
+
- - ! '>='
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
139
118
|
requirements: []
|
140
|
-
|
141
119
|
rubyforge_project:
|
142
120
|
rubygems_version: 1.8.10
|
143
121
|
signing_key:
|
144
122
|
specification_version: 3
|
145
123
|
summary: Contributed Instrumentation for New Relic RPM
|
146
124
|
test_files: []
|
147
|
-
|
@@ -1,42 +0,0 @@
|
|
1
|
-
# Redis instrumentation contributed by Ashley Martens of ngmoco
|
2
|
-
#
|
3
|
-
DependencyDetection.defer do
|
4
|
-
@name = :redis
|
5
|
-
|
6
|
-
depends_on do
|
7
|
-
defined?(::Redis) && !NewRelic::Control.instance['disable_redis']
|
8
|
-
end
|
9
|
-
|
10
|
-
executes do
|
11
|
-
NewRelic::Agent.logger.debug 'Installing Redis instrumentation'
|
12
|
-
end
|
13
|
-
|
14
|
-
executes do
|
15
|
-
::Redis::Client.class_eval do
|
16
|
-
|
17
|
-
include NewRelic::Agent::MethodTracer
|
18
|
-
|
19
|
-
def self.redis_call_method
|
20
|
-
::Redis::Client.new.respond_to?(:call) ? :call : :raw_call_command
|
21
|
-
end
|
22
|
-
|
23
|
-
|
24
|
-
def raw_call_command_with_newrelic_trace *args
|
25
|
-
method_name = args[0].is_a?(Array) ? args[0][0] : args[0]
|
26
|
-
metrics = ["Database/Redis/#{method_name}",
|
27
|
-
(NewRelic::Agent::Instrumentation::MetricFrame.recording_web_transaction? ? 'Database/Redis/allWeb' : 'Database/Redis/allOther')]
|
28
|
-
self.class.trace_execution_scoped(metrics) do
|
29
|
-
# NewRelic::Control.instance.log.debug("Instrumenting Redis Call[#{method_name}]: #{args[0].inspect}")
|
30
|
-
raw_call_command_without_newrelic_trace(*args)
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
alias_method :raw_call_command_without_newrelic_trace, redis_call_method
|
35
|
-
alias_method redis_call_method, :raw_call_command_with_newrelic_trace
|
36
|
-
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
|
42
|
-
|
data/test/test_redis.rb
DELETED
@@ -1,34 +0,0 @@
|
|
1
|
-
require "#{File.dirname(__FILE__)}/helper"
|
2
|
-
begin
|
3
|
-
require 'redis'
|
4
|
-
require 'ruby-debug'
|
5
|
-
rescue LoadError
|
6
|
-
end
|
7
|
-
|
8
|
-
require "#{File.dirname(__FILE__)}/../lib/rpm_contrib/instrumentation/redis"
|
9
|
-
|
10
|
-
if defined?(::Redis)
|
11
|
-
|
12
|
-
|
13
|
-
class RedisTest < Test::Unit::TestCase
|
14
|
-
|
15
|
-
# Called before every test method runs. Can be used
|
16
|
-
# to set up fixture information.
|
17
|
-
def setup
|
18
|
-
# Do nothing
|
19
|
-
end
|
20
|
-
|
21
|
-
# Called after every test method runs. Can be used to tear
|
22
|
-
# down fixture information.
|
23
|
-
|
24
|
-
def teardown
|
25
|
-
# Do nothing
|
26
|
-
end
|
27
|
-
|
28
|
-
# Fake test
|
29
|
-
def test_fail
|
30
|
-
|
31
|
-
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|