instana 1.11.7 → 1.11.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/instana/tracing/span.rb +9 -0
- data/lib/instana/version.rb +1 -1
- data/test/tracing/tracer_test.rb +31 -1
- metadata +1 -3
- data/test/tracing/trace_test.rb +0 -67
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 03473a7a2f7e8a5306869674ff671f1d5b66804e41bd1f687c512a33c0b07f3c
|
4
|
+
data.tar.gz: aaf1ada0116589a5d33e1f74558a6c32801971e5f5f4e512be56ff6524ab447b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6993a2dcb47b648445c97fea1017bcc9392f889270613078fd32fb2881365d88260ae0082e23eed6f32f9d111f67021dc9f2485f5cb4777b6317b7541352d40d
|
7
|
+
data.tar.gz: 5c8c34a422def00edda43e613899a59b99bae6c1cf1323d79c135703b1c6ab5d565ece30f8b8f0497e0ea79a7cf1585912c17ddf5e8c363cb33f792e6f7a6903
|
data/lib/instana/tracing/span.rb
CHANGED
@@ -303,6 +303,15 @@ module Instana
|
|
303
303
|
# a String, Numeric, or Boolean it will be encoded with to_s
|
304
304
|
#
|
305
305
|
def set_tag(key, value)
|
306
|
+
if ![Symbol, String].include?(key.class)
|
307
|
+
key = key.to_s
|
308
|
+
end
|
309
|
+
|
310
|
+
# If <value> is not a Symbol, String, Array, Hash or Numeric - convert to string
|
311
|
+
if ![Symbol, String, Array, TrueClass, FalseClass, Hash].include?(value.class) && !value.is_a?(Numeric)
|
312
|
+
value = value.to_s
|
313
|
+
end
|
314
|
+
|
306
315
|
if custom?
|
307
316
|
@data[:data][:sdk][:custom] ||= {}
|
308
317
|
@data[:data][:sdk][:custom][:tags] ||= {}
|
data/lib/instana/version.rb
CHANGED
data/test/tracing/tracer_test.rb
CHANGED
@@ -46,6 +46,37 @@ class TracerTest < Minitest::Test
|
|
46
46
|
assert_equal ::Instana.agent.agent_uuid, first_span[:f][:h]
|
47
47
|
end
|
48
48
|
|
49
|
+
def test_exotic_tag_types
|
50
|
+
clear_all!
|
51
|
+
|
52
|
+
assert_equal false, ::Instana.tracer.tracing?
|
53
|
+
|
54
|
+
require 'resolv'
|
55
|
+
r = Resolv::DNS.new
|
56
|
+
ipv4 = r.getaddress("www.pwpush.com")
|
57
|
+
|
58
|
+
::Instana.tracer.start_or_continue_trace(:rack, {:ipaddr => ipv4}) do
|
59
|
+
assert_equal true, ::Instana.tracer.tracing?
|
60
|
+
sleep 0.1
|
61
|
+
end
|
62
|
+
|
63
|
+
spans = ::Instana.processor.queued_spans
|
64
|
+
assert_equal 1, spans.length
|
65
|
+
|
66
|
+
first_span = spans.first
|
67
|
+
assert_equal :rack, first_span[:n]
|
68
|
+
assert first_span[:ts].is_a?(Integer)
|
69
|
+
assert first_span[:d].is_a?(Integer)
|
70
|
+
assert first_span[:d].between?(100, 130)
|
71
|
+
assert first_span.key?(:data)
|
72
|
+
assert first_span[:data].key?(:ipaddr)
|
73
|
+
assert first_span[:data][:ipaddr].is_a?(String)
|
74
|
+
assert first_span.key?(:f)
|
75
|
+
assert first_span[:f].key?(:e)
|
76
|
+
assert first_span[:f].key?(:h)
|
77
|
+
assert_equal ::Instana.agent.agent_uuid, first_span[:f][:h]
|
78
|
+
end
|
79
|
+
|
49
80
|
def test_errors_are_properly_propagated
|
50
81
|
clear_all!
|
51
82
|
exception_raised = false
|
@@ -198,7 +229,6 @@ class TracerTest < Minitest::Test
|
|
198
229
|
assert_equal sdk_span[:k], 3
|
199
230
|
assert_equal sdk_span[:data][:sdk][:custom][:tags][:sub_task_info], 1
|
200
231
|
assert_equal sdk_span[:data][:sdk][:custom][:tags][:sub_task_exit_info], 1
|
201
|
-
|
202
232
|
end
|
203
233
|
|
204
234
|
def test_block_tracing_error_capture
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: instana
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.11.
|
4
|
+
version: 1.11.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Giacomo Lombardo
|
@@ -296,7 +296,6 @@ files:
|
|
296
296
|
- test/tracing/custom_test.rb
|
297
297
|
- test/tracing/id_management_test.rb
|
298
298
|
- test/tracing/opentracing_test.rb
|
299
|
-
- test/tracing/trace_test.rb
|
300
299
|
- test/tracing/tracer_async_test.rb
|
301
300
|
- test/tracing/tracer_test.rb
|
302
301
|
homepage: https://www.instana.com/
|
@@ -332,7 +331,6 @@ test_files:
|
|
332
331
|
- test/tracing/tracer_test.rb
|
333
332
|
- test/tracing/custom_test.rb
|
334
333
|
- test/tracing/opentracing_test.rb
|
335
|
-
- test/tracing/trace_test.rb
|
336
334
|
- test/tracing/tracer_async_test.rb
|
337
335
|
- test/agent/agent_test.rb
|
338
336
|
- test/models/block.rb
|
data/test/tracing/trace_test.rb
DELETED
@@ -1,67 +0,0 @@
|
|
1
|
-
# require 'test_helper'
|
2
|
-
#
|
3
|
-
# class TraceTest < Minitest::Test
|
4
|
-
# def test_trace_spans_count
|
5
|
-
# t = ::Instana::Trace.new(:test_trace, { :one => 1, :two => 2 })
|
6
|
-
# t.new_span(:sub_span, { :sub_four => 4 })
|
7
|
-
# t.end_span(:sub_five => 5)
|
8
|
-
# t.end_span(:three => 3)
|
9
|
-
# assert t.spans.size == 2
|
10
|
-
# end
|
11
|
-
#
|
12
|
-
# def test_trace_with_incoming_context
|
13
|
-
# incoming_context = { :trace_id => "1234", :span_id => "4321" }
|
14
|
-
# t = ::Instana::Trace.new(:test_trace, { :one => 1, :two => 2 }, incoming_context)
|
15
|
-
# first_span = t.spans.first
|
16
|
-
# assert_equal "1234", first_span[:t]
|
17
|
-
# assert_equal "4321", first_span[:p]
|
18
|
-
# assert t.spans.size == 1
|
19
|
-
# end
|
20
|
-
#
|
21
|
-
# def test_max_value_of_generated_id
|
22
|
-
# # Max is the maximum value for a Java signed long
|
23
|
-
# max_value = 9223372036854775807
|
24
|
-
# 1000.times do
|
25
|
-
# assert ::Instana::Util.generate_id <= max_value
|
26
|
-
# end
|
27
|
-
# end
|
28
|
-
#
|
29
|
-
# def test_min_value_of_generated_id
|
30
|
-
# # Max is the maximum value for a Java signed long
|
31
|
-
# max_value = -9223372036854775808
|
32
|
-
# 1000.times do
|
33
|
-
# assert ::Instana::Util.generate_id >= max_value
|
34
|
-
# end
|
35
|
-
# end
|
36
|
-
#
|
37
|
-
# def test_entry_span_doesnt_have_stack_by_default
|
38
|
-
# t = ::Instana::Trace.new(:rack)
|
39
|
-
# first_span = t.spans.first
|
40
|
-
# assert !first_span.key?(:stack)
|
41
|
-
# end
|
42
|
-
#
|
43
|
-
# def test_entry_span_has_stack_by_config
|
44
|
-
# ::Instana.config[:collect_backtraces] = true
|
45
|
-
# t = ::Instana::Trace.new(:rack)
|
46
|
-
# first_span = t.spans.first
|
47
|
-
# assert first_span.key?(:stack)
|
48
|
-
# assert_equal 2, first_span[:stack].count
|
49
|
-
# ::Instana.config[:collect_backtraces] = false
|
50
|
-
# end
|
51
|
-
#
|
52
|
-
# def test_exit_span_doesnt_have_stack_by_default
|
53
|
-
# t = ::Instana::Trace.new(:trace_test)
|
54
|
-
# t.new_span(:excon)
|
55
|
-
# second_span = t.spans.to_a[1]
|
56
|
-
# assert !second_span.key?(:stack)
|
57
|
-
# end
|
58
|
-
#
|
59
|
-
# def test_exit_span_has_stack_by_config
|
60
|
-
# ::Instana.config[:collect_backtraces] = true
|
61
|
-
# t = ::Instana::Trace.new(:trace_test)
|
62
|
-
# t.new_span(:excon)
|
63
|
-
# second_span = t.spans.to_a[1]
|
64
|
-
# assert second_span.key?(:stack)
|
65
|
-
# ::Instana.config[:collect_backtraces] = false
|
66
|
-
# end
|
67
|
-
# end
|