scout_apm 1.4.1 → 1.4.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ecdf92000eedbccd7433a68129281cd82847556c
4
- data.tar.gz: e703b9dfa3aaf7f2a048ff31b9e6c66777dd3a35
3
+ metadata.gz: 5dfbd237d7807fb1bb725e664bb1f13a985bdca1
4
+ data.tar.gz: bbff3e6d54f08e072b93789f3d3430ca10fe601b
5
5
  SHA512:
6
- metadata.gz: ceadce82ba6554b9217f5fc7d99b6f949db06d59c53f5728a48b23c6cba78a0ee068ad56cb04272879d35bd935fa1bf739fa93ed5618be96f57f3b3ebbf8aa3b
7
- data.tar.gz: d75d311f1304aeecfa3b3be98ca3dc7874ba7d932c5a389f3b879f8d9dfca5b5ef782cc3bae5959d7d5ff0be7b461252046d19c33ce7943828d80e087f203ee1
6
+ metadata.gz: f794b60fc223dc0ad1077b60d33de95675d1e6fcc4bf2126a66a49889815d9b35f2d92f854f2863ad7c59b9938b93e5491ec1e1c4812c4a76eb997e20ff7d83d
7
+ data.tar.gz: 2758c61a4b2e6eb6bcc8c0fffe8809de7286716d02a42ebc3bbf629fbef15fad88179058ce519f9e4402f712c2c76adc73a8cc5b1851ef7d62680f4be37875bb
data/CHANGELOG.markdown CHANGED
@@ -1,3 +1,7 @@
1
+ # 1.4.2
2
+
3
+ * Add HTTPClient instrumentation
4
+
1
5
  # 1.4.1
2
6
 
3
7
  * Fix JSON encoding of special characters
data/lib/scout_apm.rb CHANGED
@@ -59,6 +59,7 @@ require 'scout_apm/deploy_integrations/capistrano_3'
59
59
  #require 'scout_apm/deploy_integrations/capistrano_2'
60
60
 
61
61
  require 'scout_apm/instruments/net_http'
62
+ require 'scout_apm/instruments/http_client'
62
63
  require 'scout_apm/instruments/moped'
63
64
  require 'scout_apm/instruments/mongoid'
64
65
  require 'scout_apm/instruments/delayed_job'
@@ -252,6 +252,7 @@ module ScoutApm
252
252
  install_instrument(ScoutApm::Instruments::Moped)
253
253
  install_instrument(ScoutApm::Instruments::Mongoid)
254
254
  install_instrument(ScoutApm::Instruments::NetHttp)
255
+ install_instrument(ScoutApm::Instruments::HttpClient)
255
256
 
256
257
  if StackProf.respond_to?(:fake?) && StackProf.fake?
257
258
  logger.info 'StackProf not found - add `gem "stackprof"` to your Gemfile to enable advanced code profiling (only for Ruby 2.1+)'
@@ -0,0 +1,41 @@
1
+ module ScoutApm
2
+ module Instruments
3
+ class HttpClient
4
+ attr_reader :logger
5
+
6
+ def initalize(logger=ScoutApm::Agent.instance.logger)
7
+ @logger = logger
8
+ @installed = false
9
+ end
10
+
11
+ def installed?
12
+ @installed
13
+ end
14
+
15
+ def install
16
+ @installed = true
17
+
18
+ if defined?(::HTTPClient)
19
+ ScoutApm::Agent.instance.logger.info "Instrumenting HTTPClient"
20
+
21
+ ::HTTPClient.class_eval do
22
+ include ScoutApm::Tracer
23
+
24
+ def request_with_scout_instruments(*args, &block)
25
+ method = args[0].to_s
26
+ url = args[1]
27
+ url = url && url[0..99]
28
+
29
+ self.class.instrument("HTTP", method, :desc => url) do
30
+ request_without_scout_instruments(*args, &block)
31
+ end
32
+ end
33
+
34
+ alias request_without_scout_instruments request
35
+ alias request request_with_scout_instruments
36
+ end
37
+ end
38
+ end
39
+ end
40
+ end
41
+ end
@@ -1,4 +1,4 @@
1
1
  module ScoutApm
2
- VERSION = "1.4.1"
2
+ VERSION = "1.4.2"
3
3
  end
4
4
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scout_apm
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.1
4
+ version: 1.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Derek Haynes
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-02-24 00:00:00.000000000 Z
12
+ date: 2016-03-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: minitest
@@ -92,6 +92,7 @@ files:
92
92
  - lib/scout_apm/instruments/action_controller_rails_3_rails4.rb
93
93
  - lib/scout_apm/instruments/active_record.rb
94
94
  - lib/scout_apm/instruments/delayed_job.rb
95
+ - lib/scout_apm/instruments/http_client.rb
95
96
  - lib/scout_apm/instruments/middleware_detailed.rb
96
97
  - lib/scout_apm/instruments/middleware_summary.rb
97
98
  - lib/scout_apm/instruments/mongoid.rb