instana 1.9.5 → 1.9.6

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
  SHA256:
3
- metadata.gz: 5d484b67adb54ad885c11555d05f53269245ca0406a5b74e98e2045494edc957
4
- data.tar.gz: c7c72e9f23641b258cae02c9e424ac35257db56c8c550a8abb133f22a7d26b52
3
+ metadata.gz: a3d6441f6a619ad0643ea9a9afbcebefd86d57171dc14cc12eccd71dbbbb0db8
4
+ data.tar.gz: b4b5ea14c821e9a3b53cc9e41b4a0e5e4a9026ec586b8c5753055f292d631cea
5
5
  SHA512:
6
- metadata.gz: 1de7b6608d8b7ec849bf1f668f167f7e88b5650451b05a17ec9de3e52cb50497629af46a066730b3f3f87403562227e3a52f93eac27bb8dd15691df0f2cbdd0b
7
- data.tar.gz: 7fe4ea25642c04dfc249301a0a37a28d1c64066ecb0c778f19c7b7961652ff051b11e498df7c981345880f95c9d0779224c352f0f6be2596c0ea67fa80bc62e8
6
+ metadata.gz: a416ce7dd571f2eb2dff56d1460dabb528cd0683bd5e9d09534db2bdd352ddd400bbd79c1ddfae804908df725cafa1587e5cc91c5fec26eff5ce44477aa090d8
7
+ data.tar.gz: c8eff792dba833a94420b58d3a27f55402aa90dd94a99594565c0b4a7610de1fa3c76a7b410d582dac4351783afcff362410e2718c793611fcef203c78dde1e9
data/.gitignore CHANGED
@@ -13,3 +13,4 @@ gemfiles/*.lock
13
13
  /test/tmp/*.pid
14
14
  .idea
15
15
  *.iml
16
+ .DS_Store
data/.travis.yml CHANGED
@@ -10,9 +10,8 @@ rvm:
10
10
  - 2.4
11
11
 
12
12
  before_install:
13
- # Re: https://docs.travis-ci.com/user/languages/ruby/#dependency-management
14
- - gem uninstall -v '>= 2' -i $(rvm gemdir)@global -ax bundler || true
15
- - gem install bundler -v '< 2'
13
+ - gem update --system
14
+ - gem install bundler
16
15
  - gem --version
17
16
 
18
17
  before_script:
@@ -25,12 +24,12 @@ services:
25
24
  - memcached
26
25
  - redis
27
26
  - mysql
27
+ - postgresql
28
28
 
29
29
  gemfile:
30
30
  - Gemfile
31
31
  - gemfiles/libraries.gemfile
32
32
  - gemfiles/rails50.gemfile
33
- - gemfiles/rails42.gemfile
34
33
 
35
34
  matrix:
36
35
  exclude:
data/Configuration.md CHANGED
@@ -74,7 +74,7 @@ export INSTANA_SERVICE_NAME=MrBlueSky
74
74
 
75
75
  ## Rack Middleware
76
76
 
77
- This gem will detect and automagically insert the Instana Rack middleware into the middleware stack when a [supported framework](https://instana.atlassian.net/wiki/display/DOCS/Ruby) is present. We are currently adding support for more frameworks. If you are using a yet to be instrumented framework, you can insert the Instana Rack middleware with the following:
77
+ This gem will detect and automagically insert the Instana Rack middleware into the middleware stack when a [supported framework](https://docs.instana.io/ecosystem/ruby/) is present. We are currently adding support for more frameworks. If you are using a yet to be instrumented framework, you can insert the Instana Rack middleware with the following:
78
78
 
79
79
  ```Ruby
80
80
  require "instana/rack"
data/Rakefile CHANGED
@@ -10,34 +10,41 @@ Rake::TestTask.new(:test) do |t|
10
10
  t.libs << "lib"
11
11
  t.test_files = FileList['test/**/*_test.rb']
12
12
 
13
- case File.basename(ENV['BUNDLE_GEMFILE']).split('.').first
14
- when /rails50/
15
- t.test_files = [ 'test/frameworks/rails/activerecord5_test.rb',
16
- 'test/frameworks/rails/actioncontroller_test.rb',
17
- 'test/frameworks/rails/actionview5_test.rb' ]
18
- when /rails42/
19
- t.test_files = [ 'test/frameworks/rails/activerecord4_test.rb',
20
- 'test/frameworks/rails/actioncontroller_test.rb',
21
- 'test/frameworks/rails/actionview4_test.rb' ]
22
- when /rails32/
23
- t.test_files = [ 'test/frameworks/rails/activerecord3_test.rb',
24
- 'test/frameworks/rails/actioncontroller_test.rb',
25
- 'test/frameworks/rails/actionview3_test.rb' ]
26
- when /libraries/
27
- t.test_files = FileList['test/instrumentation/*_test.rb',
28
- 'test/frameworks/cuba_test.rb',
29
- 'test/frameworks/roda_test.rb',
30
- 'test/frameworks/sinatra_test.rb']
13
+ if ENV.key?('BUNDLE_GEMFILE')
14
+ case File.basename(ENV['BUNDLE_GEMFILE']).split('.').first
15
+ when /rails50/
16
+ t.test_files = %w(test/frameworks/rails/activerecord5_test.rb
17
+ test/frameworks/rails/actioncontroller_test.rb
18
+ test/frameworks/rails/actionview5_test.rb)
19
+ when /rails42/
20
+ t.test_files = %w(test/frameworks/rails/activerecord4_test.rb
21
+ test/frameworks/rails/actioncontroller_test.rb
22
+ test/frameworks/rails/actionview4_test.rb)
23
+ when /rails32/
24
+ t.test_files = %w(test/frameworks/rails/activerecord3_test.rb
25
+ test/frameworks/rails/actioncontroller_test.rb
26
+ test/frameworks/rails/actionview3_test.rb)
27
+ when /libraries/
28
+ t.test_files = FileList['test/instrumentation/*_test.rb',
29
+ 'test/frameworks/cuba_test.rb',
30
+ 'test/frameworks/roda_test.rb',
31
+ 'test/frameworks/sinatra_test.rb']
32
+ else
33
+ t.test_files = FileList['test/agent/*_test.rb'] +
34
+ FileList['test/tracing/*_test.rb'] +
35
+ FileList['test/profiling/*_test.rb'] +
36
+ FileList['test/benchmarks/bench_*.rb']
37
+ end
31
38
  else
32
39
  t.test_files = FileList['test/agent/*_test.rb'] +
33
- FileList['test/tracing/*_test.rb'] +
34
- FileList['test/profiling/*_test.rb'] +
35
- FileList['test/benchmarks/bench_*.rb']
40
+ FileList['test/tracing/*_test.rb'] +
41
+ FileList['test/profiling/*_test.rb'] +
42
+ FileList['test/benchmarks/bench_*.rb']
36
43
  end
37
44
  end
38
45
 
39
46
  task :environment do
40
- ENV['INSTANA_GEM_DEV'] = 'true'
47
+ ENV['INSTANA_DEBUG'] = 'true'
41
48
  Bundler.require(:default, :development)
42
49
  end
43
50
 
data/Troubleshooting.md CHANGED
@@ -6,7 +6,7 @@ goes wrong, you can use the following steps and tips to potentially diagnose any
6
6
  # Supported Components
7
7
 
8
8
  Make sure that the component that you want to get visibility into has been added to the support matrix. A list of all
9
- supported components can be found in the [documentation](https://instana.atlassian.net/wiki/display/DOCS/Ruby).
9
+ supported components can be found in the [documentation](https://docs.instana.io/ecosystem/ruby/).
10
10
 
11
11
  # Logging & Environment Variables
12
12
 
@@ -49,7 +49,7 @@ gem 'excon'
49
49
 
50
50
  # Memcache
51
51
  gem 'dalli'
52
- gem 'redis', '< 4.0.0'
52
+ gem 'redis'
53
53
 
54
54
  # Background Job queuing and processing
55
55
  if RUBY_VERSION < '2.2'
data/instana.gemspec CHANGED
@@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
23
23
 
24
24
  spec.licenses = ['MIT']
25
25
 
26
- spec.add_development_dependency "bundler", "~> 1.11"
26
+ spec.add_development_dependency "bundler", "~> 2.0"
27
27
  spec.add_development_dependency "rake", "~> 10.0"
28
28
  spec.add_development_dependency "minitest", "~> 5.0"
29
29
 
data/lib/instana/base.rb CHANGED
@@ -1,5 +1,5 @@
1
+ require "logger"
1
2
  require "instana/version"
2
- require 'instana/logger'
3
3
  require "instana/util"
4
4
  require "instana/helpers"
5
5
 
@@ -45,5 +45,26 @@ module Instana
45
45
  end
46
46
 
47
47
  # Setup the logger as early as possible
48
- ::Instana.logger = ::Instana::XLogger.new(STDOUT)
48
+
49
+ # Default Logger outputs to STDOUT
50
+ ::Instana.logger = Logger.new(STDOUT)
51
+
52
+ # Can instead log to a file that is rotated every 10M
53
+ # ::Instana.logger = Logger.new("instana.log", 10, 1073741824)
54
+
55
+ if ENV.key?('INSTANA_GEM_TEST')
56
+ ::Instana.logger.level = Logger::DEBUG
57
+ elsif ENV.key?('INSTANA_GEM_DEV') || ENV.key?('INSTANA_DEBUG')
58
+ ::Instana.logger.level = Logger::DEBUG
59
+ elsif ENV.key?('INSTANA_QUIET')
60
+ ::Instana.logger.level = Logger::FATAL
61
+ else
62
+ ::Instana.logger.level = Logger::WARN
63
+ end
64
+
65
+ ::Instana.logger.formatter = proc do |severity, datetime, progname, msg|
66
+ "#{datetime}: #{severity.rjust(5)} Instana: #{progname} #{msg}\n"
67
+ end
68
+
69
+
49
70
  ::Instana.logger.info "Stan is on the scene. Starting Instana instrumentation version #{::Instana::VERSION}"
@@ -11,7 +11,7 @@ module Instana
11
11
  #
12
12
  # @return [Boolean]
13
13
  #
14
- def has_rails_handler?
14
+ def has_rails_handler?(exception)
15
15
  found = false
16
16
  rescue_handlers.detect do |klass_name, _handler|
17
17
  # Rescue handlers can be specified as strings or constant names
@@ -21,7 +21,7 @@ module Instana
21
21
  end
22
22
  found
23
23
  rescue => e
24
- ::Instana.logger.debug "#{__method__}:#{File.basename(__FILE__)}:#{__LINE__}: #{e.message}"
24
+ ::Instana.logger.debug { "#{__method__}:#{File.basename(__FILE__)}:#{__LINE__}: #{e.message}" }
25
25
  return false
26
26
  end
27
27
 
@@ -72,7 +72,7 @@ module Instana
72
72
 
73
73
  super(*args)
74
74
  rescue Exception => e
75
- ::Instana.tracer.log_error(e) unless has_rails_handler?
75
+ ::Instana.tracer.log_error(e) unless has_rails_handler?(e)
76
76
  raise
77
77
  ensure
78
78
  ::Instana.tracer.log_exit(:actioncontroller)
@@ -92,7 +92,7 @@ module Instana
92
92
 
93
93
  super(*args, &blk)
94
94
  rescue Exception => e
95
- ::Instana.tracer.log_error(e) unless has_rails_handler?
95
+ ::Instana.tracer.log_error(e) unless has_rails_handler?(e)
96
96
  raise
97
97
  ensure
98
98
  ::Instana.tracer.log_exit(:actionview)
@@ -124,7 +124,7 @@ module Instana
124
124
 
125
125
  process_action_without_instana(*args)
126
126
  rescue Exception => e
127
- ::Instana.tracer.log_error(e) unless has_rails_handler?
127
+ ::Instana.tracer.log_error(e) unless has_rails_handler?(e)
128
128
  raise
129
129
  ensure
130
130
  ::Instana.tracer.log_exit(:actioncontroller)
@@ -141,7 +141,7 @@ module Instana
141
141
  ::Instana.tracer.log_entry(:actionview, :actionview => { :name => name })
142
142
  render_without_instana(*args, &blk)
143
143
  rescue Exception => e
144
- ::Instana.tracer.log_error(e) unless has_rails_handler?
144
+ ::Instana.tracer.log_error(e) unless has_rails_handler?(e)
145
145
  raise
146
146
  ensure
147
147
  ::Instana.tracer.log_exit(:actionview)
@@ -3,7 +3,7 @@ module Instana
3
3
  end
4
4
 
5
5
 
6
- if !ENV.key?('INSTANA_DISABLE_AUTO_INSTR')
6
+ if !ENV.key?('INSTANA_DISABLE_AUTO_INSTR') || ENV['INSTANA_DISABLE_AUTO_INSTR'] === 'false'
7
7
  #
8
8
  # Load all of the files in the specified subdirectories
9
9
  #
@@ -1,4 +1,4 @@
1
1
  module Instana
2
- VERSION = "1.9.5"
2
+ VERSION = "1.9.6"
3
3
  VERSION_FULL = "instana-#{VERSION}"
4
4
  end
@@ -115,7 +115,7 @@ class RedisTest < Minitest::Test
115
115
 
116
116
  if with_error
117
117
  assert_equal true, data[:redis][:error]
118
- assert_equal with_error, data[:log][:message]
118
+ assert data[:log].key?(:message)
119
119
  end
120
120
  end
121
121
  end
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.9.5
4
+ version: 1.9.6
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: 2019-06-06 00:00:00.000000000 Z
11
+ date: 2019-08-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.11'
19
+ version: '2.0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.11'
26
+ version: '2.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -235,7 +235,6 @@ files:
235
235
  - lib/instana/instrumentation/rest-client.rb
236
236
  - lib/instana/instrumentation/sidekiq-client.rb
237
237
  - lib/instana/instrumentation/sidekiq-worker.rb
238
- - lib/instana/logger.rb
239
238
  - lib/instana/opentracing/carrier.rb
240
239
  - lib/instana/opentracing/tracer.rb
241
240
  - lib/instana/rack.rb
@@ -1,40 +0,0 @@
1
- require "logger"
2
-
3
- module Instana
4
- class XLogger < Logger
5
- STAMP = "Instana: ".freeze
6
-
7
- def initialize(*args)
8
- super(*args)
9
- if ENV.key?('INSTANA_GEM_TEST')
10
- self.level = Logger::DEBUG
11
- elsif ENV.key?('INSTANA_GEM_DEV') || ENV.key?('INSTANA_DEBUG')
12
- self.level = Logger::DEBUG
13
- elsif ENV.key?('INSTANA_QUIET')
14
- self.level = Logger::FATAL
15
- else
16
- self.level = Logger::WARN
17
- end
18
- end
19
-
20
- def error(msg)
21
- super(STAMP + msg)
22
- end
23
-
24
- def warn(msg)
25
- super(STAMP + msg)
26
- end
27
-
28
- def info(msg)
29
- super(STAMP + msg)
30
- end
31
-
32
- def debug(msg)
33
- super(STAMP + msg)
34
- end
35
-
36
- def unkown(msg)
37
- super(STAMP + msg)
38
- end
39
- end
40
- end