newrelic-aws 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2013 Change.org, Inc
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,33 @@
1
+ # NewRelic for Ruby AWS-SDK
2
+
3
+ Unofficial [NewRelic](http://newrelic.com/) instrumentation for the [official AWS SDK](http://aws.amazon.com/sdkforruby/).
4
+
5
+ At present, this is an embryonic set of instrumentation focussing primarily on the underlying client
6
+ and S3 functionality plus a little bit of SQS and Simple Email Service. Pull requests are welcome!
7
+
8
+ ## Installation
9
+
10
+ Add this line to your application's Gemfile:
11
+
12
+ gem 'newrelic_aws'
13
+
14
+ And then execute:
15
+
16
+ $ bundle
17
+
18
+ Or install it yourself with:
19
+
20
+ $ gem install newrelic_aws
21
+
22
+ If you're having trouble with NewRelic attepmting to instrument the old `AWS::S3` [gem](https://github.com/marcel/aws-s3)
23
+ (the one not created by Amazon that is mostly unmaintained) you may want to add `disable_aws-s3: true` to your `newrelic.yml`
24
+ configuration. NewRelic has this intrumentation built-in, and it may complain since Amazon's SDK uses the same namespace but
25
+ a different class structure.
26
+
27
+ ## Contributing
28
+
29
+ 1. Fork it
30
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
31
+ 3. Commit your changes (`git commit -am 'Added some feature'`)
32
+ 4. Push to the branch (`git push origin my-new-feature`)
33
+ 5. Create new Pull Request
@@ -0,0 +1,2 @@
1
+ require "newrelic-aws/instrumentation"
2
+ require "newrelic-aws/version"
@@ -0,0 +1,54 @@
1
+ # encoding: utf-8
2
+ require 'new_relic/agent/method_tracer'
3
+
4
+ DependencyDetection.defer do
5
+ @name = :aws
6
+
7
+ executes do
8
+ ::NewRelic::Agent.logger.info 'Installing AWS SDK instrumentation'
9
+ end
10
+
11
+ depends_on do
12
+ # Enough to differentiate it from the namespace-conflicting AWS::S3 commonly in use
13
+ defined?(AWS::Core)
14
+ end
15
+
16
+ executes do
17
+ # We instrument a few AWS::Core::Client methods so we aren't blind to calls that aren't
18
+ # yet specifically instrumented at a higher level.
19
+ AWS::Core::Client.class_eval do
20
+ add_method_tracer :client_request
21
+ add_method_tracer :make_async_request
22
+ add_method_tracer :make_sync_request
23
+ end
24
+
25
+ AWS::S3::Bucket.class_eval do
26
+ add_method_tracer :clear!
27
+ add_method_tracer :delete
28
+ add_method_tracer :delete!
29
+ add_method_tracer :objects
30
+ add_method_tracer :versions
31
+ end
32
+
33
+ AWS::S3::S3Object.class_eval do
34
+ add_method_tracer :read
35
+ add_method_tracer :write
36
+ add_method_tracer :delete
37
+ add_method_tracer :head
38
+ end
39
+
40
+ AWS::SQS::Queue.class_eval do
41
+ add_method_tracer :batch_delete
42
+ add_method_tracer :batch_send
43
+ add_method_tracer :exists?
44
+ add_method_tracer :poll
45
+ add_method_tracer :receive_message
46
+ add_method_tracer :send_message
47
+ end
48
+
49
+ AWS::SimpleEmailService.class_eval do
50
+ add_method_tracer :send_email
51
+ add_method_tracer :send_raw_email
52
+ end
53
+ end
54
+ end
@@ -0,0 +1,3 @@
1
+ module NewrelicAWS
2
+ VERSION = '0.0.5'
3
+ end
metadata ADDED
@@ -0,0 +1,67 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: newrelic-aws
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.5
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Kyle VanderBeek
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2013-10-19 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: newrelic_rpm
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: 3.5.0
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: 3.5.0
30
+ description: Unofficial New Relic Instrumentation for the official AWS SDK
31
+ email:
32
+ - kyle@change.org
33
+ executables: []
34
+ extensions: []
35
+ extra_rdoc_files: []
36
+ files:
37
+ - lib/newrelic-aws/instrumentation.rb
38
+ - lib/newrelic-aws/version.rb
39
+ - lib/newrelic-aws.rb
40
+ - LICENSE
41
+ - README.md
42
+ homepage: http://github.com/change/newrelic-aws
43
+ licenses:
44
+ - MIT
45
+ post_install_message:
46
+ rdoc_options: []
47
+ require_paths:
48
+ - lib
49
+ required_ruby_version: !ruby/object:Gem::Requirement
50
+ none: false
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ required_rubygems_version: !ruby/object:Gem::Requirement
56
+ none: false
57
+ requirements:
58
+ - - ! '>='
59
+ - !ruby/object:Gem::Version
60
+ version: '0'
61
+ requirements: []
62
+ rubyforge_project:
63
+ rubygems_version: 1.8.23
64
+ signing_key:
65
+ specification_version: 3
66
+ summary: Unofficial New Relic Instrumentation for the official AWS SDK
67
+ test_files: []