instana 1.209.8 → 1.210.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 +4 -4
- data/.circleci/config.yml +159 -1
- data/gemfiles/excon_100.gemfile +16 -0
- data/gemfiles/grpc_10.gemfile +1 -1
- data/gemfiles/rails_61.gemfile +22 -0
- data/gemfiles/rails_70.gemfile +19 -0
- data/gemfiles/rest_client_20.gemfile +1 -1
- data/gemfiles/sidekiq_60.gemfile +15 -0
- data/gemfiles/sidekiq_70.gemfile +15 -0
- data/lib/instana/instrumentation/action_cable.rb +2 -2
- data/lib/instana/instrumentation/active_record.rb +2 -2
- data/lib/instana/version.rb +1 -1
- data/lib/opentracing.rb +2 -2
- data/test/instrumentation/rails_action_cable_test.rb +3 -3
- data/test/instrumentation/rails_action_mailer_test.rb +18 -7
- data/test/instrumentation/rails_action_view_test.rb +40 -0
- data/test/instrumentation/sidekiq-client_test.rb +15 -0
- data/test/instrumentation/sidekiq-worker_test.rb +39 -0
- data/test/support/apps/http_endpoint/boot.rb +1 -1
- data/test/support/apps/sidekiq/worker.rb +11 -4
- metadata +7 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f0c28b91f8eb2d64963d01cf4a2368efbdb21ca9d9a8290324c382730d7a4785
|
|
4
|
+
data.tar.gz: b36132d8b22cf57151889f9955f58656cf8d02048c148bf3c7bc62b619926604
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b55ba81f80d1d99e79225cf611fe435b7db3ea64ff4dd2ce0044fa524d0ccf1618b52cf01de59daf9e60fc8d0c78caf6425f00c8a8983ad92eea505c5036e0a2
|
|
7
|
+
data.tar.gz: de69af23be0d789a7468f8927ed948ced66ebb7e3f49d78422d52dbc08988dfe2427c7690c06e105cb429d62447cd9bd863543ca9fd982864d8899cf38e3ca58
|
data/.circleci/config.yml
CHANGED
|
@@ -38,6 +38,117 @@ executors:
|
|
|
38
38
|
environment:
|
|
39
39
|
POSTGRES_PASSWORD: 'test'
|
|
40
40
|
POSTGRES_DB: 'ci_test'
|
|
41
|
+
ruby_30:
|
|
42
|
+
docker:
|
|
43
|
+
- image: cimg/ruby:3.0-node
|
|
44
|
+
environment:
|
|
45
|
+
MEMCACHED_HOST: '127.0.0.1:11211'
|
|
46
|
+
REDIS_URL: 'redis://127.0.0.1:6379'
|
|
47
|
+
DATABASE_URL: 'sqlite3::memory:'
|
|
48
|
+
- image: memcached
|
|
49
|
+
- image: redis
|
|
50
|
+
- image: amazon/dynamodb-local
|
|
51
|
+
- image: minio/minio:latest
|
|
52
|
+
command: ["server", "/data"]
|
|
53
|
+
- image: s12v/sns
|
|
54
|
+
- image: softwaremill/elasticmq-native
|
|
55
|
+
- image: mongo:5-focal
|
|
56
|
+
ruby_30_mysql2:
|
|
57
|
+
docker:
|
|
58
|
+
- image: cimg/ruby:3.0-node
|
|
59
|
+
environment:
|
|
60
|
+
DATABASE_URL: "mysql2://root@127.0.0.1:3306/ci_test"
|
|
61
|
+
- image: mariadb
|
|
62
|
+
environment:
|
|
63
|
+
MYSQL_DATABASE: 'ci_test'
|
|
64
|
+
MYSQL_USER: 'root'
|
|
65
|
+
MYSQL_PASSWORD: ''
|
|
66
|
+
MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
|
|
67
|
+
MYSQL_ROOT_PASSWORD: ''
|
|
68
|
+
MYSQL_ROOT_HOST: '%'
|
|
69
|
+
ruby_30_postgres:
|
|
70
|
+
docker:
|
|
71
|
+
- image: cimg/ruby:3.0-node
|
|
72
|
+
environment:
|
|
73
|
+
DATABASE_URL: "postgres://postgres:test@127.0.0.1:5432/ci_test"
|
|
74
|
+
- image: postgres
|
|
75
|
+
environment:
|
|
76
|
+
POSTGRES_PASSWORD: 'test'
|
|
77
|
+
POSTGRES_DB: 'ci_test'
|
|
78
|
+
ruby_31:
|
|
79
|
+
docker:
|
|
80
|
+
- image: cimg/ruby:3.1-node
|
|
81
|
+
environment:
|
|
82
|
+
MEMCACHED_HOST: '127.0.0.1:11211'
|
|
83
|
+
REDIS_URL: 'redis://127.0.0.1:6379'
|
|
84
|
+
DATABASE_URL: 'sqlite3::memory:'
|
|
85
|
+
- image: memcached
|
|
86
|
+
- image: redis
|
|
87
|
+
- image: amazon/dynamodb-local
|
|
88
|
+
- image: minio/minio:latest
|
|
89
|
+
command: ["server", "/data"]
|
|
90
|
+
- image: s12v/sns
|
|
91
|
+
- image: softwaremill/elasticmq-native
|
|
92
|
+
- image: mongo:5-focal
|
|
93
|
+
ruby_31_mysql2:
|
|
94
|
+
docker:
|
|
95
|
+
- image: cimg/ruby:3.1-node
|
|
96
|
+
environment:
|
|
97
|
+
DATABASE_URL: "mysql2://root@127.0.0.1:3306/ci_test"
|
|
98
|
+
- image: mariadb
|
|
99
|
+
environment:
|
|
100
|
+
MYSQL_DATABASE: 'ci_test'
|
|
101
|
+
MYSQL_USER: 'root'
|
|
102
|
+
MYSQL_PASSWORD: ''
|
|
103
|
+
MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
|
|
104
|
+
MYSQL_ROOT_PASSWORD: ''
|
|
105
|
+
MYSQL_ROOT_HOST: '%'
|
|
106
|
+
ruby_31_postgres:
|
|
107
|
+
docker:
|
|
108
|
+
- image: cimg/ruby:3.1-node
|
|
109
|
+
environment:
|
|
110
|
+
DATABASE_URL: "postgres://postgres:test@127.0.0.1:5432/ci_test"
|
|
111
|
+
- image: postgres
|
|
112
|
+
environment:
|
|
113
|
+
POSTGRES_PASSWORD: 'test'
|
|
114
|
+
POSTGRES_DB: 'ci_test'
|
|
115
|
+
ruby_32:
|
|
116
|
+
docker:
|
|
117
|
+
- image: cimg/ruby:3.2-node
|
|
118
|
+
environment:
|
|
119
|
+
MEMCACHED_HOST: '127.0.0.1:11211'
|
|
120
|
+
REDIS_URL: 'redis://127.0.0.1:6379'
|
|
121
|
+
DATABASE_URL: 'sqlite3::memory:'
|
|
122
|
+
- image: memcached
|
|
123
|
+
- image: redis
|
|
124
|
+
- image: amazon/dynamodb-local
|
|
125
|
+
- image: minio/minio:latest
|
|
126
|
+
command: ["server", "/data"]
|
|
127
|
+
- image: s12v/sns
|
|
128
|
+
- image: softwaremill/elasticmq-native
|
|
129
|
+
- image: mongo:5-focal
|
|
130
|
+
ruby_32_mysql2:
|
|
131
|
+
docker:
|
|
132
|
+
- image: cimg/ruby:3.2-node
|
|
133
|
+
environment:
|
|
134
|
+
DATABASE_URL: "mysql2://root@127.0.0.1:3306/ci_test"
|
|
135
|
+
- image: mariadb
|
|
136
|
+
environment:
|
|
137
|
+
MYSQL_DATABASE: 'ci_test'
|
|
138
|
+
MYSQL_USER: 'root'
|
|
139
|
+
MYSQL_PASSWORD: ''
|
|
140
|
+
MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
|
|
141
|
+
MYSQL_ROOT_PASSWORD: ''
|
|
142
|
+
MYSQL_ROOT_HOST: '%'
|
|
143
|
+
ruby_32_postgres:
|
|
144
|
+
docker:
|
|
145
|
+
- image: cimg/ruby:3.2-node
|
|
146
|
+
environment:
|
|
147
|
+
DATABASE_URL: "postgres://postgres:test@127.0.0.1:5432/ci_test"
|
|
148
|
+
- image: postgres
|
|
149
|
+
environment:
|
|
150
|
+
POSTGRES_PASSWORD: 'test'
|
|
151
|
+
POSTGRES_DB: 'ci_test'
|
|
41
152
|
|
|
42
153
|
commands:
|
|
43
154
|
setup:
|
|
@@ -176,6 +287,9 @@ workflows:
|
|
|
176
287
|
parameters:
|
|
177
288
|
stack:
|
|
178
289
|
- ruby_27
|
|
290
|
+
- ruby_30
|
|
291
|
+
- ruby_31
|
|
292
|
+
- ruby_32
|
|
179
293
|
libraries:
|
|
180
294
|
jobs:
|
|
181
295
|
- test_apprisal:
|
|
@@ -183,6 +297,9 @@ workflows:
|
|
|
183
297
|
parameters:
|
|
184
298
|
stack:
|
|
185
299
|
- ruby_27
|
|
300
|
+
- ruby_30
|
|
301
|
+
- ruby_31
|
|
302
|
+
- ruby_32
|
|
186
303
|
gemfile:
|
|
187
304
|
- "./gemfiles/aws_30.gemfile"
|
|
188
305
|
- "./gemfiles/cuba_30.gemfile"
|
|
@@ -190,6 +307,7 @@ workflows:
|
|
|
190
307
|
- "./gemfiles/dalli_20.gemfile"
|
|
191
308
|
- "./gemfiles/excon_02.gemfile"
|
|
192
309
|
- "./gemfiles/excon_079.gemfile"
|
|
310
|
+
- "./gemfiles/excon_100.gemfile"
|
|
193
311
|
- "./gemfiles/graphql_10.gemfile"
|
|
194
312
|
- "./gemfiles/graphql_20.gemfile"
|
|
195
313
|
- "./gemfiles/grpc_10.gemfile"
|
|
@@ -205,10 +323,32 @@ workflows:
|
|
|
205
323
|
- "./gemfiles/roda_30.gemfile"
|
|
206
324
|
- "./gemfiles/sidekiq_42.gemfile"
|
|
207
325
|
- "./gemfiles/sidekiq_50.gemfile"
|
|
326
|
+
- "./gemfiles/sidekiq_60.gemfile"
|
|
327
|
+
- "./gemfiles/sidekiq_70.gemfile"
|
|
208
328
|
- "./gemfiles/sinatra_14.gemfile"
|
|
209
329
|
- "./gemfiles/shoryuken_50.gemfile"
|
|
210
330
|
- "./gemfiles/mongo_216.gemfile"
|
|
211
|
-
|
|
331
|
+
exclude:
|
|
332
|
+
# Currently rest-client 1.6 gemfile pulls in mime-types 2.99.3
|
|
333
|
+
# and adaptation to mime-type 3.0 is only available in rest-client 2.0:
|
|
334
|
+
# https://github.com/rest-client/rest-client/issues/464
|
|
335
|
+
# But mime-types 2.99.3 is too old for Ruby 3.0 or newer:
|
|
336
|
+
# https://stackoverflow.com/a/68433864
|
|
337
|
+
# so we should exclude thiese scenarios
|
|
338
|
+
- stack: ruby_30
|
|
339
|
+
gemfile: "./gemfiles/rest_client_16.gemfile"
|
|
340
|
+
- stack: ruby_31
|
|
341
|
+
gemfile: "./gemfiles/rest_client_16.gemfile"
|
|
342
|
+
- stack: ruby_32
|
|
343
|
+
gemfile: "./gemfiles/rest_client_16.gemfile"
|
|
344
|
+
# Sinatra 1.4 relies on the Fixnum class
|
|
345
|
+
# which has been removed from Ruby 3.2, see:
|
|
346
|
+
# https://bugs.ruby-lang.org/issues/12005
|
|
347
|
+
# https://www.ruby-lang.org/en/news/2022/11/11/ruby-3-2-0-preview3-released/
|
|
348
|
+
- stack: ruby_32
|
|
349
|
+
gemfile: "./gemfiles/sinatra_14.gemfile"
|
|
350
|
+
|
|
351
|
+
rails_ruby_2:
|
|
212
352
|
jobs:
|
|
213
353
|
- test_apprisal:
|
|
214
354
|
matrix:
|
|
@@ -221,3 +361,21 @@ workflows:
|
|
|
221
361
|
- "./gemfiles/rails_60.gemfile"
|
|
222
362
|
- "./gemfiles/rails_52.gemfile"
|
|
223
363
|
- "./gemfiles/rails_50.gemfile"
|
|
364
|
+
rails_ruby_3:
|
|
365
|
+
jobs:
|
|
366
|
+
- test_apprisal:
|
|
367
|
+
matrix:
|
|
368
|
+
parameters:
|
|
369
|
+
stack:
|
|
370
|
+
- ruby_30
|
|
371
|
+
- ruby_30_postgres
|
|
372
|
+
- ruby_30_mysql2
|
|
373
|
+
- ruby_31
|
|
374
|
+
- ruby_31_postgres
|
|
375
|
+
- ruby_31_mysql2
|
|
376
|
+
- ruby_32
|
|
377
|
+
- ruby_32_postgres
|
|
378
|
+
- ruby_32_mysql2
|
|
379
|
+
gemfile:
|
|
380
|
+
- "./gemfiles/rails_61.gemfile"
|
|
381
|
+
- "./gemfiles/rails_70.gemfile"
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# (c) Copyright IBM Corp. 2023
|
|
2
|
+
|
|
3
|
+
source "https://rubygems.org"
|
|
4
|
+
|
|
5
|
+
gem "rack", "<3.0.0"
|
|
6
|
+
gem "rake"
|
|
7
|
+
gem "minitest", "5.9.1"
|
|
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 "excon", ">= 0.100.0", "< 1.0"
|
|
15
|
+
|
|
16
|
+
gemspec path: "../"
|
data/gemfiles/grpc_10.gemfile
CHANGED
|
@@ -0,0 +1,22 @@
|
|
|
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 "rake"
|
|
9
|
+
gem "minitest", "5.9.1"
|
|
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 "mail", ">= 2.8.1"
|
|
17
|
+
gem "rails", ">= 6.1", "< 7.0"
|
|
18
|
+
gem "mysql2", "0.5.5"
|
|
19
|
+
gem "pg"
|
|
20
|
+
gem "sqlite3", "~> 1.4"
|
|
21
|
+
|
|
22
|
+
gemspec path: "../"
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# (c) Copyright IBM Corp. 2023
|
|
2
|
+
|
|
3
|
+
source "https://rubygems.org"
|
|
4
|
+
|
|
5
|
+
gem "rake"
|
|
6
|
+
gem "minitest", "5.9.1"
|
|
7
|
+
gem "minitest-reporters"
|
|
8
|
+
gem "webmock"
|
|
9
|
+
gem "puma"
|
|
10
|
+
gem "rubocop", "~> 1.9"
|
|
11
|
+
gem "rack-test"
|
|
12
|
+
gem "simplecov", "~> 0.21.2"
|
|
13
|
+
gem "mail", ">= 2.8.1"
|
|
14
|
+
gem "rails", ">= 7.0"
|
|
15
|
+
gem "mysql2", "0.5.5"
|
|
16
|
+
gem "pg"
|
|
17
|
+
gem "sqlite3", "~> 1.4"
|
|
18
|
+
|
|
19
|
+
gemspec path: "../"
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# (c) Copyright IBM Corp. 2023
|
|
2
|
+
|
|
3
|
+
source "https://rubygems.org"
|
|
4
|
+
|
|
5
|
+
gem "rake"
|
|
6
|
+
gem "minitest", "5.9.1"
|
|
7
|
+
gem "minitest-reporters"
|
|
8
|
+
gem "webmock"
|
|
9
|
+
gem "puma"
|
|
10
|
+
gem "rubocop", "~> 1.9"
|
|
11
|
+
gem "rack-test"
|
|
12
|
+
gem "simplecov", "~> 0.21.2"
|
|
13
|
+
gem "sidekiq", ">= 6.0", "< 7.0"
|
|
14
|
+
|
|
15
|
+
gemspec path: "../"
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# (c) Copyright IBM Corp. 2023
|
|
2
|
+
|
|
3
|
+
source "https://rubygems.org"
|
|
4
|
+
|
|
5
|
+
gem "rake"
|
|
6
|
+
gem "minitest", "5.9.1"
|
|
7
|
+
gem "minitest-reporters"
|
|
8
|
+
gem "webmock"
|
|
9
|
+
gem "puma"
|
|
10
|
+
gem "rubocop", "~> 1.9"
|
|
11
|
+
gem "rack-test"
|
|
12
|
+
gem "simplecov", "~> 0.21.2"
|
|
13
|
+
gem "sidekiq", ">= 7.0"
|
|
14
|
+
|
|
15
|
+
gemspec path: "../"
|
|
@@ -15,7 +15,7 @@ module Instana
|
|
|
15
15
|
end
|
|
16
16
|
|
|
17
17
|
module ActionCableChannel
|
|
18
|
-
def transmit(
|
|
18
|
+
def transmit(data, via: nil)
|
|
19
19
|
rpc_tags = {
|
|
20
20
|
service: ::Instana::Util.get_app_name,
|
|
21
21
|
rpc: {
|
|
@@ -28,7 +28,7 @@ module Instana
|
|
|
28
28
|
|
|
29
29
|
context = connection.instana_trace_context
|
|
30
30
|
::Instana.tracer.start_or_continue_trace(:'rpc-server', rpc_tags, context) do
|
|
31
|
-
super(
|
|
31
|
+
super(data, via: via)
|
|
32
32
|
end
|
|
33
33
|
end
|
|
34
34
|
|
|
@@ -8,7 +8,7 @@ module Instana
|
|
|
8
8
|
IGNORED_SQL = %w[BEGIN COMMIT SET].freeze
|
|
9
9
|
SANITIZE_REGEXP = /('[\s\S][^']*'|\d*\.\d+|\d+|NULL)/i.freeze
|
|
10
10
|
|
|
11
|
-
def log(sql, name = 'SQL', binds = [], *args)
|
|
11
|
+
def log(sql, name = 'SQL', binds = [], *args, **kwargs, &block)
|
|
12
12
|
call_payload = {
|
|
13
13
|
activerecord: {
|
|
14
14
|
adapter: @config[:adapter],
|
|
@@ -24,7 +24,7 @@ module Instana
|
|
|
24
24
|
call_payload[:activerecord][:binds] = mapped
|
|
25
25
|
end
|
|
26
26
|
|
|
27
|
-
maybe_trace(call_payload, name) { super(sql, name, binds, *args) }
|
|
27
|
+
maybe_trace(call_payload, name) { super(sql, name, binds, *args, **kwargs, &block) }
|
|
28
28
|
end
|
|
29
29
|
|
|
30
30
|
private
|
data/lib/instana/version.rb
CHANGED
data/lib/opentracing.rb
CHANGED
|
@@ -17,8 +17,8 @@ module OpenTracing
|
|
|
17
17
|
|
|
18
18
|
attr_accessor :global_tracer
|
|
19
19
|
|
|
20
|
-
def method_missing(method_name, *args, &block)
|
|
21
|
-
@global_tracer.send(method_name, *args, &block)
|
|
20
|
+
def method_missing(method_name, *args, **kwargs, &block)
|
|
21
|
+
@global_tracer.send(method_name, *args, **kwargs, &block)
|
|
22
22
|
end
|
|
23
23
|
|
|
24
24
|
def respond_to_missing?(name, all)
|
|
@@ -22,7 +22,7 @@ class RailsActionCableTest < Minitest::Test
|
|
|
22
22
|
|
|
23
23
|
channel_klass
|
|
24
24
|
.new(connection, :test)
|
|
25
|
-
.send(:transmit, '
|
|
25
|
+
.send(:transmit, 'Sample message', via: nil)
|
|
26
26
|
|
|
27
27
|
span, rest = Instana.processor.queued_spans
|
|
28
28
|
data = span[:data]
|
|
@@ -47,7 +47,7 @@ class RailsActionCableTest < Minitest::Test
|
|
|
47
47
|
|
|
48
48
|
channel_klass
|
|
49
49
|
.new(connection, :test)
|
|
50
|
-
.send(:transmit, '
|
|
50
|
+
.send(:transmit, 'Sample message', via: 'Important')
|
|
51
51
|
|
|
52
52
|
span, rest = Instana.processor.queued_spans
|
|
53
53
|
data = span[:data]
|
|
@@ -125,7 +125,7 @@ class RailsActionCableTest < Minitest::Test
|
|
|
125
125
|
config: OpenStruct.new(log_tags: [])
|
|
126
126
|
)
|
|
127
127
|
connection = ActionCable::Connection::Base.new(server, {})
|
|
128
|
-
connection.define_singleton_method(:transmit) { |*_args| true }
|
|
128
|
+
connection.define_singleton_method(:transmit) { |*_args, **_kwargs| true }
|
|
129
129
|
connection
|
|
130
130
|
end
|
|
131
131
|
end
|
|
@@ -7,13 +7,24 @@ require 'action_mailer'
|
|
|
7
7
|
class RailsActionMailerTest < Minitest::Test
|
|
8
8
|
class TestMailer < ActionMailer::Base
|
|
9
9
|
def sample_email
|
|
10
|
-
mail
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
mail_version = Gem::Specification.find_by_name('mail').version
|
|
11
|
+
if mail_version >= Gem::Version.new('2.8.1')
|
|
12
|
+
Mail.new do
|
|
13
|
+
from 'test@example.com'
|
|
14
|
+
to 'test@example.com'
|
|
15
|
+
subject 'Test Email'
|
|
16
|
+
body 'Hello'
|
|
17
|
+
content_type "text/html"
|
|
18
|
+
end
|
|
19
|
+
else
|
|
20
|
+
mail(
|
|
21
|
+
from: 'test@example.com',
|
|
22
|
+
to: 'test@example.com',
|
|
23
|
+
subject: 'Test Email',
|
|
24
|
+
body: 'Hello',
|
|
25
|
+
content_type: "text/html"
|
|
26
|
+
)
|
|
27
|
+
end
|
|
17
28
|
end
|
|
18
29
|
end
|
|
19
30
|
|
|
@@ -13,6 +13,18 @@ class RailsActionViewTest < Minitest::Test
|
|
|
13
13
|
|
|
14
14
|
def setup
|
|
15
15
|
clear_all!
|
|
16
|
+
@framework_version = Gem::Specification.find_by_name('rails').version
|
|
17
|
+
@supported_framework_version = @framework_version < Gem::Version.new('6.1')
|
|
18
|
+
@execute_test_if_framework_version_is_supported = lambda {
|
|
19
|
+
unless @supported_framework_version
|
|
20
|
+
skip "Skipping this test because Rails version #{@framework_version} is not yet supported!"
|
|
21
|
+
end
|
|
22
|
+
}
|
|
23
|
+
@execute_test_only_if_framework_version_is_not_supported = lambda {
|
|
24
|
+
if @supported_framework_version
|
|
25
|
+
skip "Skipping this test because Rails version #{@framework_version} is already supported!"
|
|
26
|
+
end
|
|
27
|
+
}
|
|
16
28
|
end
|
|
17
29
|
|
|
18
30
|
def test_config_defaults
|
|
@@ -21,7 +33,25 @@ class RailsActionViewTest < Minitest::Test
|
|
|
21
33
|
assert_equal true, ::Instana.config[:action_view][:enabled]
|
|
22
34
|
end
|
|
23
35
|
|
|
36
|
+
def test_no_tracing_if_unsupported_version_only_render_is_ok
|
|
37
|
+
@execute_test_only_if_framework_version_is_not_supported.call
|
|
38
|
+
|
|
39
|
+
['/render_view', '/render_view_direct', '/render_partial', '/render_collection', '/render_file',
|
|
40
|
+
'/render_alternate_layout', '/render_json', '/render_xml',
|
|
41
|
+
'/render_rawbody', '/render_js'].each do |endpoint|
|
|
42
|
+
get endpoint
|
|
43
|
+
assert last_response.ok?
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
get '/render_partial_that_errors'
|
|
47
|
+
assert_equal false, last_response.ok?
|
|
48
|
+
|
|
49
|
+
spans = ::Instana.processor.queued_spans
|
|
50
|
+
assert_equal [], spans
|
|
51
|
+
end
|
|
52
|
+
|
|
24
53
|
def test_render_view
|
|
54
|
+
@execute_test_if_framework_version_is_supported.call
|
|
25
55
|
get '/render_view'
|
|
26
56
|
assert last_response.ok?
|
|
27
57
|
|
|
@@ -32,6 +62,7 @@ class RailsActionViewTest < Minitest::Test
|
|
|
32
62
|
end
|
|
33
63
|
|
|
34
64
|
def test_render_view_direct
|
|
65
|
+
@execute_test_if_framework_version_is_supported.call
|
|
35
66
|
get '/render_view_direct'
|
|
36
67
|
assert last_response.ok?
|
|
37
68
|
|
|
@@ -54,6 +85,7 @@ class RailsActionViewTest < Minitest::Test
|
|
|
54
85
|
end
|
|
55
86
|
|
|
56
87
|
def test_render_file
|
|
88
|
+
@execute_test_if_framework_version_is_supported.call
|
|
57
89
|
get '/render_file'
|
|
58
90
|
assert last_response.ok?
|
|
59
91
|
|
|
@@ -64,6 +96,7 @@ class RailsActionViewTest < Minitest::Test
|
|
|
64
96
|
end
|
|
65
97
|
|
|
66
98
|
def test_render_json
|
|
99
|
+
@execute_test_if_framework_version_is_supported.call
|
|
67
100
|
get '/render_json'
|
|
68
101
|
assert last_response.ok?
|
|
69
102
|
|
|
@@ -74,6 +107,7 @@ class RailsActionViewTest < Minitest::Test
|
|
|
74
107
|
end
|
|
75
108
|
|
|
76
109
|
def test_render_xml
|
|
110
|
+
@execute_test_if_framework_version_is_supported.call
|
|
77
111
|
get '/render_xml'
|
|
78
112
|
assert last_response.ok?
|
|
79
113
|
|
|
@@ -84,6 +118,7 @@ class RailsActionViewTest < Minitest::Test
|
|
|
84
118
|
end
|
|
85
119
|
|
|
86
120
|
def test_render_body
|
|
121
|
+
@execute_test_if_framework_version_is_supported.call
|
|
87
122
|
get '/render_rawbody'
|
|
88
123
|
assert last_response.ok?
|
|
89
124
|
|
|
@@ -94,6 +129,7 @@ class RailsActionViewTest < Minitest::Test
|
|
|
94
129
|
end
|
|
95
130
|
|
|
96
131
|
def test_render_js
|
|
132
|
+
@execute_test_if_framework_version_is_supported.call
|
|
97
133
|
get '/render_js'
|
|
98
134
|
assert last_response.ok?
|
|
99
135
|
|
|
@@ -104,6 +140,7 @@ class RailsActionViewTest < Minitest::Test
|
|
|
104
140
|
end
|
|
105
141
|
|
|
106
142
|
def test_render_alternate_layout
|
|
143
|
+
@execute_test_if_framework_version_is_supported.call
|
|
107
144
|
get '/render_alternate_layout'
|
|
108
145
|
assert last_response.ok?
|
|
109
146
|
|
|
@@ -114,6 +151,7 @@ class RailsActionViewTest < Minitest::Test
|
|
|
114
151
|
end
|
|
115
152
|
|
|
116
153
|
def test_render_partial
|
|
154
|
+
@execute_test_if_framework_version_is_supported.call
|
|
117
155
|
get '/render_partial'
|
|
118
156
|
assert last_response.ok?
|
|
119
157
|
|
|
@@ -124,6 +162,7 @@ class RailsActionViewTest < Minitest::Test
|
|
|
124
162
|
end
|
|
125
163
|
|
|
126
164
|
def test_render_partial_that_errors
|
|
165
|
+
@execute_test_if_framework_version_is_supported.call
|
|
127
166
|
get '/render_partial_that_errors'
|
|
128
167
|
refute last_response.ok?
|
|
129
168
|
|
|
@@ -139,6 +178,7 @@ class RailsActionViewTest < Minitest::Test
|
|
|
139
178
|
end
|
|
140
179
|
|
|
141
180
|
def test_render_collection
|
|
181
|
+
@execute_test_if_framework_version_is_supported.call
|
|
142
182
|
get '/render_collection'
|
|
143
183
|
assert last_response.ok?
|
|
144
184
|
|
|
@@ -6,6 +6,19 @@ require 'support/apps/sidekiq/boot'
|
|
|
6
6
|
|
|
7
7
|
class SidekiqClientTest < Minitest::Test
|
|
8
8
|
def setup
|
|
9
|
+
@framework_version = Gem::Specification.find_by_name('sidekiq').version
|
|
10
|
+
@supported_framework_version = @framework_version < Gem::Version.new('5.3')
|
|
11
|
+
@execute_test_if_framework_version_is_supported = lambda {
|
|
12
|
+
unless @supported_framework_version
|
|
13
|
+
skip "Skipping this test because sidekiq version #{@framework_version} is not yet supported!"
|
|
14
|
+
end
|
|
15
|
+
}
|
|
16
|
+
@execute_test_only_if_framework_version_is_not_supported = lambda {
|
|
17
|
+
if @supported_framework_version
|
|
18
|
+
skip "Skipping this test because sidekiq version #{@framework_version} is already supported!"
|
|
19
|
+
end
|
|
20
|
+
}
|
|
21
|
+
|
|
9
22
|
Sidekiq.configure_client do |config|
|
|
10
23
|
config.redis = { url: ENV["REDIS_URL"] }
|
|
11
24
|
end
|
|
@@ -19,6 +32,7 @@ class SidekiqClientTest < Minitest::Test
|
|
|
19
32
|
end
|
|
20
33
|
|
|
21
34
|
def test_enqueue
|
|
35
|
+
@execute_test_if_framework_version_is_supported.call
|
|
22
36
|
clear_all!
|
|
23
37
|
Instana.tracer.start_or_continue_trace(:sidekiqtests) do
|
|
24
38
|
disable_redis_instrumentation
|
|
@@ -39,6 +53,7 @@ class SidekiqClientTest < Minitest::Test
|
|
|
39
53
|
end
|
|
40
54
|
|
|
41
55
|
def test_enqueue_failure
|
|
56
|
+
@execute_test_if_framework_version_is_supported.call
|
|
42
57
|
clear_all!
|
|
43
58
|
|
|
44
59
|
Instana.tracer.start_or_continue_trace(:sidekiqtests) do
|
|
@@ -6,6 +6,19 @@ require 'support/apps/sidekiq/boot'
|
|
|
6
6
|
|
|
7
7
|
class SidekiqServerTest < Minitest::Test
|
|
8
8
|
def setup
|
|
9
|
+
@framework_version = Gem::Specification.find_by_name('sidekiq').version
|
|
10
|
+
@supported_framework_version = @framework_version < Gem::Version.new('5.3')
|
|
11
|
+
@execute_test_if_framework_version_is_supported = lambda {
|
|
12
|
+
unless @supported_framework_version
|
|
13
|
+
skip "Skipping this test because sidekiq version #{@framework_version} is not yet supported!"
|
|
14
|
+
end
|
|
15
|
+
}
|
|
16
|
+
@execute_test_only_if_framework_version_is_not_supported = lambda {
|
|
17
|
+
if @supported_framework_version
|
|
18
|
+
skip "Skipping this test because sidekiq version #{@framework_version} is already supported!"
|
|
19
|
+
end
|
|
20
|
+
}
|
|
21
|
+
|
|
9
22
|
Sidekiq.configure_client do |config|
|
|
10
23
|
config.redis = { url: ENV["REDIS_URL"] }
|
|
11
24
|
end
|
|
@@ -17,7 +30,30 @@ class SidekiqServerTest < Minitest::Test
|
|
|
17
30
|
assert_equal true, ::Instana.config[:'sidekiq-worker'][:enabled]
|
|
18
31
|
end
|
|
19
32
|
|
|
33
|
+
def test_no_sidekiq_tracing_if_unsupported_version_only_redis
|
|
34
|
+
@execute_test_only_if_framework_version_is_not_supported.call
|
|
35
|
+
clear_all!
|
|
36
|
+
::Sidekiq.redis_pool.with do |redis|
|
|
37
|
+
redis.sadd('queues'.freeze, 'important')
|
|
38
|
+
redis.lpush(
|
|
39
|
+
'queue:important',
|
|
40
|
+
<<-JSON
|
|
41
|
+
{
|
|
42
|
+
"class":"SidekiqJobOne",
|
|
43
|
+
"args":[1,2,3],
|
|
44
|
+
"queue":"important",
|
|
45
|
+
"jid":"123456789"
|
|
46
|
+
}
|
|
47
|
+
JSON
|
|
48
|
+
)
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
spans = Instana.processor.queued_spans
|
|
52
|
+
assert spans
|
|
53
|
+
end
|
|
54
|
+
|
|
20
55
|
def test_successful_worker_starts_new_trace
|
|
56
|
+
@execute_test_if_framework_version_is_supported.call
|
|
21
57
|
clear_all!
|
|
22
58
|
$sidekiq_mode = :server
|
|
23
59
|
inject_instrumentation
|
|
@@ -48,6 +84,7 @@ class SidekiqServerTest < Minitest::Test
|
|
|
48
84
|
end
|
|
49
85
|
|
|
50
86
|
def test_failed_worker_starts_new_trace
|
|
87
|
+
@execute_test_if_framework_version_is_supported.call
|
|
51
88
|
clear_all!
|
|
52
89
|
$sidekiq_mode = :server
|
|
53
90
|
inject_instrumentation
|
|
@@ -79,6 +116,7 @@ class SidekiqServerTest < Minitest::Test
|
|
|
79
116
|
end
|
|
80
117
|
|
|
81
118
|
def test_successful_worker_continues_previous_trace
|
|
119
|
+
@execute_test_if_framework_version_is_supported.call
|
|
82
120
|
clear_all!
|
|
83
121
|
$sidekiq_mode = :server
|
|
84
122
|
inject_instrumentation
|
|
@@ -112,6 +150,7 @@ class SidekiqServerTest < Minitest::Test
|
|
|
112
150
|
end
|
|
113
151
|
|
|
114
152
|
def test_failed_worker_continues_previous_trace
|
|
153
|
+
@execute_test_if_framework_version_is_supported.call
|
|
115
154
|
clear_all!
|
|
116
155
|
$sidekiq_mode = :server
|
|
117
156
|
inject_instrumentation
|
|
@@ -12,12 +12,19 @@ require_relative 'jobs/sidekiq_job_2'
|
|
|
12
12
|
::Instana.logger.info "Booting instrumented sidekiq worker for tests."
|
|
13
13
|
::Sidekiq.logger.level = ::Logger::FATAL
|
|
14
14
|
|
|
15
|
+
properties = {queues: ['important'], concurrency: 2}
|
|
16
|
+
|
|
17
|
+
sidekiq_version = Gem::Specification.find_by_name('sidekiq').version
|
|
18
|
+
config_or_options =
|
|
19
|
+
if sidekiq_version >= Gem::Version.new('7.0.0')
|
|
20
|
+
::Sidekiq::Config.new(Sidekiq.default_configuration.merge!(properties))
|
|
21
|
+
else
|
|
22
|
+
::Sidekiq.options.merge(properties)
|
|
23
|
+
end
|
|
24
|
+
|
|
15
25
|
sidekiq_thread = Thread.new do
|
|
16
26
|
launcher = ::Sidekiq::Launcher.new(
|
|
17
|
-
|
|
18
|
-
queues: ['important'],
|
|
19
|
-
concurrency: 2
|
|
20
|
-
)
|
|
27
|
+
config_or_options
|
|
21
28
|
)
|
|
22
29
|
launcher.run
|
|
23
30
|
Thread.current[:worker] = launcher
|
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
|
+
version: 1.210.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: 2023-06-
|
|
11
|
+
date: 2023-06-20 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -162,6 +162,7 @@ files:
|
|
|
162
162
|
- gemfiles/excon_02.gemfile
|
|
163
163
|
- gemfiles/excon_021.gemfile
|
|
164
164
|
- gemfiles/excon_079.gemfile
|
|
165
|
+
- gemfiles/excon_100.gemfile
|
|
165
166
|
- gemfiles/graphql_10.gemfile
|
|
166
167
|
- gemfiles/graphql_20.gemfile
|
|
167
168
|
- gemfiles/grpc_10.gemfile
|
|
@@ -173,6 +174,8 @@ files:
|
|
|
173
174
|
- gemfiles/rails_50.gemfile
|
|
174
175
|
- gemfiles/rails_52.gemfile
|
|
175
176
|
- gemfiles/rails_60.gemfile
|
|
177
|
+
- gemfiles/rails_61.gemfile
|
|
178
|
+
- gemfiles/rails_70.gemfile
|
|
176
179
|
- gemfiles/redis_40.gemfile
|
|
177
180
|
- gemfiles/resque_122.gemfile
|
|
178
181
|
- gemfiles/resque_20.gemfile
|
|
@@ -183,6 +186,8 @@ files:
|
|
|
183
186
|
- gemfiles/shoryuken_50.gemfile
|
|
184
187
|
- gemfiles/sidekiq_42.gemfile
|
|
185
188
|
- gemfiles/sidekiq_50.gemfile
|
|
189
|
+
- gemfiles/sidekiq_60.gemfile
|
|
190
|
+
- gemfiles/sidekiq_70.gemfile
|
|
186
191
|
- gemfiles/sinatra_14.gemfile
|
|
187
192
|
- instana.gemspec
|
|
188
193
|
- lib/instana.rb
|