instana 1.193.5 → 1.195.3

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.
Files changed (40) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +20 -2
  3. data/Appraisals +17 -1
  4. data/docker-compose.yml +20 -0
  5. data/gemfiles/aws_30.gemfile +21 -0
  6. data/gemfiles/excon_021.gemfile +18 -0
  7. data/gemfiles/excon_079.gemfile +18 -0
  8. data/gemfiles/shoryuken_50.gemfile +19 -0
  9. data/lib/instana/activators/aws_sdk_dynamodb.rb +20 -0
  10. data/lib/instana/activators/aws_sdk_s3.rb +20 -0
  11. data/lib/instana/activators/aws_sdk_sns.rb +20 -0
  12. data/lib/instana/activators/aws_sdk_sqs.rb +20 -0
  13. data/lib/instana/activators/excon.rb +1 -1
  14. data/lib/instana/activators/shoryuken.rb +24 -0
  15. data/lib/instana/config.rb +3 -0
  16. data/lib/instana/instrumentation/aws_sdk_dynamodb.rb +48 -0
  17. data/lib/instana/instrumentation/aws_sdk_s3.rb +55 -0
  18. data/lib/instana/instrumentation/aws_sdk_sns.rb +29 -0
  19. data/lib/instana/instrumentation/aws_sdk_sqs.rb +98 -0
  20. data/lib/instana/instrumentation/excon.rb +10 -4
  21. data/lib/instana/instrumentation/instrumented_request.rb +64 -7
  22. data/lib/instana/instrumentation/net-http.rb +10 -3
  23. data/lib/instana/instrumentation/rack.rb +35 -15
  24. data/lib/instana/instrumentation/shoryuken.rb +44 -0
  25. data/lib/instana/instrumentation/sidekiq-client.rb +1 -1
  26. data/lib/instana/instrumentation/sidekiq-worker.rb +1 -1
  27. data/lib/instana/secrets.rb +2 -2
  28. data/lib/instana/tracer.rb +14 -11
  29. data/lib/instana/tracing/span.rb +9 -3
  30. data/lib/instana/tracing/span_context.rb +25 -1
  31. data/lib/instana/version.rb +1 -1
  32. data/test/instrumentation/aws_test.rb +161 -0
  33. data/test/instrumentation/excon_test.rb +1 -0
  34. data/test/instrumentation/net_http_test.rb +18 -0
  35. data/test/instrumentation/rack_instrumented_request_test.rb +50 -3
  36. data/test/instrumentation/rack_test.rb +141 -0
  37. data/test/instrumentation/shoryuken_test.rb +47 -0
  38. data/test/tracing/opentracing_test.rb +3 -3
  39. metadata +21 -3
  40. 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
@@ -304,7 +304,7 @@ class OpenTracerTest < Minitest::Test
304
304
  assert_equal second_span[:s], third_span[:p]
305
305
 
306
306
  # Every span should have baggage
307
- assert_equal(nil, entry_span.context.baggage)
307
+ assert_equal({}, entry_span.context.baggage)
308
308
  assert_equal({:my_bag=>1}, ac_span.context.baggage)
309
309
  assert_equal({:my_bag=>1}, av_span.context.baggage)
310
310
  end
@@ -331,9 +331,9 @@ class OpenTracerTest < Minitest::Test
331
331
  spans = ::Instana.processor.queued_spans
332
332
  assert_equal 3, spans.length
333
333
 
334
- assert_equal(nil, entry_span.context.baggage)
334
+ assert_equal({}, entry_span.context.baggage)
335
335
  assert_equal({:my_bag=>1}, ac_span.context.baggage)
336
- assert_equal(nil, av_span.context.baggage)
336
+ assert_equal({}, av_span.context.baggage)
337
337
  end
338
338
 
339
339
  def test_start_active_span
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.193.5
4
+ version: 1.195.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Giacomo Lombardo
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-02-12 00:00:00.000000000 Z
11
+ date: 2021-03-23 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,13 +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
173
  - extras/license_header.rb
174
174
  - gemfiles/.bundle/config
175
+ - gemfiles/aws_30.gemfile
175
176
  - gemfiles/cuba_30.gemfile
176
177
  - gemfiles/dalli_20.gemfile
177
178
  - gemfiles/excon_02.gemfile
179
+ - gemfiles/excon_021.gemfile
180
+ - gemfiles/excon_079.gemfile
178
181
  - gemfiles/graphql_10.gemfile
179
182
  - gemfiles/grpc_10.gemfile
180
183
  - gemfiles/net_http_01.gemfile
@@ -191,6 +194,7 @@ files:
191
194
  - gemfiles/rest_client_20.gemfile
192
195
  - gemfiles/roda_20.gemfile
193
196
  - gemfiles/roda_30.gemfile
197
+ - gemfiles/shoryuken_50.gemfile
194
198
  - gemfiles/sidekiq_42.gemfile
195
199
  - gemfiles/sidekiq_50.gemfile
196
200
  - gemfiles/sinatra_14.gemfile
@@ -202,6 +206,10 @@ files:
202
206
  - lib/instana/activators/action_controller_base.rb
203
207
  - lib/instana/activators/action_view.rb
204
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
205
213
  - lib/instana/activators/cuba.rb
206
214
  - lib/instana/activators/dalli.rb
207
215
  - lib/instana/activators/excon.rb
@@ -216,6 +224,7 @@ files:
216
224
  - lib/instana/activators/resque_worker.rb
217
225
  - lib/instana/activators/rest_client.rb
218
226
  - lib/instana/activators/roda.rb
227
+ - lib/instana/activators/shoryuken.rb
219
228
  - lib/instana/activators/sidekiq_client.rb
220
229
  - lib/instana/activators/sidekiq_worker.rb
221
230
  - lib/instana/activators/sinatra.rb
@@ -240,6 +249,10 @@ files:
240
249
  - lib/instana/instrumentation/action_controller.rb
241
250
  - lib/instana/instrumentation/action_view.rb
242
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
243
256
  - lib/instana/instrumentation/dalli.rb
244
257
  - lib/instana/instrumentation/excon.rb
245
258
  - lib/instana/instrumentation/graphql.rb
@@ -250,6 +263,7 @@ files:
250
263
  - lib/instana/instrumentation/redis.rb
251
264
  - lib/instana/instrumentation/resque.rb
252
265
  - lib/instana/instrumentation/rest-client.rb
266
+ - lib/instana/instrumentation/shoryuken.rb
253
267
  - lib/instana/instrumentation/sidekiq-client.rb
254
268
  - lib/instana/instrumentation/sidekiq-worker.rb
255
269
  - lib/instana/opentracing/carrier.rb
@@ -276,6 +290,7 @@ files:
276
290
  - test/frameworks/roda_test.rb
277
291
  - test/frameworks/sinatra_test.rb
278
292
  - test/instana_test.rb
293
+ - test/instrumentation/aws_test.rb
279
294
  - test/instrumentation/dalli_test.rb
280
295
  - test/instrumentation/excon_test.rb
281
296
  - test/instrumentation/graphql_test.rb
@@ -290,6 +305,7 @@ files:
290
305
  - test/instrumentation/redis_test.rb
291
306
  - test/instrumentation/resque_test.rb
292
307
  - test/instrumentation/rest_client_test.rb
308
+ - test/instrumentation/shoryuken_test.rb
293
309
  - test/instrumentation/sidekiq-client_test.rb
294
310
  - test/instrumentation/sidekiq-worker_test.rb
295
311
  - test/secrets_test.rb
@@ -361,12 +377,14 @@ test_files:
361
377
  - test/instrumentation/rails_action_view_test.rb
362
378
  - test/instrumentation/rack_test.rb
363
379
  - test/instrumentation/rack_instrumented_request_test.rb
380
+ - test/instrumentation/shoryuken_test.rb
364
381
  - test/instrumentation/rails_active_record_test.rb
365
382
  - test/instrumentation/redis_test.rb
366
383
  - test/instrumentation/dalli_test.rb
367
384
  - test/instrumentation/rails_action_cable_test.rb
368
385
  - test/instrumentation/excon_test.rb
369
386
  - test/instrumentation/grpc_test.rb
387
+ - test/instrumentation/aws_test.rb
370
388
  - test/support/helpers.rb
371
389
  - test/support/apps/sidekiq/boot.rb
372
390
  - test/support/apps/sidekiq/jobs/sidekiq_job_2.rb
data/Dockerfile DELETED
@@ -1,16 +0,0 @@
1
- # For development/testing, you can run this instrumentation
2
- # interactively in a Docker container:
3
- # docker build -t instana/ruby-sensor:1.0
4
- #
5
- # To mount the host ruby-sensor directory in the container:
6
- # docker run -v /host/path/to/ruby-sensor:/ruby-sensor instana/ruby-sensor:1.0 /bin/bash
7
- #
8
- # Once inside the container, you can run `cd /ruby-sensor && bundle install && bundle exec rake console` for a development
9
- # console in the gem.
10
- #
11
- # https://github.com/instana/ruby-sensor#development
12
- #
13
- FROM ruby:2.6
14
- ENV INSTANA_DEBUG=true
15
- RUN gem install bundler
16
- RUN apt update && apt install -y vim