instana 1.193.4 → 1.195.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +20 -2
- data/.rubocop.yml +7 -0
- data/Appraisals +20 -1
- data/Gemfile +3 -0
- data/LICENSE +2 -1
- data/Rakefile +3 -0
- data/benchmarks/10k-rack-traces.rb +3 -0
- data/benchmarks/Gemfile +4 -0
- data/benchmarks/id_generation.rb +4 -0
- data/benchmarks/opentracing.rb +4 -0
- data/benchmarks/rack_vanilla_vs_traced.rb +3 -0
- data/benchmarks/stackprof_rack_tracing.rb +3 -0
- data/benchmarks/time_processing.rb +4 -0
- data/bin/console +3 -0
- data/docker-compose.yml +20 -0
- data/examples/opentracing.rb +4 -0
- data/examples/tracing.rb +4 -0
- data/extras/license_header.rb +44 -0
- data/gemfiles/aws_30.gemfile +21 -0
- data/gemfiles/cuba_30.gemfile +3 -0
- data/gemfiles/dalli_20.gemfile +3 -0
- data/gemfiles/excon_02.gemfile +3 -0
- data/gemfiles/excon_021.gemfile +18 -0
- data/gemfiles/excon_079.gemfile +18 -0
- data/gemfiles/graphql_10.gemfile +3 -0
- data/gemfiles/grpc_10.gemfile +3 -0
- data/gemfiles/net_http_01.gemfile +3 -0
- data/gemfiles/rack_16.gemfile +3 -0
- data/gemfiles/rack_20.gemfile +3 -0
- data/gemfiles/rails_42.gemfile +3 -0
- data/gemfiles/rails_50.gemfile +3 -0
- data/gemfiles/rails_52.gemfile +3 -0
- data/gemfiles/rails_60.gemfile +3 -0
- data/gemfiles/redis_40.gemfile +3 -0
- data/gemfiles/resque_122.gemfile +3 -0
- data/gemfiles/resque_20.gemfile +3 -0
- data/gemfiles/rest_client_16.gemfile +3 -0
- data/gemfiles/rest_client_20.gemfile +3 -0
- data/gemfiles/roda_20.gemfile +3 -0
- data/gemfiles/roda_30.gemfile +3 -0
- data/gemfiles/shoryuken_50.gemfile +19 -0
- data/gemfiles/sidekiq_42.gemfile +3 -0
- data/gemfiles/sidekiq_50.gemfile +3 -0
- data/gemfiles/sinatra_14.gemfile +3 -0
- data/instana.gemspec +4 -0
- data/lib/instana.rb +3 -0
- data/lib/instana/activator.rb +3 -0
- data/lib/instana/activators/action_cable.rb +24 -0
- data/lib/instana/activators/action_controller_api.rb +3 -0
- data/lib/instana/activators/action_controller_base.rb +3 -0
- data/lib/instana/activators/action_view.rb +3 -0
- data/lib/instana/activators/active_record.rb +3 -0
- data/lib/instana/activators/aws_sdk_dynamodb.rb +20 -0
- data/lib/instana/activators/aws_sdk_s3.rb +20 -0
- data/lib/instana/activators/aws_sdk_sns.rb +20 -0
- data/lib/instana/activators/aws_sdk_sqs.rb +20 -0
- data/lib/instana/activators/cuba.rb +3 -0
- data/lib/instana/activators/dalli.rb +3 -0
- data/lib/instana/activators/excon.rb +4 -1
- data/lib/instana/activators/graphql.rb +3 -0
- data/lib/instana/activators/grpc_client.rb +3 -0
- data/lib/instana/activators/grpc_server.rb +3 -0
- data/lib/instana/activators/net_http.rb +3 -0
- data/lib/instana/activators/rack.rb +3 -0
- data/lib/instana/activators/rails.rb +3 -0
- data/lib/instana/activators/redis.rb +3 -0
- data/lib/instana/activators/resque_client.rb +3 -0
- data/lib/instana/activators/resque_worker.rb +3 -0
- data/lib/instana/activators/rest_client.rb +3 -0
- data/lib/instana/activators/roda.rb +3 -0
- data/lib/instana/activators/shoryuken.rb +24 -0
- data/lib/instana/activators/sidekiq_client.rb +3 -0
- data/lib/instana/activators/sidekiq_worker.rb +3 -0
- data/lib/instana/activators/sinatra.rb +3 -0
- data/lib/instana/agent.rb +3 -0
- data/lib/instana/agent/helpers.rb +3 -0
- data/lib/instana/agent/hooks.rb +3 -0
- data/lib/instana/agent/tasks.rb +3 -0
- data/lib/instana/base.rb +3 -0
- data/lib/instana/collector.rb +3 -0
- data/lib/instana/collectors/gc.rb +3 -0
- data/lib/instana/collectors/memory.rb +3 -0
- data/lib/instana/collectors/thread.rb +3 -0
- data/lib/instana/config.rb +6 -0
- data/lib/instana/frameworks/cuba.rb +3 -0
- data/lib/instana/frameworks/rails.rb +3 -0
- data/lib/instana/frameworks/roda.rb +3 -0
- data/lib/instana/frameworks/sinatra.rb +3 -0
- data/lib/instana/helpers.rb +3 -0
- data/lib/instana/instrumentation/action_cable.rb +53 -0
- data/lib/instana/instrumentation/action_controller.rb +3 -0
- data/lib/instana/instrumentation/action_view.rb +3 -0
- data/lib/instana/instrumentation/active_record.rb +3 -0
- data/lib/instana/instrumentation/aws_sdk_dynamodb.rb +48 -0
- data/lib/instana/instrumentation/aws_sdk_s3.rb +55 -0
- data/lib/instana/instrumentation/aws_sdk_sns.rb +29 -0
- data/lib/instana/instrumentation/aws_sdk_sqs.rb +98 -0
- data/lib/instana/instrumentation/dalli.rb +3 -0
- data/lib/instana/instrumentation/excon.rb +13 -4
- data/lib/instana/instrumentation/graphql.rb +3 -0
- data/lib/instana/instrumentation/grpc.rb +3 -0
- data/lib/instana/instrumentation/instrumented_request.rb +68 -7
- data/lib/instana/instrumentation/net-http.rb +13 -3
- data/lib/instana/instrumentation/rack.rb +38 -15
- data/lib/instana/instrumentation/redis.rb +3 -0
- data/lib/instana/instrumentation/resque.rb +3 -0
- data/lib/instana/instrumentation/rest-client.rb +3 -0
- data/lib/instana/instrumentation/shoryuken.rb +44 -0
- data/lib/instana/instrumentation/sidekiq-client.rb +4 -1
- data/lib/instana/instrumentation/sidekiq-worker.rb +4 -1
- data/lib/instana/opentracing/carrier.rb +3 -0
- data/lib/instana/opentracing/tracer.rb +3 -0
- data/lib/instana/rack.rb +4 -0
- data/lib/instana/secrets.rb +5 -2
- data/lib/instana/setup.rb +3 -0
- data/lib/instana/thread_local.rb +3 -0
- data/lib/instana/tracer.rb +17 -11
- data/lib/instana/tracing/processor.rb +3 -0
- data/lib/instana/tracing/span.rb +12 -3
- data/lib/instana/tracing/span_context.rb +28 -1
- data/lib/instana/util.rb +3 -0
- data/lib/instana/version.rb +4 -1
- data/lib/oj_check.rb +3 -0
- data/lib/opentracing.rb +3 -0
- data/test/activator_test.rb +3 -0
- data/test/agent/agent_test.rb +3 -0
- data/test/benchmarks/bench_id_generation.rb +3 -0
- data/test/benchmarks/bench_opentracing.rb +3 -0
- data/test/config_test.rb +3 -0
- data/test/frameworks/cuba_test.rb +3 -0
- data/test/frameworks/roda_test.rb +4 -0
- data/test/frameworks/sinatra_test.rb +3 -0
- data/test/instana_test.rb +3 -0
- data/test/instrumentation/aws_test.rb +161 -0
- data/test/instrumentation/dalli_test.rb +3 -0
- data/test/instrumentation/excon_test.rb +4 -0
- data/test/instrumentation/graphql_test.rb +3 -0
- data/test/instrumentation/grpc_test.rb +3 -0
- data/test/instrumentation/net_http_test.rb +21 -0
- data/test/instrumentation/rack_instrumented_request_test.rb +53 -3
- data/test/instrumentation/rack_test.rb +144 -0
- data/test/instrumentation/rails_action_cable_test.rb +131 -0
- data/test/instrumentation/rails_action_controller_test.rb +3 -0
- data/test/instrumentation/rails_action_view_test.rb +3 -0
- data/test/instrumentation/rails_active_record_test.rb +3 -2
- data/test/instrumentation/redis_test.rb +3 -0
- data/test/instrumentation/resque_test.rb +3 -0
- data/test/instrumentation/rest_client_test.rb +3 -0
- data/test/instrumentation/shoryuken_test.rb +47 -0
- data/test/instrumentation/sidekiq-client_test.rb +3 -0
- data/test/instrumentation/sidekiq-worker_test.rb +3 -0
- data/test/secrets_test.rb +3 -0
- data/test/support/apps/active_record/active_record.rb +3 -0
- data/test/support/apps/grpc/boot.rb +3 -0
- data/test/support/apps/grpc/grpc_server.rb +3 -0
- data/test/support/apps/http_endpoint/boot.rb +3 -0
- data/test/support/apps/rails/boot.rb +3 -0
- data/test/support/apps/rails/models/block.rb +3 -0
- data/test/support/apps/rails/models/block6.rb +3 -0
- data/test/support/apps/resque/boot.rb +3 -0
- data/test/support/apps/resque/jobs/resque_error_job.rb +3 -0
- data/test/support/apps/resque/jobs/resque_fast_job.rb +3 -0
- data/test/support/apps/sidekiq/boot.rb +4 -0
- data/test/support/apps/sidekiq/jobs/sidekiq_job_1.rb +3 -0
- data/test/support/apps/sidekiq/jobs/sidekiq_job_2.rb +3 -0
- data/test/support/apps/sidekiq/worker.rb +3 -0
- data/test/support/helpers.rb +3 -0
- data/test/test_helper.rb +3 -0
- data/test/tracing/custom_test.rb +3 -0
- data/test/tracing/id_management_test.rb +4 -0
- data/test/tracing/opentracing_test.rb +6 -3
- data/test/tracing/tracer_async_test.rb +3 -0
- data/test/tracing/tracer_test.rb +3 -0
- metadata +26 -3
- data/Dockerfile +0 -16
@@ -0,0 +1,47 @@
|
|
1
|
+
# (c) Copyright IBM Corp. 2021
|
2
|
+
# (c) Copyright Instana Inc. 2021
|
3
|
+
|
4
|
+
require 'test_helper'
|
5
|
+
require 'ostruct'
|
6
|
+
|
7
|
+
class ShoryukenTest < Minitest::Test
|
8
|
+
def setup
|
9
|
+
clear_all!
|
10
|
+
@middleware = Instana::Instrumentation::Shoryuken.new
|
11
|
+
end
|
12
|
+
|
13
|
+
def test_start_trace_with_context
|
14
|
+
id = Instana::Util.generate_id
|
15
|
+
message = OpenStruct.new(
|
16
|
+
queue_url: 'http://example.com',
|
17
|
+
message_attributes: {
|
18
|
+
"X_INSTANA_T" => OpenStruct.new(string_value: id),
|
19
|
+
"X_INSTANA_S" => OpenStruct.new(string_value: id),
|
20
|
+
"X_INSTANA_L" => OpenStruct.new(string_value: '1')
|
21
|
+
}
|
22
|
+
)
|
23
|
+
|
24
|
+
@middleware.call(nil, nil, message, nil) {}
|
25
|
+
|
26
|
+
span = ::Instana.processor.queued_spans.first
|
27
|
+
|
28
|
+
assert_equal id, span[:t]
|
29
|
+
assert_equal id, span[:p]
|
30
|
+
assert_equal 'entry', span[:data][:sqs][:sort]
|
31
|
+
assert_equal 'http://example.com', span[:data][:sqs][:queue]
|
32
|
+
end
|
33
|
+
|
34
|
+
def test_start_trace
|
35
|
+
message = OpenStruct.new(
|
36
|
+
queue_url: 'http://example.com'
|
37
|
+
)
|
38
|
+
|
39
|
+
@middleware.call(nil, nil, message, nil) {}
|
40
|
+
|
41
|
+
span = ::Instana.processor.queued_spans.first
|
42
|
+
|
43
|
+
assert_nil span[:p]
|
44
|
+
assert_equal 'entry', span[:data][:sqs][:sort]
|
45
|
+
assert_equal 'http://example.com', span[:data][:sqs][:queue]
|
46
|
+
end
|
47
|
+
end
|
data/test/secrets_test.rb
CHANGED
data/test/support/helpers.rb
CHANGED
data/test/test_helper.rb
CHANGED
data/test/tracing/custom_test.rb
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
# (c) Copyright IBM Corp. 2021
|
2
|
+
# (c) Copyright Instana Inc. 2017
|
3
|
+
|
1
4
|
require 'test_helper'
|
2
5
|
require 'rack/test'
|
3
6
|
require 'rack/lobster'
|
@@ -301,7 +304,7 @@ class OpenTracerTest < Minitest::Test
|
|
301
304
|
assert_equal second_span[:s], third_span[:p]
|
302
305
|
|
303
306
|
# Every span should have baggage
|
304
|
-
assert_equal(
|
307
|
+
assert_equal({}, entry_span.context.baggage)
|
305
308
|
assert_equal({:my_bag=>1}, ac_span.context.baggage)
|
306
309
|
assert_equal({:my_bag=>1}, av_span.context.baggage)
|
307
310
|
end
|
@@ -328,9 +331,9 @@ class OpenTracerTest < Minitest::Test
|
|
328
331
|
spans = ::Instana.processor.queued_spans
|
329
332
|
assert_equal 3, spans.length
|
330
333
|
|
331
|
-
assert_equal(
|
334
|
+
assert_equal({}, entry_span.context.baggage)
|
332
335
|
assert_equal({:my_bag=>1}, ac_span.context.baggage)
|
333
|
-
assert_equal(
|
336
|
+
assert_equal({}, av_span.context.baggage)
|
334
337
|
end
|
335
338
|
|
336
339
|
def test_start_active_span
|
data/test/tracing/tracer_test.rb
CHANGED
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.195.2
|
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: 2021-
|
11
|
+
date: 2021-03-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -153,7 +153,6 @@ files:
|
|
153
153
|
- ".rubocop.yml"
|
154
154
|
- ".rubocop_todo.yml"
|
155
155
|
- Appraisals
|
156
|
-
- Dockerfile
|
157
156
|
- Gemfile
|
158
157
|
- LICENSE
|
159
158
|
- README.md
|
@@ -168,12 +167,17 @@ files:
|
|
168
167
|
- benchmarks/time_processing.rb
|
169
168
|
- bin/console
|
170
169
|
- bin/setup
|
170
|
+
- docker-compose.yml
|
171
171
|
- examples/opentracing.rb
|
172
172
|
- examples/tracing.rb
|
173
|
+
- extras/license_header.rb
|
173
174
|
- gemfiles/.bundle/config
|
175
|
+
- gemfiles/aws_30.gemfile
|
174
176
|
- gemfiles/cuba_30.gemfile
|
175
177
|
- gemfiles/dalli_20.gemfile
|
176
178
|
- gemfiles/excon_02.gemfile
|
179
|
+
- gemfiles/excon_021.gemfile
|
180
|
+
- gemfiles/excon_079.gemfile
|
177
181
|
- gemfiles/graphql_10.gemfile
|
178
182
|
- gemfiles/grpc_10.gemfile
|
179
183
|
- gemfiles/net_http_01.gemfile
|
@@ -190,16 +194,22 @@ files:
|
|
190
194
|
- gemfiles/rest_client_20.gemfile
|
191
195
|
- gemfiles/roda_20.gemfile
|
192
196
|
- gemfiles/roda_30.gemfile
|
197
|
+
- gemfiles/shoryuken_50.gemfile
|
193
198
|
- gemfiles/sidekiq_42.gemfile
|
194
199
|
- gemfiles/sidekiq_50.gemfile
|
195
200
|
- gemfiles/sinatra_14.gemfile
|
196
201
|
- instana.gemspec
|
197
202
|
- lib/instana.rb
|
198
203
|
- lib/instana/activator.rb
|
204
|
+
- lib/instana/activators/action_cable.rb
|
199
205
|
- lib/instana/activators/action_controller_api.rb
|
200
206
|
- lib/instana/activators/action_controller_base.rb
|
201
207
|
- lib/instana/activators/action_view.rb
|
202
208
|
- lib/instana/activators/active_record.rb
|
209
|
+
- lib/instana/activators/aws_sdk_dynamodb.rb
|
210
|
+
- lib/instana/activators/aws_sdk_s3.rb
|
211
|
+
- lib/instana/activators/aws_sdk_sns.rb
|
212
|
+
- lib/instana/activators/aws_sdk_sqs.rb
|
203
213
|
- lib/instana/activators/cuba.rb
|
204
214
|
- lib/instana/activators/dalli.rb
|
205
215
|
- lib/instana/activators/excon.rb
|
@@ -214,6 +224,7 @@ files:
|
|
214
224
|
- lib/instana/activators/resque_worker.rb
|
215
225
|
- lib/instana/activators/rest_client.rb
|
216
226
|
- lib/instana/activators/roda.rb
|
227
|
+
- lib/instana/activators/shoryuken.rb
|
217
228
|
- lib/instana/activators/sidekiq_client.rb
|
218
229
|
- lib/instana/activators/sidekiq_worker.rb
|
219
230
|
- lib/instana/activators/sinatra.rb
|
@@ -234,9 +245,14 @@ files:
|
|
234
245
|
- lib/instana/frameworks/roda.rb
|
235
246
|
- lib/instana/frameworks/sinatra.rb
|
236
247
|
- lib/instana/helpers.rb
|
248
|
+
- lib/instana/instrumentation/action_cable.rb
|
237
249
|
- lib/instana/instrumentation/action_controller.rb
|
238
250
|
- lib/instana/instrumentation/action_view.rb
|
239
251
|
- lib/instana/instrumentation/active_record.rb
|
252
|
+
- lib/instana/instrumentation/aws_sdk_dynamodb.rb
|
253
|
+
- lib/instana/instrumentation/aws_sdk_s3.rb
|
254
|
+
- lib/instana/instrumentation/aws_sdk_sns.rb
|
255
|
+
- lib/instana/instrumentation/aws_sdk_sqs.rb
|
240
256
|
- lib/instana/instrumentation/dalli.rb
|
241
257
|
- lib/instana/instrumentation/excon.rb
|
242
258
|
- lib/instana/instrumentation/graphql.rb
|
@@ -247,6 +263,7 @@ files:
|
|
247
263
|
- lib/instana/instrumentation/redis.rb
|
248
264
|
- lib/instana/instrumentation/resque.rb
|
249
265
|
- lib/instana/instrumentation/rest-client.rb
|
266
|
+
- lib/instana/instrumentation/shoryuken.rb
|
250
267
|
- lib/instana/instrumentation/sidekiq-client.rb
|
251
268
|
- lib/instana/instrumentation/sidekiq-worker.rb
|
252
269
|
- lib/instana/opentracing/carrier.rb
|
@@ -273,6 +290,7 @@ files:
|
|
273
290
|
- test/frameworks/roda_test.rb
|
274
291
|
- test/frameworks/sinatra_test.rb
|
275
292
|
- test/instana_test.rb
|
293
|
+
- test/instrumentation/aws_test.rb
|
276
294
|
- test/instrumentation/dalli_test.rb
|
277
295
|
- test/instrumentation/excon_test.rb
|
278
296
|
- test/instrumentation/graphql_test.rb
|
@@ -280,12 +298,14 @@ files:
|
|
280
298
|
- test/instrumentation/net_http_test.rb
|
281
299
|
- test/instrumentation/rack_instrumented_request_test.rb
|
282
300
|
- test/instrumentation/rack_test.rb
|
301
|
+
- test/instrumentation/rails_action_cable_test.rb
|
283
302
|
- test/instrumentation/rails_action_controller_test.rb
|
284
303
|
- test/instrumentation/rails_action_view_test.rb
|
285
304
|
- test/instrumentation/rails_active_record_test.rb
|
286
305
|
- test/instrumentation/redis_test.rb
|
287
306
|
- test/instrumentation/resque_test.rb
|
288
307
|
- test/instrumentation/rest_client_test.rb
|
308
|
+
- test/instrumentation/shoryuken_test.rb
|
289
309
|
- test/instrumentation/sidekiq-client_test.rb
|
290
310
|
- test/instrumentation/sidekiq-worker_test.rb
|
291
311
|
- test/secrets_test.rb
|
@@ -357,11 +377,14 @@ test_files:
|
|
357
377
|
- test/instrumentation/rails_action_view_test.rb
|
358
378
|
- test/instrumentation/rack_test.rb
|
359
379
|
- test/instrumentation/rack_instrumented_request_test.rb
|
380
|
+
- test/instrumentation/shoryuken_test.rb
|
360
381
|
- test/instrumentation/rails_active_record_test.rb
|
361
382
|
- test/instrumentation/redis_test.rb
|
362
383
|
- test/instrumentation/dalli_test.rb
|
384
|
+
- test/instrumentation/rails_action_cable_test.rb
|
363
385
|
- test/instrumentation/excon_test.rb
|
364
386
|
- test/instrumentation/grpc_test.rb
|
387
|
+
- test/instrumentation/aws_test.rb
|
365
388
|
- test/support/helpers.rb
|
366
389
|
- test/support/apps/sidekiq/boot.rb
|
367
390
|
- test/support/apps/sidekiq/jobs/sidekiq_job_2.rb
|