instana 1.213.1 → 1.213.3

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: e1509ebcf4f8afa64594e49f0fc133fda38e6a7170ef86de6510fcb44ed0021e
4
- data.tar.gz: b21a8ecac7c698a973171f77d126718e925e0323f500a76a1596248db85615eb
3
+ metadata.gz: 8d41daf6f68e3738199d8b2fca28811cc70f521eb25b25379bd8c185aef0621c
4
+ data.tar.gz: bd2cc50d91fbaa639f170150c049b9ffd801b9e1ef2953d1ebd4d1c7c8f95434
5
5
  SHA512:
6
- metadata.gz: 841b715e429f54599356feaf5e623f4b6084d888968409cbc493ad2d56b2bfba0a43fb9c17a4e1fd303ac863821fc70b42091652d52ded2df94f22e473a03a72
7
- data.tar.gz: a57470a6b55b7cbf553c6eb094fa462a1bc9f26ac2349c5be37bec5a26a8bf61f99f365a1e6735783c3344b9ac586461a2fb5ca9dd2cc5b9db86d9db4cabc157
6
+ metadata.gz: 032ef7a9dc62ead3c64e7ab86420c1f28b093b0ce4f27ccbc4ecd8d6f05f4ccdcd34079c2b5d09f88b4a786977eaa7f3944ea4a97074e96f363f7671baf1b3d1
7
+ data.tar.gz: c9c2c346dc945b697a65add442e3fbb09c0f9983c7a0ee4601903a961142bbcc55539ee5cc2ba6b71e607d5d86eb8c60d49f3d25c35c17ae1cee4cd077c9e3e4
data/.circleci/config.yml CHANGED
@@ -16,24 +16,20 @@ library_gemfile: &library_gemfile
16
16
  - "./gemfiles/graphql_20.gemfile"
17
17
  - "./gemfiles/grpc_10.gemfile"
18
18
  - "./gemfiles/net_http_01.gemfile"
19
- - "./gemfiles/rack_16.gemfile"
20
19
  - "./gemfiles/rack_20.gemfile"
21
20
  - "./gemfiles/rack_30.gemfile"
22
21
  - "./gemfiles/redis_40.gemfile"
23
- - "./gemfiles/rest_client_16.gemfile"
24
22
  - "./gemfiles/rest_client_20.gemfile"
25
23
  - "./gemfiles/resque_122.gemfile"
26
24
  - "./gemfiles/resque_20.gemfile"
27
25
  - "./gemfiles/roda_20.gemfile"
28
26
  - "./gemfiles/roda_30.gemfile"
29
- - "./gemfiles/sidekiq_42.gemfile"
30
- - "./gemfiles/sidekiq_50.gemfile"
31
27
  - "./gemfiles/sidekiq_60.gemfile"
32
28
  - "./gemfiles/sidekiq_65.gemfile"
33
29
  - "./gemfiles/sidekiq_70.gemfile"
34
- - "./gemfiles/sinatra_14.gemfile"
35
30
  - "./gemfiles/sinatra_22.gemfile"
36
31
  - "./gemfiles/sinatra_30.gemfile"
32
+ - "./gemfiles/sinatra_40.gemfile"
37
33
  - "./gemfiles/shoryuken_50.gemfile"
38
34
  - "./gemfiles/shoryuken_60.gemfile"
39
35
  - "./gemfiles/mongo_216.gemfile"
@@ -58,24 +54,23 @@ executors:
58
54
  docker:
59
55
  - image: cimg/ruby:2.7-node
60
56
  environment:
61
- DATABASE_URL: "mysql2://root@127.0.0.1:3306/ci_test"
57
+ DATABASE_URL: "mysql2://root:passw0rd@127.0.0.1:3306/ci_test"
62
58
  - image: mariadb
63
59
  environment:
64
60
  MYSQL_DATABASE: 'ci_test'
65
61
  MYSQL_USER: 'root'
66
- MYSQL_PASSWORD: ''
67
- MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
68
- MYSQL_ROOT_PASSWORD: ''
62
+ MYSQL_ROOT_PASSWORD: 'passw0rd'
69
63
  MYSQL_ROOT_HOST: '%'
70
64
  ruby_27_postgres:
71
65
  docker:
72
66
  - image: cimg/ruby:2.7-node
73
67
  environment:
74
- DATABASE_URL: "postgres://postgres:test@127.0.0.1:5432/ci_test"
68
+ DATABASE_URL: "postgres://root:passw0rd@127.0.0.1:5432/ci_test"
75
69
  - image: postgres
76
70
  environment:
77
- POSTGRES_PASSWORD: 'test'
78
71
  POSTGRES_DB: 'ci_test'
72
+ POSTGRES_USER: 'root'
73
+ POSTGRES_PASSWORD: 'passw0rd'
79
74
  ruby_30:
80
75
  docker:
81
76
  - image: cimg/ruby:3.0-node
@@ -187,7 +182,43 @@ executors:
187
182
  environment:
188
183
  POSTGRES_PASSWORD: 'test'
189
184
  POSTGRES_DB: 'ci_test'
190
-
185
+ ruby_33:
186
+ docker:
187
+ - image: cimg/ruby:3.3-node
188
+ environment:
189
+ MEMCACHED_HOST: '127.0.0.1:11211'
190
+ REDIS_URL: 'redis://127.0.0.1:6379'
191
+ DATABASE_URL: 'sqlite3::memory:'
192
+ - image: memcached
193
+ - image: redis
194
+ - image: amazon/dynamodb-local
195
+ - image: minio/minio:latest
196
+ command: ["server", "/data"]
197
+ - image: s12v/sns
198
+ - image: softwaremill/elasticmq-native
199
+ - image: mongo:5-focal
200
+ ruby_33_mysql2:
201
+ docker:
202
+ - image: cimg/ruby:3.3-node
203
+ environment:
204
+ DATABASE_URL: "mysql2://root@127.0.0.1:3306/ci_test"
205
+ - image: mariadb
206
+ environment:
207
+ MYSQL_DATABASE: 'ci_test'
208
+ MYSQL_USER: 'root'
209
+ MYSQL_PASSWORD: ''
210
+ MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
211
+ MYSQL_ROOT_PASSWORD: ''
212
+ MYSQL_ROOT_HOST: '%'
213
+ ruby_33_postgres:
214
+ docker:
215
+ - image: cimg/ruby:3.3-node
216
+ environment:
217
+ DATABASE_URL: "postgres://postgres:test@127.0.0.1:5432/ci_test"
218
+ - image: postgres
219
+ environment:
220
+ POSTGRES_PASSWORD: 'test'
221
+ POSTGRES_DB: 'ci_test'
191
222
  commands:
192
223
  setup:
193
224
  steps:
@@ -356,6 +387,7 @@ workflows:
356
387
  - ruby_30
357
388
  - ruby_31
358
389
  - ruby_32
390
+ - ruby_33
359
391
  libraries_ruby_3:
360
392
  jobs:
361
393
  - test_apprisal:
@@ -365,26 +397,8 @@ workflows:
365
397
  - ruby_30
366
398
  - ruby_31
367
399
  - ruby_32
400
+ - ruby_33
368
401
  <<: *library_gemfile
369
- exclude:
370
- # Currently rest-client 1.6 gemfile pulls in mime-types 2.99.3
371
- # and adaptation to mime-type 3.0 is only available in rest-client 2.0:
372
- # https://github.com/rest-client/rest-client/issues/464
373
- # But mime-types 2.99.3 is too old for Ruby 3.0 or newer:
374
- # https://stackoverflow.com/a/68433864
375
- # so we should exclude thiese scenarios
376
- - stack: ruby_30
377
- gemfile: "./gemfiles/rest_client_16.gemfile"
378
- - stack: ruby_31
379
- gemfile: "./gemfiles/rest_client_16.gemfile"
380
- - stack: ruby_32
381
- gemfile: "./gemfiles/rest_client_16.gemfile"
382
- # Sinatra 1.4 relies on the Fixnum class
383
- # which has been removed from Ruby 3.2, see:
384
- # https://bugs.ruby-lang.org/issues/12005
385
- # https://www.ruby-lang.org/en/news/2022/11/11/ruby-3-2-0-preview3-released/
386
- - stack: ruby_32
387
- gemfile: "./gemfiles/sinatra_14.gemfile"
388
402
  libraries_ruby_2:
389
403
  jobs:
390
404
  - test_apprisal:
@@ -421,6 +435,8 @@ workflows:
421
435
  - ruby_32
422
436
  - ruby_32_postgres
423
437
  - ruby_32_mysql2
438
+ - ruby_33_postgres
439
+ - ruby_33_mysql2
424
440
  gemfile:
425
441
  - "./gemfiles/rails_61.gemfile"
426
442
  - "./gemfiles/rails_70.gemfile"
@@ -8,6 +8,6 @@ gem "puma"
8
8
  gem "rubocop", "~> 1.9"
9
9
  gem "rack-test"
10
10
  gem "simplecov", "~> 0.21.2"
11
- gem "sinatra", ">= 3.0.6"
11
+ gem "sinatra", ">= 3.0.6", "< 4.0"
12
12
 
13
13
  gemspec path: "../"
@@ -1,7 +1,4 @@
1
- # This file was generated by Appraisal
2
-
3
- # (c) Copyright IBM Corp. 2021
4
- # (c) Copyright Instana Inc. 2021
1
+ # (c) Copyright IBM Corp. 2023
5
2
 
6
3
  source "https://rubygems.org"
7
4
 
@@ -11,6 +8,6 @@ gem "puma"
11
8
  gem "rubocop", "~> 1.9"
12
9
  gem "rack-test"
13
10
  gem "simplecov", "~> 0.21.2"
14
- gem "rack", "~> 1.6"
11
+ gem "sinatra", ">= 4.0.0"
15
12
 
16
13
  gemspec path: "../"
@@ -12,6 +12,9 @@ module Instana
12
12
  require 'instana/frameworks/sinatra'
13
13
 
14
14
  ::Sinatra::Base.use ::Instana::Rack
15
+ unless ::Sinatra::Base.respond_to?(:mustermann_opts)
16
+ ::Sinatra::Base.set :mustermann_opts, {}
17
+ end
15
18
  ::Sinatra::Base.register ::Instana::SinatraPathTemplateExtractor
16
19
 
17
20
  true
data/lib/instana/util.rb CHANGED
@@ -86,8 +86,17 @@ module Instana
86
86
  end
87
87
  end
88
88
 
89
- if defined?(::RailsLts) || defined?(::Rails)
90
- return Rails.application.class.to_s.split('::')[0]
89
+ rails_module = if defined?(::RailsLts)
90
+ then ::RailsLts
91
+ elsif defined?(::Rails)
92
+ then ::Rails
93
+ end
94
+
95
+ if rails_module &&
96
+ rails_module.respond_to?(:application_name) &&
97
+ rails_module.instance_variables.include?(:@application) &&
98
+ rails_module.application
99
+ return rails_module.application_name
91
100
  end
92
101
 
93
102
  if $0.to_s.empty?
@@ -2,6 +2,6 @@
2
2
  # (c) Copyright Instana Inc. 2016
3
3
 
4
4
  module Instana
5
- VERSION = "1.213.1"
5
+ VERSION = "1.213.3"
6
6
  VERSION_FULL = "instana-#{VERSION}"
7
7
  end
@@ -6,7 +6,11 @@ require 'rack/test'
6
6
 
7
7
  class SinatraTest < Minitest::Test
8
8
  include Rack::Test::Methods
9
- APP = Rack::Builder.parse_file('test/support/apps/sinatra/config.ru').first
9
+ APP = Rack::Builder.parse_file('test/support/apps/sinatra/config.ru')
10
+ sinatra_version = Gem::Specification.find_by_name('sinatra').version
11
+ if sinatra_version < Gem::Version.new('4.0.0')
12
+ APP = APP.first
13
+ end
10
14
 
11
15
  def app
12
16
  APP
@@ -28,11 +28,12 @@ class RailsActionCableTest < Minitest::Test
28
28
  data = span[:data]
29
29
 
30
30
  assert_nil rest
31
- assert :"rpc-server", span[:n]
32
- assert :actioncable, data[:rpc][:flavor]
33
- assert channel_klass.to_s, data[:rpc][:call]
34
- assert :transmit, data[:rpc][:call_type]
35
- assert Socket.gethostname, data[:rpc][:host]
31
+ assert_equal :"rpc-server", span[:n]
32
+ assert_equal "rake_test_loader.rb", data[:service]
33
+ assert_equal :actioncable, data[:rpc][:flavor]
34
+ assert_equal channel_klass.to_s, data[:rpc][:call]
35
+ assert_equal :transmit, data[:rpc][:call_type]
36
+ assert_equal Socket.gethostname, data[:rpc][:host]
36
37
  end
37
38
 
38
39
  def test_transmit_parent
@@ -53,12 +54,13 @@ class RailsActionCableTest < Minitest::Test
53
54
  data = span[:data]
54
55
 
55
56
  assert_nil rest
56
- assert 'ABC', span[:t]
57
- assert :"rpc-server", span[:n]
58
- assert :actioncable, data[:rpc][:flavor]
59
- assert channel_klass.to_s, data[:rpc][:call]
60
- assert :transmit, data[:rpc][:call_type]
61
- assert Socket.gethostname, data[:rpc][:host]
57
+ assert_equal 'ABC', span[:t]
58
+ assert_equal :"rpc-server", span[:n]
59
+ assert_equal "rake_test_loader.rb", data[:service]
60
+ assert_equal :actioncable, data[:rpc][:flavor]
61
+ assert_equal channel_klass.to_s, data[:rpc][:call]
62
+ assert_equal :transmit, data[:rpc][:call_type]
63
+ assert_equal Socket.gethostname, data[:rpc][:host]
62
64
  end
63
65
 
64
66
  def test_action_no_parent
@@ -79,11 +81,12 @@ class RailsActionCableTest < Minitest::Test
79
81
  data = span[:data]
80
82
 
81
83
  assert_nil rest
82
- assert :"rpc-server", span[:n]
83
- assert :actioncable, data[:rpc][:flavor]
84
- assert "#{channel_klass}#sample", data[:rpc][:call]
85
- assert :action, data[:rpc][:call_type]
86
- assert Socket.gethostname, data[:rpc][:host]
84
+ assert_equal :"rpc-server", span[:n]
85
+ assert_equal "rake_test_loader.rb", data[:service]
86
+ assert_equal :actioncable, data[:rpc][:flavor]
87
+ assert_equal "#{channel_klass}#sample", data[:rpc][:call]
88
+ assert_equal :action, data[:rpc][:call_type]
89
+ assert_equal Socket.gethostname, data[:rpc][:host]
87
90
  end
88
91
 
89
92
  def test_action_parent
@@ -108,12 +111,13 @@ class RailsActionCableTest < Minitest::Test
108
111
  data = span[:data]
109
112
 
110
113
  assert_nil rest
111
- assert 'ABC', span[:t]
112
- assert :"rpc-server", span[:n]
113
- assert :actioncable, data[:rpc][:flavor]
114
- assert "#{channel_klass}#sample", data[:rpc][:call]
115
- assert :action, data[:rpc][:call_type]
116
- assert Socket.gethostname, data[:rpc][:host]
114
+ assert_equal 'ABC', span[:t]
115
+ assert_equal :"rpc-server", span[:n]
116
+ assert_equal "rake_test_loader.rb", data[:service]
117
+ assert_equal :actioncable, data[:rpc][:flavor]
118
+ assert_equal "#{channel_klass}#sample", data[:rpc][:call]
119
+ assert_equal :action, data[:rpc][:call_type]
120
+ assert_equal Socket.gethostname, data[:rpc][:host]
117
121
  end
118
122
 
119
123
  private
@@ -10,5 +10,23 @@ class RubyProcessTest < Minitest::Test
10
10
 
11
11
  assert_equal Instana::Snapshot::RubyProcess::ID, snapshot[:name]
12
12
  assert_equal Process.pid.to_s, snapshot[:entityId]
13
+ assert_equal File.basename($PROGRAM_NAME), snapshot[:data][:name]
14
+ end
15
+
16
+ def test_snapshot_with_rails_defined_but_no_rails_application
17
+ Object.send(:const_set, :Rails,
18
+ Module.new do
19
+ def respond_to?
20
+ false
21
+ end
22
+ end)
23
+ subject = Instana::Snapshot::RubyProcess.new
24
+ snapshot = subject.snapshot
25
+
26
+ assert_equal Instana::Snapshot::RubyProcess::ID, snapshot[:name]
27
+ assert_equal Process.pid.to_s, snapshot[:entityId]
28
+ assert_equal File.basename($PROGRAM_NAME), snapshot[:data][:name]
29
+ ensure
30
+ Object.send(:remove_const, :Rails)
13
31
  end
14
32
  end
@@ -81,17 +81,5 @@ module Instana
81
81
  end
82
82
  raise StandardError, 'Span with qualifier not found'
83
83
  end
84
-
85
- def has_postgres_database?
86
- URI(ENV.fetch('DATABASE_URL', '')).scheme == 'postgres'
87
- end
88
-
89
- def has_mysql2_database?
90
- URI(ENV.fetch('DATABASE_URL', '')).scheme == 'mysql2'
91
- end
92
-
93
- def has_mysql_database?
94
- URI(ENV.fetch('DATABASE_URL', '')).scheme == 'mysql'
95
- end
96
84
  end
97
85
  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.213.1
4
+ version: 1.213.3
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: 2024-01-18 00:00:00.000000000 Z
11
+ date: 2024-03-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -175,7 +175,6 @@ files:
175
175
  - gemfiles/mongo_216.gemfile
176
176
  - gemfiles/mongo_219.gemfile
177
177
  - gemfiles/net_http_01.gemfile
178
- - gemfiles/rack_16.gemfile
179
178
  - gemfiles/rack_20.gemfile
180
179
  - gemfiles/rack_30.gemfile
181
180
  - gemfiles/rails_42.gemfile
@@ -188,20 +187,17 @@ files:
188
187
  - gemfiles/redis_40.gemfile
189
188
  - gemfiles/resque_122.gemfile
190
189
  - gemfiles/resque_20.gemfile
191
- - gemfiles/rest_client_16.gemfile
192
190
  - gemfiles/rest_client_20.gemfile
193
191
  - gemfiles/roda_20.gemfile
194
192
  - gemfiles/roda_30.gemfile
195
193
  - gemfiles/shoryuken_50.gemfile
196
194
  - gemfiles/shoryuken_60.gemfile
197
- - gemfiles/sidekiq_42.gemfile
198
- - gemfiles/sidekiq_50.gemfile
199
195
  - gemfiles/sidekiq_60.gemfile
200
196
  - gemfiles/sidekiq_65.gemfile
201
197
  - gemfiles/sidekiq_70.gemfile
202
- - gemfiles/sinatra_14.gemfile
203
198
  - gemfiles/sinatra_22.gemfile
204
199
  - gemfiles/sinatra_30.gemfile
200
+ - gemfiles/sinatra_40.gemfile
205
201
  - instana.gemspec
206
202
  - lib/instana.rb
207
203
  - lib/instana/activator.rb
@@ -1,18 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- # (c) Copyright IBM Corp. 2021
4
- # (c) Copyright Instana Inc. 2021
5
-
6
- source "https://rubygems.org"
7
-
8
- gem "rack"
9
- gem "rackup"
10
- gem "minitest-reporters"
11
- gem "webmock"
12
- gem "puma"
13
- gem "rubocop", "~> 1.9"
14
- gem "rack-test"
15
- gem "simplecov", "~> 0.21.2"
16
- gem "rest-client", ">= 1.6", "< 2.0"
17
-
18
- gemspec path: "../"
@@ -1,16 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- # (c) Copyright IBM Corp. 2021
4
- # (c) Copyright Instana Inc. 2021
5
-
6
- source "https://rubygems.org"
7
-
8
- gem "minitest-reporters"
9
- gem "webmock"
10
- gem "puma"
11
- gem "rubocop", "~> 1.9"
12
- gem "rack-test"
13
- gem "simplecov", "~> 0.21.2"
14
- gem "sidekiq", "~> 4.2.10"
15
-
16
- gemspec path: "../"
@@ -1,16 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- # (c) Copyright IBM Corp. 2021
4
- # (c) Copyright Instana Inc. 2021
5
-
6
- source "https://rubygems.org"
7
-
8
- gem "minitest-reporters"
9
- gem "webmock"
10
- gem "puma"
11
- gem "rubocop", "~> 1.9"
12
- gem "rack-test"
13
- gem "simplecov", "~> 0.21.2"
14
- gem "sidekiq", "< 6.0"
15
-
16
- gemspec path: "../"
@@ -1,16 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- # (c) Copyright IBM Corp. 2021
4
- # (c) Copyright Instana Inc. 2021
5
-
6
- source "https://rubygems.org"
7
-
8
- gem "minitest-reporters"
9
- gem "webmock"
10
- gem "puma"
11
- gem "rubocop", "~> 1.9"
12
- gem "rack-test"
13
- gem "simplecov", "~> 0.21.2"
14
- gem "sinatra", ">= 1.4.8", "< 2.0"
15
-
16
- gemspec path: "../"