instana 1.203.0 → 1.203.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e4a3e85003438c1690ddc13b6e475bcb1765155bf71b90c2799b8037033a9ce3
4
- data.tar.gz: d6fcc234fa717a23048e674ba76a4b7ad78cf81bf1c105ff5dce226d95cc7b82
3
+ metadata.gz: 30b95f7d7a20b4c6e978178d9708495c307111d2659ddaf29c6638665c9c42ca
4
+ data.tar.gz: 5bc631b90006f67a4212ec8c829aed86c0570da5a971900a51437e451cbaa0ea
5
5
  SHA512:
6
- metadata.gz: a2d908c112040f6e833c23e6462e0b7c0696d72520767693b911aa6ddb0f8547a5c51518dd46826efddbb0747820014085ca9c3103dae61315821c99f5b49b34
7
- data.tar.gz: 47871736c4c8b3f2427e9647e2769209b952bec8534a78c0c9875d642549b44545d93d4ae213bde3c00566f7428a33955481473b489c7894fd7a47a87d6d9e42
6
+ metadata.gz: c8baf2c88198df4ff332d27d19d4273bf451099f52a97ab3b140b07bd54dd02a2edbf42a1751d81f4093beefd484dd8c38c01b53a84492ed7688a173504e69e6
7
+ data.tar.gz: fe458114c4e7062b327f2491b4d4b04889deab2c121a6810626887c45453f83343f497c2f86b895772a354b3755d2317a2c46c0474aec3400a1835efdf09b06f
@@ -67,7 +67,7 @@ module Instana
67
67
  @config[:graphql] = { :enabled => true }
68
68
  @config[:nethttp] = { :enabled => true }
69
69
  @config[:redis] = { :enabled => true }
70
- @config[:'resque-client'] = { :enabled => true }
70
+ @config[:'resque-client'] = { :enabled => true, :propagate => true }
71
71
  @config[:'resque-worker'] = { :enabled => true, :'setup-fork' => true }
72
72
  @config[:'rest-client'] = { :enabled => true }
73
73
  @config[:'sidekiq-client'] = { :enabled => true }
@@ -28,7 +28,7 @@ module Instana
28
28
  kvs = collect_kvs(:enqueue, klass, args)
29
29
 
30
30
  Instana.tracer.trace(:'resque-client', kvs) do
31
- args.push(::Instana.tracer.context.to_hash)
31
+ args.push(::Instana.tracer.context.to_hash) if ::Instana.config[:'resque-client'][:propagate]
32
32
  super(klass, *args)
33
33
  end
34
34
  else
@@ -42,7 +42,7 @@ module Instana
42
42
  kvs[:Queue] = queue.to_s if queue
43
43
 
44
44
  Instana.tracer.trace(:'resque-client', kvs) do
45
- args.push(::Instana.tracer.context.to_hash)
45
+ args.push(::Instana.tracer.context.to_hash) if ::Instana.config[:'resque-client'][:propagate]
46
46
  super(queue, klass, *args)
47
47
  end
48
48
  else
@@ -78,7 +78,7 @@ module Instana
78
78
  ::Instana.logger.debug { "#{__method__}:#{File.basename(__FILE__)}:#{__LINE__}: #{e.message}" } if Instana::Config[:verbose]
79
79
  end
80
80
 
81
- trace_context = if job.payload['args'][-1].is_a?(Hash) && job.payload['args'][-1].keys.include?('trace_id')
81
+ trace_context = if ::Instana.config[:'resque-client'][:propagate] && job.payload['args'][-1].is_a?(Hash) && job.payload['args'][-1].keys.include?('trace_id')
82
82
  context_from_wire = job.payload['args'].pop
83
83
  ::Instana::SpanContext.new(
84
84
  context_from_wire['trace_id'],
@@ -2,6 +2,6 @@
2
2
  # (c) Copyright Instana Inc. 2016
3
3
 
4
4
  module Instana
5
- VERSION = "1.203.0"
5
+ VERSION = "1.203.1"
6
6
  VERSION_FULL = "instana-#{VERSION}"
7
7
  end
@@ -112,6 +112,41 @@ class ResqueClientTest < Minitest::Test
112
112
  assert_equal "SET", redis2_span[:data][:redis][:command]
113
113
  end
114
114
 
115
+ def test_worker_job_no_propagate
116
+ ::Instana.config[:'resque-client'][:propagate] = false
117
+ ::Instana.tracer.start_or_continue_trace(:'resque-client_test') do
118
+ ::Resque.enqueue_to(:critical, FastJob)
119
+ end
120
+
121
+ resque_job = Resque.reserve('critical')
122
+ @worker.work_one_job(resque_job)
123
+
124
+ spans = ::Instana.processor.queued_spans
125
+ assert_equal 5, spans.length
126
+
127
+ client_span = spans[0]
128
+ resque_span = spans[4]
129
+ redis1_span = spans[3]
130
+ redis2_span = spans[2]
131
+
132
+ assert_equal :'resque-client', client_span[:n]
133
+
134
+ assert_equal :'resque-worker', resque_span[:n]
135
+ refute_equal client_span[:s], resque_span[:p]
136
+ assert_equal false, resque_span.key?(:error)
137
+ assert_equal false, resque_span.key?(:ec)
138
+ assert_equal "FastJob", resque_span[:data][:'resque-worker'][:job]
139
+ assert_equal "critical", resque_span[:data][:'resque-worker'][:queue]
140
+ assert_equal false, resque_span[:data][:'resque-worker'].key?(:error)
141
+
142
+ assert_equal :redis, redis1_span[:n]
143
+ assert_equal "SET", redis1_span[:data][:redis][:command]
144
+ assert_equal :redis, redis2_span[:n]
145
+ assert_equal "SET", redis2_span[:data][:redis][:command]
146
+ ensure
147
+ ::Instana.config[:'resque-client'][:propagate] = true
148
+ end
149
+
115
150
  def test_worker_error_job
116
151
  Resque::Job.create(:critical, ErrorJob)
117
152
  @worker.work(0)
@@ -7,7 +7,9 @@ require "net/http"
7
7
  class FastJob
8
8
  @queue = :critical
9
9
 
10
- def self.perform
10
+ def self.perform(*args)
11
+ raise 'Invalid Args' unless args.empty?
12
+
11
13
  if ENV.key?('REDIS_URL')
12
14
  redis = Redis.new(:url => ENV['REDIS_URL'])
13
15
  elsif ENV.key?('REDIS_URL')
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.203.0
4
+ version: 1.203.1
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-06-29 00:00:00.000000000 Z
11
+ date: 2021-07-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler