instana 1.203.0 → 1.204.0.pre3
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/lib/instana/activators/action_mailer.rb +1 -1
- data/lib/instana/config.rb +1 -1
- data/lib/instana/instrumentation/resque.rb +3 -3
- data/lib/instana/secrets.rb +1 -1
- data/lib/instana/tracing/processor.rb +1 -0
- data/lib/instana/tracing/span.rb +10 -28
- data/lib/instana/version.rb +1 -1
- data/test/instrumentation/net_http_test.rb +18 -0
- data/test/instrumentation/resque_test.rb +35 -0
- data/test/secrets_test.rb +9 -0
- data/test/support/apps/resque/jobs/resque_fast_job.rb +3 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d6c2235234526a14bbb8818b104e9417f4683179b2166cb222fe136af32794d4
|
4
|
+
data.tar.gz: 16a190359fa7208ceeaf7170db5cfc732bcb464837f6acde9eb1c5be08b09eba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d1465d42aeee46d0db43c2563b6bea541efddb553bb30fec875cc1cc2b5de30303476258ad889ccc9c6b10c4e1164f12001c743c16de0dafebce8e0020fd850b
|
7
|
+
data.tar.gz: b87b819750e3901f524609b89c2c8a96ac54965d8c6db2f4100a9cc2586cfafd55be20b30516364fdbec1199da7db8c987b6fb8f4edfc82761624caf5ea5d94b
|
data/lib/instana/config.rb
CHANGED
@@ -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'],
|
data/lib/instana/secrets.rb
CHANGED
data/lib/instana/tracing/span.rb
CHANGED
@@ -80,34 +80,16 @@ module Instana
|
|
80
80
|
# @param limit [Integer] Limit the backtrace to the top <limit> frames
|
81
81
|
#
|
82
82
|
def add_stack(limit: 30, stack: Kernel.caller)
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
x = i.split(':')
|
95
|
-
|
96
|
-
sanitized_stack << {
|
97
|
-
:c => x[0],
|
98
|
-
:n => x[1],
|
99
|
-
:m => x[2]
|
100
|
-
}
|
101
|
-
end
|
102
|
-
end
|
103
|
-
|
104
|
-
if sanitized_stack.length > limit
|
105
|
-
# (limit * -1) gives us negative form of <limit> used for
|
106
|
-
# slicing from the end of the list. e.g. stack[-30, 30]
|
107
|
-
@data[:stack] = sanitized_stack[limit*-1, limit]
|
108
|
-
else
|
109
|
-
@data[:stack] = sanitized_stack
|
110
|
-
end
|
83
|
+
@data[:stack] = stack
|
84
|
+
.map do |call|
|
85
|
+
file, line, *method = call.split(':')
|
86
|
+
|
87
|
+
{
|
88
|
+
c: file,
|
89
|
+
n: line,
|
90
|
+
m: method.join(' ')
|
91
|
+
}
|
92
|
+
end.take(limit > 40 ? 40 : limit)
|
111
93
|
end
|
112
94
|
|
113
95
|
# Log an error into the span
|
data/lib/instana/version.rb
CHANGED
@@ -29,6 +29,24 @@ class NetHTTPTest < Minitest::Test
|
|
29
29
|
WebMock.disable_net_connect!
|
30
30
|
end
|
31
31
|
|
32
|
+
def test_get_without_query
|
33
|
+
clear_all!
|
34
|
+
WebMock.allow_net_connect!
|
35
|
+
|
36
|
+
Instana.tracer.start_or_continue_trace(:"net-http-test") do
|
37
|
+
Net::HTTP.get(URI('http://127.0.0.1:6511/'))
|
38
|
+
end
|
39
|
+
|
40
|
+
spans = ::Instana.processor.queued_spans
|
41
|
+
assert_equal 3, spans.length
|
42
|
+
|
43
|
+
http_span = find_first_span_by_name(spans, :'net-http')
|
44
|
+
assert_equal "http://127.0.0.1:6511/", http_span[:data][:http][:url]
|
45
|
+
assert_equal "200", http_span[:data][:http][:status]
|
46
|
+
|
47
|
+
WebMock.disable_net_connect!
|
48
|
+
end
|
49
|
+
|
32
50
|
def test_block_request
|
33
51
|
clear_all!
|
34
52
|
WebMock.allow_net_connect!
|
@@ -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)
|
data/test/secrets_test.rb
CHANGED
@@ -88,6 +88,15 @@ class SecretsTest < Minitest::Test
|
|
88
88
|
assert_redacted @subject.remove_from_query(url, sample_config), %w(filter[instantiate]), raw_str: true
|
89
89
|
end
|
90
90
|
|
91
|
+
def test_with_nil
|
92
|
+
sample_config = {
|
93
|
+
"matcher"=>"contains",
|
94
|
+
"list"=>["stan"]
|
95
|
+
}
|
96
|
+
|
97
|
+
assert_equal @subject.remove_from_query(nil, sample_config), nil
|
98
|
+
end
|
99
|
+
|
91
100
|
private
|
92
101
|
|
93
102
|
def url_for(keys)
|
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.204.0.pre3
|
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-07-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -370,9 +370,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
370
370
|
version: '2.1'
|
371
371
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
372
372
|
requirements:
|
373
|
-
- - "
|
373
|
+
- - ">"
|
374
374
|
- !ruby/object:Gem::Version
|
375
|
-
version:
|
375
|
+
version: 1.3.1
|
376
376
|
requirements: []
|
377
377
|
rubygems_version: 3.1.6
|
378
378
|
signing_key:
|