instana 1.4.9 → 1.4.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +2 -2
- data/lib/instana/agent.rb +18 -8
- data/lib/instana/collectors/gc.rb +7 -4
- data/lib/instana/collectors/memory.rb +1 -1
- data/lib/instana/collectors/thread.rb +1 -1
- data/lib/instana/frameworks/cuba.rb +1 -1
- data/lib/instana/frameworks/instrumentation/action_controller.rb +2 -2
- data/lib/instana/frameworks/instrumentation/action_view.rb +1 -1
- data/lib/instana/frameworks/instrumentation/active_record.rb +3 -3
- data/lib/instana/frameworks/rails.rb +2 -2
- data/lib/instana/frameworks/roda.rb +1 -1
- data/lib/instana/frameworks/sinatra.rb +1 -1
- data/lib/instana/helpers.rb +2 -2
- data/lib/instana/instrumentation/dalli.rb +1 -1
- data/lib/instana/instrumentation/excon.rb +1 -1
- data/lib/instana/instrumentation/net-http.rb +1 -1
- data/lib/instana/instrumentation/rack.rb +1 -1
- data/lib/instana/instrumentation/rest-client.rb +1 -1
- data/lib/instana/util.rb +4 -3
- data/lib/instana/version.rb +1 -1
- data/test/test_helper.rb +2 -3
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8d2fe1c3a1066ce9cdf96311a5f8410ed3bc3287
|
4
|
+
data.tar.gz: 5954ed7f8f68915123c5744aac205410396c46c4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c4716bb1f8e1dff2ae322bc6eead9bc7f6a2cebd364d11f6c098a320a6bfdb57d3dcc4a58ef4f8d2d1fad1c901ca6abc9998bd93b2db49a34bec6a914088c122
|
7
|
+
data.tar.gz: dd5ba99e78b1096c24954c43f234e424e8e7a94aef533f827b607d6306aa9bbd16b34c3763d53f9813ef978561cab84f426825a5cf5c42e75678f01e9b761b94
|
data/Gemfile
CHANGED
@@ -18,10 +18,10 @@ end
|
|
18
18
|
group :development do
|
19
19
|
gem 'ruby-debug', :platforms => [:mri_18, :jruby]
|
20
20
|
gem 'debugger', :platform => :mri_19
|
21
|
-
gem 'byebug', :platforms => [:mri_20, :mri_21, :mri_22, :mri_23]
|
21
|
+
gem 'byebug', :platforms => [:mri_20, :mri_21, :mri_22, :mri_23, :mri_24]
|
22
22
|
if RUBY_VERSION > '1.8.7'
|
23
23
|
gem 'pry'
|
24
|
-
gem 'pry-byebug', :platforms => [:mri_20, :mri_21, :mri_22, :mri_23]
|
24
|
+
gem 'pry-byebug', :platforms => [:mri_20, :mri_21, :mri_22, :mri_23, :mri_24]
|
25
25
|
else
|
26
26
|
gem 'pry', '0.9.12.4'
|
27
27
|
end
|
data/lib/instana/agent.rb
CHANGED
@@ -44,6 +44,10 @@ module Instana
|
|
44
44
|
@default_gateway = nil
|
45
45
|
end
|
46
46
|
|
47
|
+
# Re-useable HTTP client for communication with
|
48
|
+
# the host agent.
|
49
|
+
@httpclient = nil
|
50
|
+
|
47
51
|
# Collect initial process info - repeat prior to announce
|
48
52
|
# in `announce_sensor` in case of process rename, after fork etc.
|
49
53
|
@process = ::Instana::Util.collect_process_info
|
@@ -204,7 +208,7 @@ module Instana
|
|
204
208
|
false
|
205
209
|
end
|
206
210
|
rescue => e
|
207
|
-
Instana.logger.
|
211
|
+
Instana.logger.info "#{__method__}:#{File.basename(__FILE__)}:#{__LINE__}: #{e.message}"
|
208
212
|
Instana.logger.debug e.backtrace.join("\r\n")
|
209
213
|
return false
|
210
214
|
ensure
|
@@ -245,7 +249,7 @@ module Instana
|
|
245
249
|
end
|
246
250
|
false
|
247
251
|
rescue => e
|
248
|
-
Instana.logger.
|
252
|
+
Instana.logger.debug "#{__method__}:#{File.basename(__FILE__)}:#{__LINE__}: #{e.message}"
|
249
253
|
Instana.logger.debug e.backtrace.join("\r\n")
|
250
254
|
end
|
251
255
|
|
@@ -328,7 +332,7 @@ module Instana
|
|
328
332
|
end
|
329
333
|
false
|
330
334
|
rescue => e
|
331
|
-
Instana.logger.
|
335
|
+
Instana.logger.debug "#{__method__}:#{File.basename(__FILE__)}:#{__LINE__}: #{e.message}"
|
332
336
|
Instana.logger.debug e.backtrace.join("\r\n") unless ::Instana.test?
|
333
337
|
return false
|
334
338
|
end
|
@@ -424,9 +428,11 @@ module Instana
|
|
424
428
|
|
425
429
|
when :unannounced
|
426
430
|
@state = :unannounced
|
431
|
+
# Reset our HTTP client
|
432
|
+
@httpclient = nil
|
427
433
|
|
428
434
|
else
|
429
|
-
::Instana.logger.
|
435
|
+
::Instana.logger.debug "Uknown agent state: #{state}"
|
430
436
|
end
|
431
437
|
::Instana.collector.reset_timer!
|
432
438
|
true
|
@@ -443,16 +449,20 @@ module Instana
|
|
443
449
|
req['Accept'] = MIME_JSON
|
444
450
|
req['Content-Type'] = MIME_JSON
|
445
451
|
|
446
|
-
|
447
|
-
|
448
|
-
|
452
|
+
if @state == :unannounced
|
453
|
+
@httpclient = Net::HTTP.new(req.uri.hostname, req.uri.port)
|
454
|
+
@httpclient.open_timeout = 1
|
455
|
+
@httpclient.read_timeout = 1
|
449
456
|
end
|
457
|
+
|
458
|
+
response = @httpclient.request(req)
|
450
459
|
::Instana.logger.agent_comm "#{req.method}->#{req.uri} body:(#{req.body}) Response:#{response} body:(#{response.body})"
|
460
|
+
|
451
461
|
response
|
452
462
|
rescue Errno::ECONNREFUSED
|
453
463
|
return nil
|
454
464
|
rescue => e
|
455
|
-
Instana.logger.
|
465
|
+
Instana.logger.debug "#{__method__}:#{File.basename(__FILE__)}:#{__LINE__}: #{e.message}"
|
456
466
|
Instana.logger.debug e.backtrace.join("\r\n") unless ::Instana.test?
|
457
467
|
return nil
|
458
468
|
end
|
@@ -34,14 +34,17 @@ module Instana
|
|
34
34
|
# time around.
|
35
35
|
@last_major_count = stats[:major_gc_count]
|
36
36
|
@last_minor_count = stats[:minor_gc_count]
|
37
|
+
|
38
|
+
@this_gc[:heap_live] = stats[:heap_live_slots] || stats[:heap_live_num]
|
39
|
+
@this_gc[:heap_free] = stats[:heap_free_slots] || stats[:heap_free_num]
|
40
|
+
else
|
41
|
+
@this_gc[:heap_live] = stats[:heap_live_slot] || stats[:heap_live_num]
|
42
|
+
@this_gc[:heap_free] = stats[:heap_free_slot] || stats[:heap_free_num]
|
37
43
|
end
|
38
44
|
|
39
|
-
# GC Heap
|
40
|
-
@this_gc[:heap_live] = stats[:heap_live_slot] || stats[:heap_live_slots] || stats[:heap_live_num]
|
41
|
-
@this_gc[:heap_free] = stats[:heap_free_slot] || stats[:heap_free_slots] || stats[:heap_free_num]
|
42
45
|
@this_gc
|
43
46
|
rescue => e
|
44
|
-
::Instana.logger.
|
47
|
+
::Instana.logger.info "#{__method__}:#{File.basename(__FILE__)}:#{__LINE__}: #{e.message}"
|
45
48
|
::Instana.logger.debug e.backtrace.join("\r\n")
|
46
49
|
end
|
47
50
|
end
|
@@ -21,7 +21,7 @@ module Instana
|
|
21
21
|
@this_mem[:rss_size] = ::GetProcessMem.new(Process.pid).kb
|
22
22
|
@this_mem
|
23
23
|
rescue => e
|
24
|
-
::Instana.logger.
|
24
|
+
::Instana.logger.info "#{__method__}:#{File.basename(__FILE__)}:#{__LINE__}: #{e.message}"
|
25
25
|
::Instana.logger.debug e.backtrace.join("\r\n")
|
26
26
|
end
|
27
27
|
end
|
@@ -17,7 +17,7 @@ module Instana
|
|
17
17
|
@this_count[:count] = ::Thread.list.count
|
18
18
|
@this_count
|
19
19
|
rescue => e
|
20
|
-
::Instana.logger.
|
20
|
+
::Instana.logger.info "#{__method__}:#{File.basename(__FILE__)}:#{__LINE__}: #{e.message}"
|
21
21
|
::Instana.logger.debug e.backtrace.join("\r\n")
|
22
22
|
end
|
23
23
|
end
|
@@ -151,7 +151,7 @@ module Instana
|
|
151
151
|
end
|
152
152
|
|
153
153
|
if defined?(::ActionController) && ::Instana.config[:action_controller][:enabled] && ::ActionPack::VERSION::MAJOR >= 2
|
154
|
-
::Instana.logger.
|
154
|
+
::Instana.logger.info "Instrumenting ActionController"
|
155
155
|
if ActionPack::VERSION::MAJOR >= 5
|
156
156
|
::ActionController::Base.send(:prepend, ::Instana::Instrumentation::ActionController)
|
157
157
|
else
|
@@ -166,6 +166,6 @@ end
|
|
166
166
|
# We allow ActionController::API instrumentation in version of Ruby on Rails 3 and higher.
|
167
167
|
#
|
168
168
|
if defined?(::ActionController::API) && ::Instana.config[:action_controller][:enabled] && ::ActionPack::VERSION::MAJOR >= 3
|
169
|
-
::Instana.logger.
|
169
|
+
::Instana.logger.info "Instrumenting ActionController API"
|
170
170
|
::ActionController::API.send(:prepend, ::Instana::Instrumentation::ActionController)
|
171
171
|
end
|
@@ -38,6 +38,6 @@ module Instana
|
|
38
38
|
end
|
39
39
|
|
40
40
|
if defined?(::ActionView) && ::Instana.config[:action_view][:enabled] && ::ActionPack::VERSION::STRING >= '3.1'
|
41
|
-
::Instana.logger.
|
41
|
+
::Instana.logger.info "Instrumenting ActionView"
|
42
42
|
::ActionView::PartialRenderer.send(:include, ::Instana::Instrumentation::ActionViewRenderer)
|
43
43
|
end
|
@@ -8,18 +8,18 @@ if defined?(::ActiveRecord) && ::Instana.config[:active_record][:enabled]
|
|
8
8
|
|
9
9
|
# Mysql
|
10
10
|
if defined?(ActiveRecord::ConnectionAdapters::MysqlAdapter)
|
11
|
-
::Instana.logger.
|
11
|
+
::Instana.logger.info "Instrumenting ActiveRecord (mysql)"
|
12
12
|
ActiveRecord::ConnectionAdapters::MysqlAdapter.send(:include, ::Instana::Instrumentation::MysqlAdapter)
|
13
13
|
ActiveRecord::ConnectionAdapters::AbstractMysqlAdapter.send(:include, ::Instana::Instrumentation::AbstractMysqlAdapter)
|
14
14
|
|
15
15
|
# Mysql2
|
16
16
|
elsif defined?(ActiveRecord::ConnectionAdapters::Mysql2Adapter)
|
17
|
-
::Instana.logger.
|
17
|
+
::Instana.logger.info "Instrumenting ActiveRecord (mysql2)"
|
18
18
|
ActiveRecord::ConnectionAdapters::Mysql2Adapter.send(:include, ::Instana::Instrumentation::Mysql2Adapter)
|
19
19
|
|
20
20
|
# Postgres
|
21
21
|
elsif defined?(ActiveRecord::ConnectionAdapters::PostgreSQLAdapter)
|
22
|
-
::Instana.logger.
|
22
|
+
::Instana.logger.info "Instrumenting ActiveRecord (postgresql)"
|
23
23
|
ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.send(:include, ::Instana::Instrumentation::PostgreSQLAdapter)
|
24
24
|
|
25
25
|
else
|
@@ -6,14 +6,14 @@ if defined?(::Rails)
|
|
6
6
|
|
7
7
|
if ::Rails::VERSION::MAJOR < 3
|
8
8
|
::Rails.configuration.after_initialization do
|
9
|
-
::Instana.logger.
|
9
|
+
::Instana.logger.info "Instrumenting Rack"
|
10
10
|
::Rails.configuration.middleware.insert 0, ::Instana::Rack
|
11
11
|
end
|
12
12
|
else
|
13
13
|
module ::Instana
|
14
14
|
class Railtie < ::Rails::Railtie
|
15
15
|
initializer 'instana.rack' do |app|
|
16
|
-
::Instana.logger.
|
16
|
+
::Instana.logger.info "Instrumenting Rack"
|
17
17
|
app.config.middleware.insert 0, ::Instana::Rack
|
18
18
|
end
|
19
19
|
|
data/lib/instana/helpers.rb
CHANGED
@@ -15,7 +15,7 @@ module Instana
|
|
15
15
|
|
16
16
|
ERB.new(EUM_SNIPPET).result
|
17
17
|
rescue => e
|
18
|
-
Instana.logger.
|
18
|
+
Instana.logger.info "#{__method__}:#{File.basename(__FILE__)}:#{__LINE__}: #{e.message}"
|
19
19
|
Instana.logger.debug e.backtrace.join("\r\n")
|
20
20
|
return nil
|
21
21
|
end
|
@@ -31,7 +31,7 @@ module Instana
|
|
31
31
|
|
32
32
|
ERB.new(EUM_TEST_SNIPPET).result
|
33
33
|
rescue => e
|
34
|
-
Instana.logger.
|
34
|
+
Instana.logger.info "#{__method__}:#{File.basename(__FILE__)}:#{__LINE__}: #{e.message}"
|
35
35
|
Instana.logger.debug e.backtrace.join("\r\n")
|
36
36
|
return nil
|
37
37
|
end
|
@@ -72,7 +72,7 @@ module Instana
|
|
72
72
|
end
|
73
73
|
|
74
74
|
if defined?(::Dalli) && ::Instana.config[:dalli][:enabled]
|
75
|
-
::Instana.logger.
|
75
|
+
::Instana.logger.info "Instrumenting Dalli"
|
76
76
|
::Dalli::Client.send(:include, ::Instana::Instrumentation::Dalli)
|
77
77
|
::Dalli::Server.send(:include, ::Instana::Instrumentation::DalliServer)
|
78
78
|
end
|
@@ -57,7 +57,7 @@ if defined?(::Net::HTTP) && ::Instana.config[:nethttp][:enabled]
|
|
57
57
|
::Instana.tracer.log_exit(:'net-http', kv_payload)
|
58
58
|
end
|
59
59
|
|
60
|
-
Instana.logger.
|
60
|
+
Instana.logger.info "Instrumenting Net::HTTP"
|
61
61
|
|
62
62
|
alias request_without_instana request
|
63
63
|
alias request request_with_instana
|
@@ -30,7 +30,7 @@ module Instana
|
|
30
30
|
if ::Instana.tracer.tracing?
|
31
31
|
kvs[:http][:status] = status
|
32
32
|
|
33
|
-
if status.between?(500, 511)
|
33
|
+
if !status.is_a?(Integer) || status.between?(500, 511)
|
34
34
|
# Because of the 5xx response, we flag this span as errored but
|
35
35
|
# without a backtrace (no exception)
|
36
36
|
::Instana.tracer.log_error(nil)
|
@@ -29,6 +29,6 @@ module Instana
|
|
29
29
|
end
|
30
30
|
|
31
31
|
if defined?(::RestClient::Request) && ::Instana.config[:'rest-client'][:enabled]
|
32
|
-
::Instana.logger.
|
32
|
+
::Instana.logger.info "Instrumenting RestClient"
|
33
33
|
::RestClient::Request.send(:include, ::Instana::Instrumentation::RestClientRequest)
|
34
34
|
end
|
data/lib/instana/util.rb
CHANGED
@@ -90,6 +90,7 @@ module Instana
|
|
90
90
|
|
91
91
|
data[:sensorVersion] = ::Instana::VERSION
|
92
92
|
data[:ruby_version] = RUBY_VERSION
|
93
|
+
data[:rpl] = RUBY_PATCHLEVEL if defined?(RUBY_PATCHLEVEL)
|
93
94
|
|
94
95
|
# Framework Detection
|
95
96
|
if defined?(::RailsLts::VERSION)
|
@@ -119,7 +120,7 @@ module Instana
|
|
119
120
|
|
120
121
|
data
|
121
122
|
rescue => e
|
122
|
-
::Instana.logger.
|
123
|
+
::Instana.logger.debug "#{__method__}:#{File.basename(__FILE__)}:#{__LINE__}: #{e.message}"
|
123
124
|
::Instana.logger.debug e.backtrace.join("\r\n")
|
124
125
|
return data
|
125
126
|
end
|
@@ -193,7 +194,7 @@ module Instana
|
|
193
194
|
end
|
194
195
|
[id.to_i].pack('q>').unpack('H*')[0].gsub(/^0+/, '')
|
195
196
|
rescue => e
|
196
|
-
Instana.logger.
|
197
|
+
Instana.logger.info "#{__method__}:#{File.basename(__FILE__)}:#{__LINE__}: #{e.message}"
|
197
198
|
Instana.logger.debug e.backtrace.join("\r\n")
|
198
199
|
end
|
199
200
|
|
@@ -216,7 +217,7 @@ module Instana
|
|
216
217
|
end
|
217
218
|
[header_id].pack("H*").unpack("q>")[0]
|
218
219
|
rescue => e
|
219
|
-
Instana.logger.
|
220
|
+
Instana.logger.info "#{__method__}:#{File.basename(__FILE__)}:#{__LINE__}: #{e.message}"
|
220
221
|
Instana.logger.debug e.backtrace.join("\r\n")
|
221
222
|
end
|
222
223
|
end
|
data/lib/instana/version.rb
CHANGED
data/test/test_helper.rb
CHANGED
@@ -9,7 +9,6 @@ require "minitest/autorun"
|
|
9
9
|
require "minitest/reporters"
|
10
10
|
require "minitest/debugger" if ENV['DEBUG']
|
11
11
|
require 'webmock/minitest'
|
12
|
-
::WebMock.disable_net_connect!(allow_localhost: true)
|
13
12
|
|
14
13
|
require "instana/test"
|
15
14
|
::Instana::Test.setup_environment
|
@@ -19,11 +18,11 @@ require "./test/servers/rackapp_6511"
|
|
19
18
|
|
20
19
|
case File.basename(ENV['BUNDLE_GEMFILE'])
|
21
20
|
when /rails50|rails42|rails32/
|
21
|
+
# Allow localhost calls to the internal rails servers
|
22
|
+
::WebMock.disable_net_connect!(allow_localhost: true)
|
22
23
|
require './test/servers/rails_3205'
|
23
24
|
end
|
24
25
|
|
25
|
-
WebMock.disable_net_connect!(allow_localhost: true)
|
26
|
-
|
27
26
|
Minitest::Reporters.use! MiniTest::Reporters::SpecReporter.new
|
28
27
|
|
29
28
|
# Set this (or a subset) if you want increased debug output
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: instana
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Giacomo Lombardo
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-06-
|
11
|
+
date: 2017-06-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -270,7 +270,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
270
270
|
version: '0'
|
271
271
|
requirements: []
|
272
272
|
rubyforge_project:
|
273
|
-
rubygems_version: 2.6.
|
273
|
+
rubygems_version: 2.6.11
|
274
274
|
signing_key:
|
275
275
|
specification_version: 4
|
276
276
|
summary: Ruby sensor for Instana
|