instana 1.193.6 → 1.195.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +16 -2
  3. data/Appraisals +13 -1
  4. data/docker-compose.yml +20 -0
  5. data/gemfiles/aws_30.gemfile +3 -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_s3.rb +20 -0
  10. data/lib/instana/activators/aws_sdk_sns.rb +20 -0
  11. data/lib/instana/activators/aws_sdk_sqs.rb +20 -0
  12. data/lib/instana/activators/excon.rb +1 -1
  13. data/lib/instana/activators/shoryuken.rb +24 -0
  14. data/lib/instana/config.rb +3 -0
  15. data/lib/instana/instrumentation/aws_sdk_dynamodb.rb +21 -2
  16. data/lib/instana/instrumentation/aws_sdk_s3.rb +55 -0
  17. data/lib/instana/instrumentation/aws_sdk_sns.rb +29 -0
  18. data/lib/instana/instrumentation/aws_sdk_sqs.rb +98 -0
  19. data/lib/instana/instrumentation/excon.rb +17 -4
  20. data/lib/instana/instrumentation/instrumented_request.rb +64 -7
  21. data/lib/instana/instrumentation/net-http.rb +9 -2
  22. data/lib/instana/instrumentation/rack.rb +35 -15
  23. data/lib/instana/instrumentation/shoryuken.rb +44 -0
  24. data/lib/instana/secrets.rb +2 -2
  25. data/lib/instana/tracer.rb +14 -11
  26. data/lib/instana/tracing/span.rb +3 -3
  27. data/lib/instana/tracing/span_context.rb +25 -1
  28. data/lib/instana/version.rb +1 -1
  29. data/test/instrumentation/aws_test.rb +130 -2
  30. data/test/instrumentation/excon_test.rb +16 -1
  31. data/test/instrumentation/net_http_test.rb +18 -0
  32. data/test/instrumentation/rack_instrumented_request_test.rb +50 -3
  33. data/test/instrumentation/rack_test.rb +141 -0
  34. data/test/instrumentation/shoryuken_test.rb +47 -0
  35. data/test/tracing/opentracing_test.rb +3 -3
  36. metadata +16 -3
  37. 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.6
4
+ version: 1.195.4
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-19 00:00:00.000000000 Z
11
+ date: 2021-03-24 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,6 +167,7 @@ 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
@@ -176,6 +176,8 @@ files:
176
176
  - gemfiles/cuba_30.gemfile
177
177
  - gemfiles/dalli_20.gemfile
178
178
  - gemfiles/excon_02.gemfile
179
+ - gemfiles/excon_021.gemfile
180
+ - gemfiles/excon_079.gemfile
179
181
  - gemfiles/graphql_10.gemfile
180
182
  - gemfiles/grpc_10.gemfile
181
183
  - gemfiles/net_http_01.gemfile
@@ -192,6 +194,7 @@ files:
192
194
  - gemfiles/rest_client_20.gemfile
193
195
  - gemfiles/roda_20.gemfile
194
196
  - gemfiles/roda_30.gemfile
197
+ - gemfiles/shoryuken_50.gemfile
195
198
  - gemfiles/sidekiq_42.gemfile
196
199
  - gemfiles/sidekiq_50.gemfile
197
200
  - gemfiles/sinatra_14.gemfile
@@ -204,6 +207,9 @@ files:
204
207
  - lib/instana/activators/action_view.rb
205
208
  - lib/instana/activators/active_record.rb
206
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
207
213
  - lib/instana/activators/cuba.rb
208
214
  - lib/instana/activators/dalli.rb
209
215
  - lib/instana/activators/excon.rb
@@ -218,6 +224,7 @@ files:
218
224
  - lib/instana/activators/resque_worker.rb
219
225
  - lib/instana/activators/rest_client.rb
220
226
  - lib/instana/activators/roda.rb
227
+ - lib/instana/activators/shoryuken.rb
221
228
  - lib/instana/activators/sidekiq_client.rb
222
229
  - lib/instana/activators/sidekiq_worker.rb
223
230
  - lib/instana/activators/sinatra.rb
@@ -243,6 +250,9 @@ files:
243
250
  - lib/instana/instrumentation/action_view.rb
244
251
  - lib/instana/instrumentation/active_record.rb
245
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
246
256
  - lib/instana/instrumentation/dalli.rb
247
257
  - lib/instana/instrumentation/excon.rb
248
258
  - lib/instana/instrumentation/graphql.rb
@@ -253,6 +263,7 @@ files:
253
263
  - lib/instana/instrumentation/redis.rb
254
264
  - lib/instana/instrumentation/resque.rb
255
265
  - lib/instana/instrumentation/rest-client.rb
266
+ - lib/instana/instrumentation/shoryuken.rb
256
267
  - lib/instana/instrumentation/sidekiq-client.rb
257
268
  - lib/instana/instrumentation/sidekiq-worker.rb
258
269
  - lib/instana/opentracing/carrier.rb
@@ -294,6 +305,7 @@ files:
294
305
  - test/instrumentation/redis_test.rb
295
306
  - test/instrumentation/resque_test.rb
296
307
  - test/instrumentation/rest_client_test.rb
308
+ - test/instrumentation/shoryuken_test.rb
297
309
  - test/instrumentation/sidekiq-client_test.rb
298
310
  - test/instrumentation/sidekiq-worker_test.rb
299
311
  - test/secrets_test.rb
@@ -365,6 +377,7 @@ test_files:
365
377
  - test/instrumentation/rails_action_view_test.rb
366
378
  - test/instrumentation/rack_test.rb
367
379
  - test/instrumentation/rack_instrumented_request_test.rb
380
+ - test/instrumentation/shoryuken_test.rb
368
381
  - test/instrumentation/rails_active_record_test.rb
369
382
  - test/instrumentation/redis_test.rb
370
383
  - test/instrumentation/dalli_test.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