instana 1.213.2 → 1.214.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a6c1eb25bd9b00e353e9c403d217357931bcc714b5aab7080b598c81c0aa51cf
4
- data.tar.gz: 8bb75b9d28e1562cb2b010589fa0667d451bd9a4389e332832fb2e6225cd7882
3
+ metadata.gz: f17a988f6d3117cee6198d76f4d1d927c78170857122933700352905ddf06382
4
+ data.tar.gz: 852125ef23731dca4817a18999b9cb1af142d8c62ff8bc5c81c717e370b0a943
5
5
  SHA512:
6
- metadata.gz: 5976d705537afdb13d900a45831bc9a0947c8bfa9a126f67badad41917d828dc63e4f5546bb3041626822d4636d978047613c1f77d6a82b5922a6c8436ff087a
7
- data.tar.gz: c00f53d5ebc10e92fdc3c096092ececc87727b281d5476ac345d7fcf6f273b902b93eca60a423139a6310ad8b9e6188319488608c9006c48dfc89c8913d3dca9
6
+ metadata.gz: ce8ce7e27297c544e50e7efa4a0ab79cdafacaa4faf7d0a860c7976a7d4bcf671996079f5f019af33215feabe024f1f495edf584f20cf940923883a65e9550dd
7
+ data.tar.gz: 3cc3695f26bdb194206e688996027366fed40adfd907c80f2d924209ac0d63a7f53155f277f7edd2180f4ab085d86c8a75c096f9891f83e7b1cc5ade1230de50
data/.circleci/config.yml CHANGED
@@ -9,29 +9,24 @@ library_gemfile: &library_gemfile
9
9
  - "./gemfiles/dalli_20.gemfile"
10
10
  - "./gemfiles/dalli_30.gemfile"
11
11
  - "./gemfiles/dalli_32.gemfile"
12
- - "./gemfiles/excon_02.gemfile"
13
12
  - "./gemfiles/excon_079.gemfile"
14
13
  - "./gemfiles/excon_100.gemfile"
15
14
  - "./gemfiles/graphql_10.gemfile"
16
15
  - "./gemfiles/graphql_20.gemfile"
17
16
  - "./gemfiles/grpc_10.gemfile"
18
17
  - "./gemfiles/net_http_01.gemfile"
19
- - "./gemfiles/rack_16.gemfile"
20
18
  - "./gemfiles/rack_20.gemfile"
21
19
  - "./gemfiles/rack_30.gemfile"
22
20
  - "./gemfiles/redis_40.gemfile"
23
- - "./gemfiles/rest_client_16.gemfile"
21
+ - "./gemfiles/redis_50.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"
37
32
  - "./gemfiles/sinatra_40.gemfile"
@@ -40,9 +35,9 @@ library_gemfile: &library_gemfile
40
35
  - "./gemfiles/mongo_216.gemfile"
41
36
  - "./gemfiles/mongo_219.gemfile"
42
37
  executors:
43
- ruby_27:
38
+ ruby_30:
44
39
  docker:
45
- - image: cimg/ruby:2.7-node
40
+ - image: cimg/ruby:3.0-node
46
41
  environment:
47
42
  MEMCACHED_HOST: '127.0.0.1:11211'
48
43
  REDIS_URL: 'redis://127.0.0.1:6379'
@@ -55,9 +50,9 @@ executors:
55
50
  - image: s12v/sns
56
51
  - image: softwaremill/elasticmq-native
57
52
  - image: mongo:5-focal
58
- ruby_27_mysql2:
53
+ ruby_30_mysql2:
59
54
  docker:
60
- - image: cimg/ruby:2.7-node
55
+ - image: cimg/ruby:3.0-node
61
56
  environment:
62
57
  DATABASE_URL: "mysql2://root@127.0.0.1:3306/ci_test"
63
58
  - image: mariadb
@@ -68,18 +63,18 @@ executors:
68
63
  MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
69
64
  MYSQL_ROOT_PASSWORD: ''
70
65
  MYSQL_ROOT_HOST: '%'
71
- ruby_27_postgres:
66
+ ruby_30_postgres:
72
67
  docker:
73
- - image: cimg/ruby:2.7-node
68
+ - image: cimg/ruby:3.0-node
74
69
  environment:
75
70
  DATABASE_URL: "postgres://postgres:test@127.0.0.1:5432/ci_test"
76
71
  - image: postgres
77
72
  environment:
78
73
  POSTGRES_PASSWORD: 'test'
79
74
  POSTGRES_DB: 'ci_test'
80
- ruby_30:
75
+ ruby_31:
81
76
  docker:
82
- - image: cimg/ruby:3.0-node
77
+ - image: cimg/ruby:3.1-node
83
78
  environment:
84
79
  MEMCACHED_HOST: '127.0.0.1:11211'
85
80
  REDIS_URL: 'redis://127.0.0.1:6379'
@@ -92,9 +87,9 @@ executors:
92
87
  - image: s12v/sns
93
88
  - image: softwaremill/elasticmq-native
94
89
  - image: mongo:5-focal
95
- ruby_30_mysql2:
90
+ ruby_31_mysql2:
96
91
  docker:
97
- - image: cimg/ruby:3.0-node
92
+ - image: cimg/ruby:3.1-node
98
93
  environment:
99
94
  DATABASE_URL: "mysql2://root@127.0.0.1:3306/ci_test"
100
95
  - image: mariadb
@@ -105,18 +100,18 @@ executors:
105
100
  MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
106
101
  MYSQL_ROOT_PASSWORD: ''
107
102
  MYSQL_ROOT_HOST: '%'
108
- ruby_30_postgres:
103
+ ruby_31_postgres:
109
104
  docker:
110
- - image: cimg/ruby:3.0-node
105
+ - image: cimg/ruby:3.1-node
111
106
  environment:
112
107
  DATABASE_URL: "postgres://postgres:test@127.0.0.1:5432/ci_test"
113
108
  - image: postgres
114
109
  environment:
115
110
  POSTGRES_PASSWORD: 'test'
116
111
  POSTGRES_DB: 'ci_test'
117
- ruby_31:
112
+ ruby_32:
118
113
  docker:
119
- - image: cimg/ruby:3.1-node
114
+ - image: cimg/ruby:3.2-node
120
115
  environment:
121
116
  MEMCACHED_HOST: '127.0.0.1:11211'
122
117
  REDIS_URL: 'redis://127.0.0.1:6379'
@@ -129,9 +124,9 @@ executors:
129
124
  - image: s12v/sns
130
125
  - image: softwaremill/elasticmq-native
131
126
  - image: mongo:5-focal
132
- ruby_31_mysql2:
127
+ ruby_32_mysql2:
133
128
  docker:
134
- - image: cimg/ruby:3.1-node
129
+ - image: cimg/ruby:3.2-node
135
130
  environment:
136
131
  DATABASE_URL: "mysql2://root@127.0.0.1:3306/ci_test"
137
132
  - image: mariadb
@@ -142,18 +137,18 @@ executors:
142
137
  MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
143
138
  MYSQL_ROOT_PASSWORD: ''
144
139
  MYSQL_ROOT_HOST: '%'
145
- ruby_31_postgres:
140
+ ruby_32_postgres:
146
141
  docker:
147
- - image: cimg/ruby:3.1-node
142
+ - image: cimg/ruby:3.2-node
148
143
  environment:
149
144
  DATABASE_URL: "postgres://postgres:test@127.0.0.1:5432/ci_test"
150
145
  - image: postgres
151
146
  environment:
152
147
  POSTGRES_PASSWORD: 'test'
153
148
  POSTGRES_DB: 'ci_test'
154
- ruby_32:
149
+ ruby_33:
155
150
  docker:
156
- - image: cimg/ruby:3.2-node
151
+ - image: cimg/ruby:3.3-node
157
152
  environment:
158
153
  MEMCACHED_HOST: '127.0.0.1:11211'
159
154
  REDIS_URL: 'redis://127.0.0.1:6379'
@@ -166,9 +161,9 @@ executors:
166
161
  - image: s12v/sns
167
162
  - image: softwaremill/elasticmq-native
168
163
  - image: mongo:5-focal
169
- ruby_32_mysql2:
164
+ ruby_33_mysql2:
170
165
  docker:
171
- - image: cimg/ruby:3.2-node
166
+ - image: cimg/ruby:3.3-node
172
167
  environment:
173
168
  DATABASE_URL: "mysql2://root@127.0.0.1:3306/ci_test"
174
169
  - image: mariadb
@@ -179,16 +174,15 @@ executors:
179
174
  MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
180
175
  MYSQL_ROOT_PASSWORD: ''
181
176
  MYSQL_ROOT_HOST: '%'
182
- ruby_32_postgres:
177
+ ruby_33_postgres:
183
178
  docker:
184
- - image: cimg/ruby:3.2-node
179
+ - image: cimg/ruby:3.3-node
185
180
  environment:
186
181
  DATABASE_URL: "postgres://postgres:test@127.0.0.1:5432/ci_test"
187
182
  - image: postgres
188
183
  environment:
189
184
  POSTGRES_PASSWORD: 'test'
190
185
  POSTGRES_DB: 'ci_test'
191
-
192
186
  commands:
193
187
  setup:
194
188
  steps:
@@ -297,7 +291,7 @@ jobs:
297
291
  parameters:
298
292
  stack:
299
293
  type: executor
300
- default: ruby_27
294
+ default: ruby_30
301
295
  executor: << parameters.stack >>
302
296
  steps:
303
297
  - checkout
@@ -307,7 +301,7 @@ jobs:
307
301
  parameters:
308
302
  stack:
309
303
  type: executor
310
- default: ruby_27
304
+ default: ruby_30
311
305
  gemfile:
312
306
  type: string
313
307
  default: "./gemfiles/aws_30.gemfile"
@@ -320,7 +314,7 @@ jobs:
320
314
  - setup
321
315
  - run_tests
322
316
  lint:
323
- executor: ruby_27
317
+ executor: ruby_30
324
318
  steps:
325
319
  - checkout
326
320
  - setup
@@ -331,7 +325,7 @@ jobs:
331
325
  - checkout
332
326
  - run_sonarqube
333
327
  publish:
334
- executor: ruby_27
328
+ executor: ruby_30
335
329
  steps:
336
330
  - checkout
337
331
  - setup
@@ -353,10 +347,10 @@ workflows:
353
347
  matrix:
354
348
  parameters:
355
349
  stack:
356
- - ruby_27
357
350
  - ruby_30
358
351
  - ruby_31
359
352
  - ruby_32
353
+ - ruby_33
360
354
  libraries_ruby_3:
361
355
  jobs:
362
356
  - test_apprisal:
@@ -366,47 +360,8 @@ workflows:
366
360
  - ruby_30
367
361
  - ruby_31
368
362
  - ruby_32
363
+ - ruby_33
369
364
  <<: *library_gemfile
370
- exclude:
371
- # Currently rest-client 1.6 gemfile pulls in mime-types 2.99.3
372
- # and adaptation to mime-type 3.0 is only available in rest-client 2.0:
373
- # https://github.com/rest-client/rest-client/issues/464
374
- # But mime-types 2.99.3 is too old for Ruby 3.0 or newer:
375
- # https://stackoverflow.com/a/68433864
376
- # so we should exclude thiese scenarios
377
- - stack: ruby_30
378
- gemfile: "./gemfiles/rest_client_16.gemfile"
379
- - stack: ruby_31
380
- gemfile: "./gemfiles/rest_client_16.gemfile"
381
- - stack: ruby_32
382
- gemfile: "./gemfiles/rest_client_16.gemfile"
383
- # Sinatra 1.4 relies on the Fixnum class
384
- # which has been removed from Ruby 3.2, see:
385
- # https://bugs.ruby-lang.org/issues/12005
386
- # https://www.ruby-lang.org/en/news/2022/11/11/ruby-3-2-0-preview3-released/
387
- - stack: ruby_32
388
- gemfile: "./gemfiles/sinatra_14.gemfile"
389
- libraries_ruby_2:
390
- jobs:
391
- - test_apprisal:
392
- matrix:
393
- parameters:
394
- stack:
395
- - ruby_27
396
- <<: *library_gemfile
397
- rails_ruby_2:
398
- jobs:
399
- - test_apprisal:
400
- matrix:
401
- parameters:
402
- stack:
403
- - ruby_27
404
- - ruby_27_postgres
405
- - ruby_27_mysql2
406
- gemfile:
407
- - "./gemfiles/rails_60.gemfile"
408
- - "./gemfiles/rails_52.gemfile"
409
- - "./gemfiles/rails_50.gemfile"
410
365
  rails_ruby_3:
411
366
  jobs:
412
367
  - test_apprisal:
@@ -422,6 +377,8 @@ workflows:
422
377
  - ruby_32
423
378
  - ruby_32_postgres
424
379
  - ruby_32_mysql2
380
+ - ruby_33_postgres
381
+ - ruby_33_mysql2
425
382
  gemfile:
426
383
  - "./gemfiles/rails_61.gemfile"
427
384
  - "./gemfiles/rails_70.gemfile"
@@ -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. 2024
5
2
 
6
3
  source "https://rubygems.org"
7
4
 
@@ -11,6 +8,7 @@ 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 "redis", ">= 5.0.0"
12
+ gem "debug"
15
13
 
16
14
  gemspec path: "../"
data/instana.gemspec CHANGED
@@ -31,7 +31,7 @@ Gem::Specification.new do |spec|
31
31
  spec.require_paths = ["lib"]
32
32
  spec.test_files = Dir.glob("{test}/**/*.rb")
33
33
 
34
- spec.required_ruby_version = '>= 2.7'
34
+ spec.required_ruby_version = '>= 3.0'
35
35
  spec.platform = defined?(JRUBY_VERSION) ? 'java' : Gem::Platform::RUBY
36
36
 
37
37
  spec.add_development_dependency "bundler", "~> 2.0"
@@ -5,13 +5,18 @@ module Instana
5
5
  module Activators
6
6
  class Redis < Activator
7
7
  def can_instrument?
8
- defined?(::Redis) && defined?(::Redis::Client) && ::Instana.config[:redis][:enabled]
8
+ defined?(::Redis) && defined?(::Redis::Client) && ::Instana.config[:redis][:enabled] &&
9
+ (Gem::Specification.find_by_name('redis').version < Gem::Version.new('5.0') || defined?(::RedisClient))
9
10
  end
10
11
 
11
12
  def instrument
12
13
  require 'instana/instrumentation/redis'
13
14
 
14
- ::Redis::Client.prepend(::Instana::RedisInstrumentation)
15
+ if Gem::Specification.find_by_name('redis').version >= Gem::Version.new('5.0')
16
+ ::RedisClient.prepend(::Instana::RedisInstrumentation)
17
+ else
18
+ ::Redis::Client.prepend(::Instana::RedisInstrumentation)
19
+ end
15
20
 
16
21
  true
17
22
  end
@@ -1,58 +1,85 @@
1
- # (c) Copyright IBM Corp. 2021
1
+ # (c) Copyright IBM Corp. 2024
2
2
  # (c) Copyright Instana Inc. 2017
3
3
 
4
4
  module Instana
5
5
  module RedisInstrumentation
6
- def call(*args, &block)
7
- kv_payload = { redis: {} }
8
- dnt_spans = [:redis, :'resque-client', :'sidekiq-client']
6
+ if Gem::Specification.find_by_name('redis').version >= Gem::Version.new('5.0') && defined?(::RedisClient)
7
+ ORIGINAL_METHODS = {
8
+ :call_v => ::RedisClient.instance_method(:call_v),
9
+ :pipelined => ::RedisClient.instance_method(:pipelined),
10
+ :multi => ::RedisClient.instance_method(:multi)
11
+ }.freeze
9
12
 
10
- if !Instana.tracer.tracing? || dnt_spans.include?(::Instana.tracer.current_span.name) || !Instana.config[:redis][:enabled]
11
- return super(*args, &block)
13
+ def call_v(*args, &block)
14
+ if skip_instrumentation?
15
+ super(*args, &block)
16
+ else
17
+ call_with_instana(args[0][0].to_s.upcase, ORIGINAL_METHODS[:call_v], *args, &block)
18
+ end
12
19
  end
13
20
 
14
- begin
15
- ::Instana.tracer.log_entry(:redis)
21
+ def pipelined(*args, &block)
22
+ if skip_instrumentation?
23
+ super(*args, &block)
24
+ else
25
+ call_with_instana('PIPELINE', ORIGINAL_METHODS[:pipelined], *args, &block)
26
+ end
27
+ end
16
28
 
17
- begin
18
- kv_payload[:redis][:connection] = "#{self.host}:#{self.port}"
19
- kv_payload[:redis][:db] = db.to_s
20
- kv_payload[:redis][:command] = args[0][0].to_s.upcase
21
- rescue
22
- nil
29
+ # Since, starting with 5.1 redis/client.rb:114:multi takes an unused default argument `watch: nil`
30
+ # but calls redis_client.rb:442:multi, which doesn't take any argument,
31
+ # here we have to take arguments but we should not use it.
32
+ def multi(*_, &block)
33
+ if skip_instrumentation?
34
+ super(&block)
35
+ else
36
+ call_with_instana('MULTI', ORIGINAL_METHODS[:multi], &block)
23
37
  end
38
+ end
24
39
 
25
- super(*args, &block)
26
- rescue => e
27
- ::Instana.tracer.log_info({ redis: {error: true} })
28
- ::Instana.tracer.log_error(e)
29
- raise
30
- ensure
31
- ::Instana.tracer.log_exit(:redis, kv_payload)
40
+ else
41
+ ORIGINAL_METHODS = {
42
+ :call => ::Redis::Client.instance_method(:call),
43
+ :call_pipeline => ::Redis::Client.instance_method(:call_pipeline)
44
+ }.freeze
45
+
46
+ def call(*args, &block)
47
+ if skip_instrumentation?
48
+ super(*args, &block)
49
+ else
50
+ call_with_instana(args[0][0].to_s.upcase, ORIGINAL_METHODS[:call], *args, &block)
51
+ end
52
+ end
53
+
54
+ def call_pipeline(*args, &block)
55
+ if skip_instrumentation?
56
+ super(*args, &block)
57
+ else
58
+ call_with_instana(args.first.is_a?(::Redis::Pipeline::Multi) ? 'MULTI' : 'PIPELINE', ORIGINAL_METHODS[:call_pipeline], *args, &block)
59
+ end
32
60
  end
33
61
  end
34
62
 
35
- def call_pipeline(*args, &block)
36
- kv_payload = { redis: {} }
63
+ def skip_instrumentation?
37
64
  dnt_spans = [:redis, :'resque-client', :'sidekiq-client']
65
+ !Instana.tracer.tracing? || dnt_spans.include?(::Instana.tracer.current_span.name) || !Instana.config[:redis][:enabled]
66
+ end
38
67
 
39
- if !Instana.tracer.tracing? || dnt_spans.include?(::Instana.tracer.current_span.name) || !Instana.config[:redis][:enabled]
40
- return super(*args, &block)
41
- end
68
+ def call_with_instana(*args, &block)
69
+ command, original_super, *original_args = *args
70
+ kv_payload = { redis: {} }
42
71
 
43
72
  begin
44
73
  ::Instana.tracer.log_entry(:redis)
45
74
 
46
- pipeline = args.first
47
75
  begin
48
76
  kv_payload[:redis][:connection] = "#{self.host}:#{self.port}"
49
77
  kv_payload[:redis][:db] = db.to_s
50
- kv_payload[:redis][:command] = pipeline.is_a?(::Redis::Pipeline::Multi) ? 'MULTI' : 'PIPELINE'
78
+ kv_payload[:redis][:command] = command
51
79
  rescue
52
80
  nil
53
81
  end
54
-
55
- super(*args, &block)
82
+ original_super.bind(self).call(*original_args, &block)
56
83
  rescue => e
57
84
  ::Instana.tracer.log_info({ redis: {error: true} })
58
85
  ::Instana.tracer.log_error(e)
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.2"
5
+ VERSION = "1.214.0"
6
6
  VERSION_FULL = "instana-#{VERSION}"
7
7
  end
@@ -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
@@ -49,9 +49,9 @@ class RedisTest < Minitest::Test
49
49
  clear_all!
50
50
 
51
51
  Instana.tracer.start_or_continue_trace(:redis_test) do
52
- @redis_client.pipelined do
53
- @redis_client.set('hello', 'world')
54
- @redis_client.set('other', 'world')
52
+ @redis_client.pipelined do |pipeline|
53
+ pipeline.set('hello', 'world')
54
+ pipeline.set('other', 'world')
55
55
  end
56
56
  end
57
57
 
@@ -63,9 +63,9 @@ class RedisTest < Minitest::Test
63
63
 
64
64
  Instana.tracer.start_or_continue_trace(:redis_test) do
65
65
  begin
66
- @redis_client.pipelined do
67
- @redis_client.set('other', 'world')
68
- @redis_client.call('invalid')
66
+ @redis_client.pipelined do |pipeline|
67
+ pipeline.set('other', 'world')
68
+ pipeline.call('invalid')
69
69
  end
70
70
  rescue; end
71
71
  end
@@ -77,9 +77,9 @@ class RedisTest < Minitest::Test
77
77
  clear_all!
78
78
 
79
79
  Instana.tracer.start_or_continue_trace(:redis_test) do
80
- @redis_client.multi do
81
- @redis_client.set('hello', 'world')
82
- @redis_client.set('other', 'world')
80
+ @redis_client.multi do |multi|
81
+ multi.set('hello', 'world')
82
+ multi.set('other', 'world')
83
83
  end
84
84
  end
85
85
 
@@ -91,9 +91,9 @@ class RedisTest < Minitest::Test
91
91
 
92
92
  Instana.tracer.start_or_continue_trace(:redis_test) do
93
93
  begin
94
- @redis_client.multi do
95
- @redis_client.set('other', 'world')
96
- @redis_client.call('invalid')
94
+ @redis_client.multi do |multi|
95
+ multi.set('other', 'world')
96
+ multi.call('invalid')
97
97
  end
98
98
  rescue; end
99
99
  end
@@ -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.2
4
+ version: 1.214.0
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-29 00:00:00.000000000 Z
11
+ date: 2024-03-28 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
@@ -186,20 +185,17 @@ files:
186
185
  - gemfiles/rails_70.gemfile
187
186
  - gemfiles/rails_71.gemfile
188
187
  - gemfiles/redis_40.gemfile
188
+ - gemfiles/redis_50.gemfile
189
189
  - gemfiles/resque_122.gemfile
190
190
  - gemfiles/resque_20.gemfile
191
- - gemfiles/rest_client_16.gemfile
192
191
  - gemfiles/rest_client_20.gemfile
193
192
  - gemfiles/roda_20.gemfile
194
193
  - gemfiles/roda_30.gemfile
195
194
  - gemfiles/shoryuken_50.gemfile
196
195
  - gemfiles/shoryuken_60.gemfile
197
- - gemfiles/sidekiq_42.gemfile
198
- - gemfiles/sidekiq_50.gemfile
199
196
  - gemfiles/sidekiq_60.gemfile
200
197
  - gemfiles/sidekiq_65.gemfile
201
198
  - gemfiles/sidekiq_70.gemfile
202
- - gemfiles/sinatra_14.gemfile
203
199
  - gemfiles/sinatra_22.gemfile
204
200
  - gemfiles/sinatra_30.gemfile
205
201
  - gemfiles/sinatra_40.gemfile
@@ -396,14 +392,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
396
392
  requirements:
397
393
  - - ">="
398
394
  - !ruby/object:Gem::Version
399
- version: '2.7'
395
+ version: '3.0'
400
396
  required_rubygems_version: !ruby/object:Gem::Requirement
401
397
  requirements:
402
398
  - - ">="
403
399
  - !ruby/object:Gem::Version
404
400
  version: '0'
405
401
  requirements: []
406
- rubygems_version: 3.4.10
402
+ rubygems_version: 3.4.19
407
403
  signing_key:
408
404
  specification_version: 4
409
405
  summary: Ruby Distributed Tracing & Metrics Sensor for Instana
@@ -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: "../"