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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cfbeb7f48e3d0d69c313519deb00183597c21e4c
4
- data.tar.gz: 6bffdf8a149bcb61368dc91e3ca75b89031fef05
3
+ metadata.gz: 8d2fe1c3a1066ce9cdf96311a5f8410ed3bc3287
4
+ data.tar.gz: 5954ed7f8f68915123c5744aac205410396c46c4
5
5
  SHA512:
6
- metadata.gz: f680252a3b107bd70e75dcfc8364ab67b577e32c10d300ef46d6468ec22f8983dbe7ab659371d4d27a7867dfbcc22bbe08288ede9df265d63cab11b3daeba101
7
- data.tar.gz: ce6dd7886eb3ddb795dc644b57f86f9a674c98b812ea9588678d4ea1664934c654e04247507899e19e0e08a6c3543d2bee3df0241b0767ad49bb40948477fc35
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
@@ -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.error "#{__method__}:#{File.basename(__FILE__)}:#{__LINE__}: #{e.message}"
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.error "#{__method__}:#{File.basename(__FILE__)}:#{__LINE__}: #{e.message}"
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.error "#{__method__}:#{File.basename(__FILE__)}:#{__LINE__}: #{e.message}"
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.warn "Uknown agent state: #{state}"
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
- response = nil
447
- Net::HTTP.start(req.uri.hostname, req.uri.port, :open_timeout => 1, :read_timeout => 1) do |http|
448
- response = http.request(req)
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.error "#{__method__}:#{File.basename(__FILE__)}:#{__LINE__}: #{e.message}"
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.error "#{__method__}:#{File.basename(__FILE__)}:#{__LINE__}: #{e.message}"
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.error "#{__method__}:#{File.basename(__FILE__)}:#{__LINE__}: #{e.message}"
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.error "#{__method__}:#{File.basename(__FILE__)}:#{__LINE__}: #{e.message}"
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
@@ -1,6 +1,6 @@
1
1
  require "instana/rack"
2
2
 
3
3
  if defined?(::Cuba)
4
- ::Instana.logger.warn "Instrumenting Cuba"
4
+ ::Instana.logger.info "Instrumenting Cuba"
5
5
  Cuba.use ::Instana::Rack
6
6
  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.warn "Instrumenting ActionController"
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.warn "Instrumenting ActionController API"
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.warn "Instrumenting ActionView"
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.warn "Instrumenting ActiveRecord (mysql)"
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.warn "Instrumenting ActiveRecord (mysql2)"
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.warn "Instrumenting ActiveRecord (postgresql)"
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.warn "Instrumenting Rack"
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.warn "Instrumenting Rack"
16
+ ::Instana.logger.info "Instrumenting Rack"
17
17
  app.config.middleware.insert 0, ::Instana::Rack
18
18
  end
19
19
 
@@ -1,6 +1,6 @@
1
1
  require "instana/rack"
2
2
 
3
3
  if defined?(::Roda)
4
- ::Instana.logger.warn "Instrumenting Roda"
4
+ ::Instana.logger.info "Instrumenting Roda"
5
5
  Roda.use ::Instana::Rack
6
6
  end
@@ -4,6 +4,6 @@ require "instana/rack"
4
4
  # the latter is based on Sinatra
5
5
 
6
6
  if defined?(::Sinatra)
7
- ::Instana.logger.warn "Instrumenting Sinatra"
7
+ ::Instana.logger.info "Instrumenting Sinatra"
8
8
  ::Sinatra::Base.use ::Instana::Rack
9
9
  end
@@ -15,7 +15,7 @@ module Instana
15
15
 
16
16
  ERB.new(EUM_SNIPPET).result
17
17
  rescue => e
18
- Instana.logger.error "#{__method__}:#{File.basename(__FILE__)}:#{__LINE__}: #{e.message}"
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.error "#{__method__}:#{File.basename(__FILE__)}:#{__LINE__}: #{e.message}"
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.warn "Instrumenting Dalli"
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
@@ -65,7 +65,7 @@ if defined?(::Excon) && ::Instana.config[:excon][:enabled]
65
65
  end
66
66
  end
67
67
 
68
- ::Instana.logger.warn "Instrumenting Excon"
68
+ ::Instana.logger.info "Instrumenting Excon"
69
69
  ::Excon.defaults[:middlewares].unshift(::Instana::Instrumentation::Excon)
70
70
  end
71
71
 
@@ -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.warn "Instrumenting Net::HTTP"
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.warn "Instrumenting RestClient"
32
+ ::Instana.logger.info "Instrumenting RestClient"
33
33
  ::RestClient::Request.send(:include, ::Instana::Instrumentation::RestClientRequest)
34
34
  end
@@ -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.error "#{__method__}:#{File.basename(__FILE__)}:#{__LINE__}: #{e.message}"
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.error "#{__method__}:#{File.basename(__FILE__)}:#{__LINE__}: #{e.message}"
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.error "#{__method__}:#{File.basename(__FILE__)}:#{__LINE__}: #{e.message}"
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
@@ -1,4 +1,4 @@
1
1
  module Instana
2
- VERSION = "1.4.9"
2
+ VERSION = "1.4.11"
3
3
  VERSION_FULL = "instana-#{VERSION}"
4
4
  end
@@ -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.9
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-07 00:00:00.000000000 Z
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.12
273
+ rubygems_version: 2.6.11
274
274
  signing_key:
275
275
  specification_version: 4
276
276
  summary: Ruby sensor for Instana