instana 1.10.7-java → 1.10.8-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/instana/instrumentation/dalli.rb +8 -4
- data/lib/instana/version.rb +1 -1
- data/test/instrumentation/dalli_test.rb +36 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8bace4b861697b0193cc8dff1fad928ab75e27f68933192c6270dc7d07887f7c
|
4
|
+
data.tar.gz: 8e7cb89f0e1ba9cb11eb57564578d996b01323549928debe639c548a5917a455
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0c95d0e8a34f10ee3daac3f7cb658ce3409fe34f98683350493a12aacc03abf983c718e389bfc9aaca1ac74f98272251675ab6a2581acb7d142a60f619606860
|
7
|
+
data.tar.gz: 3c52fc61d3d8b1d2616b3cb1e6ff29b99c00fbc7a2ead65144de12c60de50920abd19e2b429718f766c1b978619945bcae1a89e78e650a8aa48c93e6aeecdc96
|
@@ -20,18 +20,20 @@ module Instana
|
|
20
20
|
entry_payload[:memcache][:key] = key
|
21
21
|
|
22
22
|
::Instana.tracer.log_entry(:memcache, entry_payload)
|
23
|
+
exit_payload = { :memcache => {} }
|
24
|
+
|
23
25
|
result = perform_without_instana(*args, &blk)
|
24
26
|
|
25
|
-
kv_payload = { :memcache => {}}
|
26
27
|
if op == :get
|
27
|
-
|
28
|
+
exit_payload[:memcache][:hit] = result ? 1 : 0
|
28
29
|
end
|
29
30
|
result
|
30
31
|
rescue => e
|
32
|
+
exit_payload[:memcache][:error] = e.message rescue nil
|
31
33
|
::Instana.tracer.log_error(e)
|
32
34
|
raise
|
33
35
|
ensure
|
34
|
-
::Instana.tracer.log_exit(:memcache,
|
36
|
+
::Instana.tracer.log_exit(:memcache, exit_payload) unless do_skip
|
35
37
|
end
|
36
38
|
|
37
39
|
def get_multi_with_instana(*keys)
|
@@ -41,12 +43,14 @@ module Instana
|
|
41
43
|
entry_payload[:memcache][:keys] = keys.flatten.join(", ")
|
42
44
|
|
43
45
|
::Instana.tracer.log_entry(:memcache, entry_payload)
|
46
|
+
exit_payload = { :memcache => {} }
|
47
|
+
|
44
48
|
result = get_multi_without_instana(*keys)
|
45
49
|
|
46
|
-
exit_payload = { :memcache => {} }
|
47
50
|
exit_payload[:memcache][:hits] = result.length
|
48
51
|
result
|
49
52
|
rescue => e
|
53
|
+
exit_payload[:memcache][:error] = e.message rescue nil
|
50
54
|
::Instana.tracer.log_error(e)
|
51
55
|
raise
|
52
56
|
ensure
|
data/lib/instana/version.rb
CHANGED
@@ -250,4 +250,40 @@ class DalliTest < Minitest::Test
|
|
250
250
|
assert second_span[:data][:memcache].key?(:hits)
|
251
251
|
assert_equal 2, second_span[:data][:memcache][:hits]
|
252
252
|
end
|
253
|
+
|
254
|
+
def test_get_error_logging
|
255
|
+
clear_all!
|
256
|
+
|
257
|
+
# Invalid/broken client not connected to a server
|
258
|
+
broken_dc = Dalli::Client.new('128.0.0.100:11222', :namespace => "instana_test", :expires_in => 1)
|
259
|
+
|
260
|
+
result = nil
|
261
|
+
begin
|
262
|
+
::Instana.tracer.start_or_continue_trace(:dalli_test) do
|
263
|
+
result = broken_dc.get(:instana)
|
264
|
+
end
|
265
|
+
rescue
|
266
|
+
end
|
267
|
+
|
268
|
+
spans = ::Instana.processor.queued_spans
|
269
|
+
assert_equal 2, spans.length
|
270
|
+
|
271
|
+
first_span = spans[1]
|
272
|
+
second_span = spans[0]
|
273
|
+
|
274
|
+
validate_sdk_span(first_span, {:name => :dalli_test, :type => :entry})
|
275
|
+
|
276
|
+
assert_equal :memcache, second_span[:n]
|
277
|
+
assert_equal true, second_span.key?(:error)
|
278
|
+
assert second_span[:p] == first_span[:s]
|
279
|
+
assert first_span[:t] == first_span[:s]
|
280
|
+
assert second_span[:data].key?(:memcache)
|
281
|
+
assert second_span[:data][:memcache].key?(:command)
|
282
|
+
assert_equal :get, second_span[:data][:memcache][:command]
|
283
|
+
assert second_span[:data][:memcache].key?(:key)
|
284
|
+
assert_equal :instana, second_span[:data][:memcache][:key]
|
285
|
+
assert second_span[:data][:memcache].key?(:namespace)
|
286
|
+
assert_equal 'instana_test', second_span[:data][:memcache][:namespace]
|
287
|
+
assert second_span[:data][:memcache].key?(:error)
|
288
|
+
end
|
253
289
|
end
|