instana 1.209.7 → 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/instrumentation/graphql.rb +14 -1
- data/lib/instana/version.rb +1 -1
- data/lib/opentracing.rb +2 -2
- data/test/instrumentation/graphql_test.rb +155 -26
- 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
|
|
@@ -63,7 +63,20 @@ module Instana
|
|
|
63
63
|
return [] unless parent.respond_to?(method)
|
|
64
64
|
|
|
65
65
|
parent.send(method).map do |field|
|
|
66
|
-
|
|
66
|
+
# Certain types like GraphQL::Language::Nodes::InlineFragment
|
|
67
|
+
# have no "name" instance variable defined,
|
|
68
|
+
# in such case we use the class's name
|
|
69
|
+
parent_name = if parent.instance_variable_defined?(:@name)
|
|
70
|
+
parent.name
|
|
71
|
+
else
|
|
72
|
+
parent.class.name.split('::').last
|
|
73
|
+
end
|
|
74
|
+
field_name = if field.instance_variable_defined?(:@name)
|
|
75
|
+
field.name
|
|
76
|
+
else
|
|
77
|
+
field.class.name.split('::').last
|
|
78
|
+
end
|
|
79
|
+
[{object: parent_name, field: field_name}] + walk_fields(field, method)
|
|
67
80
|
end.flatten
|
|
68
81
|
end
|
|
69
82
|
|
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)
|
|
@@ -8,84 +8,213 @@ class GraphqlTest < Minitest::Test
|
|
|
8
8
|
field :id, ID, null: false
|
|
9
9
|
field :action, String, null: false
|
|
10
10
|
end
|
|
11
|
-
|
|
11
|
+
|
|
12
|
+
class JobType < GraphQL::Schema::Object
|
|
13
|
+
field :id, ID, null: false
|
|
14
|
+
field :name, String, null: false
|
|
15
|
+
field :description, String, null: false
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
class TaskJobUnion < GraphQL::Schema::Union
|
|
19
|
+
description "A union type for Task and Job"
|
|
20
|
+
possible_types TaskType, JobType
|
|
21
|
+
|
|
22
|
+
def self.resolve_type(object, _context)
|
|
23
|
+
if !object.action.nil?
|
|
24
|
+
TaskType
|
|
25
|
+
elsif !object.description?
|
|
26
|
+
JobType
|
|
27
|
+
else
|
|
28
|
+
raise("Unexpected object: #{object}")
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
|
|
12
33
|
class NewTaskType < GraphQL::Schema::Mutation
|
|
13
34
|
argument :action, String, required: true
|
|
14
35
|
field :task, TaskType, null: true
|
|
15
|
-
|
|
36
|
+
|
|
16
37
|
def resolve(action:)
|
|
17
38
|
{
|
|
18
39
|
task: OpenStruct.new(id: '0', action: action)
|
|
19
40
|
}
|
|
20
41
|
end
|
|
21
42
|
end
|
|
22
|
-
|
|
43
|
+
|
|
23
44
|
class QueryType < GraphQL::Schema::Object
|
|
24
45
|
field :tasks, TaskType.connection_type, null: false
|
|
25
|
-
|
|
46
|
+
field :jobs, JobType.connection_type, null: false
|
|
47
|
+
field :tasksorjobs, TaskJobUnion.connection_type, null: false
|
|
48
|
+
|
|
26
49
|
def tasks()
|
|
27
50
|
[
|
|
28
|
-
OpenStruct.new(id: '0', action: 'Sample')
|
|
51
|
+
OpenStruct.new(id: '0', action: 'Sample 00'),
|
|
52
|
+
OpenStruct.new(id: '1', action: 'Sample 01'),
|
|
53
|
+
OpenStruct.new(id: '2', action: 'Sample 02'),
|
|
54
|
+
OpenStruct.new(id: '3', action: 'Sample 03'),
|
|
55
|
+
OpenStruct.new(id: '4', action: 'Sample 04')
|
|
56
|
+
]
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
def jobs()
|
|
60
|
+
[
|
|
61
|
+
OpenStruct.new(id: '0', name: 'Name 00', description: 'Desc 00'),
|
|
62
|
+
OpenStruct.new(id: '1', name: 'Name 01', description: 'Desc 01'),
|
|
63
|
+
OpenStruct.new(id: '2', name: 'Name 02', description: 'Desc 02'),
|
|
64
|
+
OpenStruct.new(id: '3', name: 'Name 03', description: 'Desc 03'),
|
|
65
|
+
OpenStruct.new(id: '4', name: 'Name 04', description: 'Desc 04')
|
|
66
|
+
]
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
def tasksorjobs()
|
|
70
|
+
[
|
|
71
|
+
OpenStruct.new(id: '0', action: 'Task 00'),
|
|
72
|
+
OpenStruct.new(id: '0', name: 'Job 00', description: 'Job Desc 00')
|
|
29
73
|
]
|
|
30
74
|
end
|
|
31
75
|
end
|
|
32
|
-
|
|
76
|
+
|
|
33
77
|
class MutationType < GraphQL::Schema::Object
|
|
34
78
|
field :create_task, mutation: NewTaskType
|
|
35
79
|
end
|
|
36
|
-
|
|
80
|
+
|
|
37
81
|
class Schema < GraphQL::Schema
|
|
38
82
|
query QueryType
|
|
39
83
|
mutation MutationType
|
|
40
84
|
end
|
|
41
|
-
|
|
85
|
+
|
|
42
86
|
def test_it_works
|
|
43
87
|
assert defined?(GraphQL)
|
|
44
88
|
end
|
|
45
|
-
|
|
46
|
-
def test_config_defaults
|
|
89
|
+
|
|
90
|
+
def test_config_defaults
|
|
47
91
|
assert ::Instana.config[:graphql].is_a?(Hash)
|
|
48
92
|
assert ::Instana.config[:graphql].key?(:enabled)
|
|
49
93
|
assert_equal true, ::Instana.config[:graphql][:enabled]
|
|
50
94
|
end
|
|
51
|
-
|
|
95
|
+
|
|
52
96
|
def test_query
|
|
53
97
|
clear_all!
|
|
54
|
-
|
|
55
|
-
query = "query
|
|
56
|
-
tasks(after: \"\", first:
|
|
98
|
+
|
|
99
|
+
query = "query FirstTwoTaskSamples {
|
|
100
|
+
tasks(after: \"\", first: 2) {
|
|
57
101
|
nodes {
|
|
58
102
|
action
|
|
59
103
|
}
|
|
60
104
|
}
|
|
61
105
|
}"
|
|
62
|
-
|
|
106
|
+
|
|
63
107
|
expected_data = {
|
|
64
|
-
:operationName => "
|
|
108
|
+
:operationName => "FirstTwoTaskSamples",
|
|
65
109
|
:operationType => "query",
|
|
66
110
|
:arguments => { "tasks" => ["after", "first"] },
|
|
67
111
|
:fields => { "tasks" => ["nodes"], "nodes" => ["action"] }
|
|
68
112
|
}
|
|
69
113
|
expected_results = {
|
|
70
114
|
"data" => {
|
|
71
|
-
"tasks" => {
|
|
72
|
-
"nodes" => [{ "action" => "Sample"
|
|
115
|
+
"tasks" => {
|
|
116
|
+
"nodes" => [{"action" => "Sample 00"}, {"action" => "Sample 01"}]
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
results = Instana.tracer.start_or_continue_trace('graphql-test') { Schema.execute(query) }
|
|
122
|
+
query_span, root_span = *Instana.processor.queued_spans
|
|
123
|
+
|
|
124
|
+
assert_equal expected_results, results.to_h
|
|
125
|
+
assert_equal :sdk, root_span[:n]
|
|
126
|
+
assert_equal :'graphql.server', query_span[:n]
|
|
127
|
+
assert_equal expected_data, query_span[:data][:graphql]
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
def test_query_with_fragment
|
|
131
|
+
clear_all!
|
|
132
|
+
|
|
133
|
+
query = "
|
|
134
|
+
fragment actionDetails on Task {
|
|
135
|
+
action
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
query SampleWithFragment {
|
|
139
|
+
tasks {
|
|
140
|
+
nodes {
|
|
141
|
+
... actionDetails
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}"
|
|
145
|
+
|
|
146
|
+
expected_data = {
|
|
147
|
+
:operationName => "SampleWithFragment",
|
|
148
|
+
:operationType => "query",
|
|
149
|
+
:arguments => {},
|
|
150
|
+
:fields => { "tasks" => ["nodes"], "nodes" => ["actionDetails"] }
|
|
151
|
+
}
|
|
152
|
+
expected_results = {
|
|
153
|
+
"data" => {
|
|
154
|
+
"tasks" => {
|
|
155
|
+
"nodes" => [{"action" => "Sample 00"}, {"action" => "Sample 01"},
|
|
156
|
+
{"action" => "Sample 02"}, {"action" => "Sample 03"},
|
|
157
|
+
{"action" => "Sample 04"}]
|
|
73
158
|
}
|
|
74
159
|
}
|
|
75
160
|
}
|
|
76
|
-
|
|
161
|
+
|
|
77
162
|
results = Instana.tracer.start_or_continue_trace('graphql-test') { Schema.execute(query) }
|
|
78
163
|
query_span, root_span = *Instana.processor.queued_spans
|
|
79
|
-
|
|
164
|
+
|
|
80
165
|
assert_equal expected_results, results.to_h
|
|
81
166
|
assert_equal :sdk, root_span[:n]
|
|
82
167
|
assert_equal :'graphql.server', query_span[:n]
|
|
83
168
|
assert_equal expected_data, query_span[:data][:graphql]
|
|
84
169
|
end
|
|
85
|
-
|
|
170
|
+
|
|
171
|
+
def test_query_union_with_fragment
|
|
172
|
+
clear_all!
|
|
173
|
+
|
|
174
|
+
query = "
|
|
175
|
+
query QueryUnionWithFragment {
|
|
176
|
+
tasksorjobs {
|
|
177
|
+
nodes {
|
|
178
|
+
... on Task {
|
|
179
|
+
action
|
|
180
|
+
}
|
|
181
|
+
... on Job {
|
|
182
|
+
name
|
|
183
|
+
description
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}"
|
|
188
|
+
|
|
189
|
+
expected_data = {
|
|
190
|
+
:operationName => "QueryUnionWithFragment",
|
|
191
|
+
:operationType => "query",
|
|
192
|
+
:arguments => {},
|
|
193
|
+
:fields => { "tasksorjobs" => ["nodes"],
|
|
194
|
+
"nodes" => ["InlineFragment", "InlineFragment"],
|
|
195
|
+
"InlineFragment" => %w[action name description]}
|
|
196
|
+
}
|
|
197
|
+
expected_results = {
|
|
198
|
+
"data" => {
|
|
199
|
+
"tasksorjobs" => {
|
|
200
|
+
"nodes" => [{"action" => "Task 00"},
|
|
201
|
+
{"name" => "Job 00", "description" => "Job Desc 00"}]
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
results = Instana.tracer.start_or_continue_trace('graphql-test') { Schema.execute(query) }
|
|
207
|
+
query_span, root_span = *Instana.processor.queued_spans
|
|
208
|
+
|
|
209
|
+
assert_equal expected_results, results.to_h
|
|
210
|
+
assert_equal :sdk, root_span[:n]
|
|
211
|
+
assert_equal :'graphql.server', query_span[:n]
|
|
212
|
+
assert_equal expected_data, query_span[:data][:graphql]
|
|
213
|
+
end
|
|
214
|
+
|
|
86
215
|
def test_mutation
|
|
87
216
|
clear_all!
|
|
88
|
-
|
|
217
|
+
|
|
89
218
|
query = "mutation Sample {
|
|
90
219
|
createTask(action: \"Sample\") {
|
|
91
220
|
task {
|
|
@@ -93,7 +222,7 @@ class GraphqlTest < Minitest::Test
|
|
|
93
222
|
}
|
|
94
223
|
}
|
|
95
224
|
}"
|
|
96
|
-
|
|
225
|
+
|
|
97
226
|
expected_data = {
|
|
98
227
|
:operationName => "Sample",
|
|
99
228
|
:operationType => "mutation",
|
|
@@ -102,15 +231,15 @@ class GraphqlTest < Minitest::Test
|
|
|
102
231
|
}
|
|
103
232
|
expected_results = {
|
|
104
233
|
"data" => {
|
|
105
|
-
"createTask" => {
|
|
234
|
+
"createTask" => {
|
|
106
235
|
"task" => { "action" => "Sample" }
|
|
107
236
|
}
|
|
108
237
|
}
|
|
109
238
|
}
|
|
110
|
-
|
|
239
|
+
|
|
111
240
|
results = Instana.tracer.start_or_continue_trace('graphql-test') { Schema.execute(query) }
|
|
112
241
|
query_span, root_span = *Instana.processor.queued_spans
|
|
113
|
-
|
|
242
|
+
|
|
114
243
|
assert_equal expected_results, results.to_h
|
|
115
244
|
assert_equal :sdk, root_span[:n]
|
|
116
245
|
assert_equal :'graphql.server', query_span[:n]
|
|
@@ -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-
|
|
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
|