freddy 1.3.0 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/freddy.gemspec +1 -1
- data/lib/freddy/delivery.rb +1 -1
- data/lib/freddy/trace_carrier.rb +0 -4
- data/spec/integration/logging_spec.rb +3 -0
- data/spec/integration/tracing_spec.rb +0 -32
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7d6c4c4eb4caea3505466f173e26a0126546f318
|
4
|
+
data.tar.gz: 3693ce26d92ec11e83affdb10174be3b70459978
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 10f7e439c2d80225c91242602e7647bd79bf658e04583d2fabfd5497f2ac8c67a180b6312e127bceec771b5fc33fba6bbd056d4c591429408ea5adc5aa87c45d
|
7
|
+
data.tar.gz: 34ffb7ee253e88cc7cfbbcf831d9e7e342dc64eef70ea85300e620fcf20621867339808cb2915164ff653e007e08df8ae63de3092c974553ea91cbe2a078634c
|
data/Gemfile
CHANGED
data/freddy.gemspec
CHANGED
data/lib/freddy/delivery.rb
CHANGED
@@ -24,7 +24,7 @@ class Freddy
|
|
24
24
|
def build_trace(operation_name, tags: {}, force_follows_from: false)
|
25
25
|
carrier = TraceCarrier.new(@metadata)
|
26
26
|
parent =
|
27
|
-
if
|
27
|
+
if expecting_response? && !force_follows_from
|
28
28
|
OpenTracing.global_tracer.extract(OpenTracing::FORMAT_TEXT_MAP, carrier)
|
29
29
|
else
|
30
30
|
nil
|
data/lib/freddy/trace_carrier.rb
CHANGED
@@ -14,6 +14,7 @@ describe 'Logging with Logasm::Tracer' do
|
|
14
14
|
|
15
15
|
before do
|
16
16
|
freddy.respond_to(destination) do |payload, msg_handler|
|
17
|
+
sleep 0.1 # emulate some processing
|
17
18
|
msg_handler.success({})
|
18
19
|
end
|
19
20
|
end
|
@@ -49,6 +50,7 @@ describe 'Logging with Logasm::Tracer' do
|
|
49
50
|
|
50
51
|
before do
|
51
52
|
freddy.respond_to(destination) do |payload, msg_handler|
|
53
|
+
sleep 0.1 # emulate some processing
|
52
54
|
msg_handler.success({
|
53
55
|
trace_initiator: {},
|
54
56
|
current_receiver: freddy.deliver_with_response(destination2, {})
|
@@ -56,6 +58,7 @@ describe 'Logging with Logasm::Tracer' do
|
|
56
58
|
end
|
57
59
|
|
58
60
|
freddy2.respond_to(destination2) do |payload, msg_handler|
|
61
|
+
sleep 0.1 # emulate some processing
|
59
62
|
msg_handler.success({})
|
60
63
|
end
|
61
64
|
end
|
@@ -8,38 +8,6 @@ describe 'Tracing' do
|
|
8
8
|
before { OpenTracing.global_tracer = tracer }
|
9
9
|
after { OpenTracing.global_tracer = nil }
|
10
10
|
|
11
|
-
context 'when receiving an untraced request' do
|
12
|
-
let(:freddy) { Freddy.build(logger, config) }
|
13
|
-
let(:destination) { random_destination }
|
14
|
-
|
15
|
-
before do
|
16
|
-
freddy.respond_to(destination) do |payload, msg_handler|
|
17
|
-
msg_handler.success({
|
18
|
-
trace_id: Freddy.trace.context.trace_id,
|
19
|
-
parent_id: Freddy.trace.context.parent_id,
|
20
|
-
span_id: Freddy.trace.context.span_id
|
21
|
-
})
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
after { freddy.close }
|
26
|
-
|
27
|
-
it 'has generated trace_id' do
|
28
|
-
response = freddy.deliver_with_response(destination, {})
|
29
|
-
expect(response.fetch(:trace_id)).to_not be_nil
|
30
|
-
end
|
31
|
-
|
32
|
-
it 'has no parent_id' do
|
33
|
-
response = freddy.deliver_with_response(destination, {})
|
34
|
-
expect(response.fetch(:parent_id)).to be_nil
|
35
|
-
end
|
36
|
-
|
37
|
-
it 'has generated span_id' do
|
38
|
-
response = freddy.deliver_with_response(destination, {})
|
39
|
-
expect(response.fetch(:span_id)).to_not be_nil
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
11
|
context 'when receiving a traced request' do
|
44
12
|
let(:freddy) { Freddy.build(logger, config) }
|
45
13
|
let(:freddy2) { Freddy.build(logger, config) }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: freddy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Salemove TechMovers
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-04-
|
11
|
+
date: 2017-04-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|