freddy 2.2.4 → 2.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +1 -0
- data/.gitignore +0 -1
- data/Gemfile.lock +102 -0
- data/lib/freddy/consumers/tap_into_consumer.rb +1 -1
- data/lib/freddy/delivery.rb +3 -18
- data/lib/freddy/version.rb +1 -1
- data/spec/integration/tracing_spec.rb +2 -10
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 55182881b38a721d174a649943e973134d3ebac9c0502b34cce14ddc503f33db
|
4
|
+
data.tar.gz: 2e0c118f4a4af53745b070d512a74bdc87245e8c8489ea6985d788b71ddd9eab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b72b0edde6c555492c90a722d19e99ccc32cd49a8066e7a7fcde71625541c90b1a893980b98f002beadc0644132512954e6f4d7850f55b536ef3f4771e71c1b0
|
7
|
+
data.tar.gz: 79a42a9ea43f43a472066129ea8fe5a00c793c458fe36d482d51286dc45e44d7de3cfc2f0fd23828e05cb4d2fe95471b9304d59a1e09c27cbcbbdb53c33fc1c8
|
data/.github/workflows/ci.yml
CHANGED
data/Gemfile.lock
ADDED
@@ -0,0 +1,102 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
freddy (2.3.0)
|
5
|
+
bunny (~> 2.11)
|
6
|
+
oj (~> 3.6)
|
7
|
+
opentelemetry-api (~> 1.0.0.rc3)
|
8
|
+
opentelemetry-semantic_conventions (~> 1.0)
|
9
|
+
thread (~> 0.1)
|
10
|
+
zlib (~> 1.1)
|
11
|
+
|
12
|
+
GEM
|
13
|
+
remote: https://rubygems.org/
|
14
|
+
specs:
|
15
|
+
amq-protocol (2.3.2)
|
16
|
+
ast (2.4.2)
|
17
|
+
bunny (2.19.0)
|
18
|
+
amq-protocol (~> 2.3, >= 2.3.1)
|
19
|
+
sorted_set (~> 1, >= 1.0.2)
|
20
|
+
coderay (1.1.3)
|
21
|
+
concurrent-ruby (1.1.9)
|
22
|
+
diff-lcs (1.4.4)
|
23
|
+
hamster (3.0.0)
|
24
|
+
concurrent-ruby (~> 1.0)
|
25
|
+
method_source (1.0.0)
|
26
|
+
oj (3.13.2)
|
27
|
+
opentelemetry-api (1.0.0.rc3)
|
28
|
+
opentelemetry-common (0.19.1)
|
29
|
+
opentelemetry-api (~> 1.0.0.rc3)
|
30
|
+
opentelemetry-instrumentation-base (0.18.2)
|
31
|
+
opentelemetry-api (~> 1.0.0.rc3)
|
32
|
+
opentelemetry-sdk (1.0.0.rc3)
|
33
|
+
opentelemetry-api (~> 1.0.0.rc3)
|
34
|
+
opentelemetry-common (~> 0.19.1)
|
35
|
+
opentelemetry-instrumentation-base (~> 0.18.2)
|
36
|
+
opentelemetry-semantic_conventions
|
37
|
+
opentelemetry-semantic_conventions (1.6.0)
|
38
|
+
opentelemetry-api (~> 1.0.0.rc3)
|
39
|
+
parallel (1.20.1)
|
40
|
+
parser (3.0.2.0)
|
41
|
+
ast (~> 2.4.1)
|
42
|
+
pry (0.14.1)
|
43
|
+
coderay (~> 1.1)
|
44
|
+
method_source (~> 1.0)
|
45
|
+
rainbow (3.0.0)
|
46
|
+
rake (13.0.6)
|
47
|
+
rbtree (0.4.4)
|
48
|
+
regexp_parser (2.1.1)
|
49
|
+
rexml (3.2.5)
|
50
|
+
rspec (3.10.0)
|
51
|
+
rspec-core (~> 3.10.0)
|
52
|
+
rspec-expectations (~> 3.10.0)
|
53
|
+
rspec-mocks (~> 3.10.0)
|
54
|
+
rspec-core (3.10.1)
|
55
|
+
rspec-support (~> 3.10.0)
|
56
|
+
rspec-expectations (3.10.1)
|
57
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
58
|
+
rspec-support (~> 3.10.0)
|
59
|
+
rspec-mocks (3.10.2)
|
60
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
61
|
+
rspec-support (~> 3.10.0)
|
62
|
+
rspec-support (3.10.2)
|
63
|
+
rubocop (1.19.0)
|
64
|
+
parallel (~> 1.10)
|
65
|
+
parser (>= 3.0.0.0)
|
66
|
+
rainbow (>= 2.2.2, < 4.0)
|
67
|
+
regexp_parser (>= 1.8, < 3.0)
|
68
|
+
rexml
|
69
|
+
rubocop-ast (>= 1.9.1, < 2.0)
|
70
|
+
ruby-progressbar (~> 1.7)
|
71
|
+
unicode-display_width (>= 1.4.0, < 3.0)
|
72
|
+
rubocop-ast (1.10.0)
|
73
|
+
parser (>= 3.0.1.1)
|
74
|
+
rubocop-rspec (2.4.0)
|
75
|
+
rubocop (~> 1.0)
|
76
|
+
rubocop-ast (>= 1.1.0)
|
77
|
+
ruby-progressbar (1.11.0)
|
78
|
+
set (1.0.1)
|
79
|
+
sorted_set (1.0.3)
|
80
|
+
rbtree
|
81
|
+
set (~> 1.0)
|
82
|
+
thread (0.2.2)
|
83
|
+
unicode-display_width (2.0.0)
|
84
|
+
zlib (1.1.0)
|
85
|
+
|
86
|
+
PLATFORMS
|
87
|
+
ruby
|
88
|
+
x86_64-linux
|
89
|
+
|
90
|
+
DEPENDENCIES
|
91
|
+
bundler
|
92
|
+
freddy!
|
93
|
+
hamster (~> 3.0)
|
94
|
+
opentelemetry-sdk (~> 1.0.0.rc3)
|
95
|
+
pry
|
96
|
+
rake
|
97
|
+
rspec
|
98
|
+
rubocop (~> 1.19)
|
99
|
+
rubocop-rspec (~> 2.4)
|
100
|
+
|
101
|
+
BUNDLED WITH
|
102
|
+
2.2.27
|
data/lib/freddy/delivery.rb
CHANGED
@@ -24,28 +24,13 @@ class Freddy
|
|
24
24
|
@metadata.reply_to
|
25
25
|
end
|
26
26
|
|
27
|
-
def in_span(
|
27
|
+
def in_span(&block)
|
28
28
|
name = "#{Tracing.span_destination(@exchange, @routing_key)} process"
|
29
29
|
kind = OpenTelemetry::Trace::SpanKind::CONSUMER
|
30
30
|
producer_context = OpenTelemetry.propagation.extract(@metadata[:headers] || {})
|
31
31
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
links = []
|
36
|
-
links << OpenTelemetry::Trace::Link.new(producer_span_context) if producer_span_context.valid?
|
37
|
-
|
38
|
-
root_span = Freddy.tracer.start_root_span(name, attributes: span_attributes, links: links, kind: kind)
|
39
|
-
|
40
|
-
OpenTelemetry::Trace.with_span(root_span) do
|
41
|
-
block.call
|
42
|
-
ensure
|
43
|
-
root_span.finish
|
44
|
-
end
|
45
|
-
else
|
46
|
-
OpenTelemetry::Context.with_current(producer_context) do
|
47
|
-
Freddy.tracer.in_span(name, attributes: span_attributes, kind: kind, &block)
|
48
|
-
end
|
32
|
+
OpenTelemetry::Context.with_current(producer_context) do
|
33
|
+
Freddy.tracer.in_span(name, attributes: span_attributes, kind: kind, &block)
|
49
34
|
end
|
50
35
|
end
|
51
36
|
|
data/lib/freddy/version.rb
CHANGED
@@ -132,10 +132,8 @@ describe 'Tracing' do
|
|
132
132
|
freddy.close
|
133
133
|
end
|
134
134
|
|
135
|
-
it '
|
136
|
-
initiator_span = nil
|
135
|
+
it 'continues the existing trace' do
|
137
136
|
Freddy.tracer.in_span('test') do
|
138
|
-
initiator_span = current_span_attributes
|
139
137
|
freddy.deliver(destination, {})
|
140
138
|
end
|
141
139
|
wait_for { @deliver_span }
|
@@ -147,13 +145,7 @@ describe 'Tracing' do
|
|
147
145
|
/freddy-topic\.\w+ process/
|
148
146
|
])
|
149
147
|
|
150
|
-
|
151
|
-
|
152
|
-
expect(@deliver_span.fetch(:trace_id)).not_to eq(initiator_span.fetch(:trace_id))
|
153
|
-
|
154
|
-
link = @deliver_span.fetch(:links)[0]
|
155
|
-
expect(link.span_context.trace_id).to eq(initiator_span.fetch(:trace_id))
|
156
|
-
expect(link.span_context.span_id).to eq(send_span.span_id)
|
148
|
+
expect(exporter.finished_spans.map(&:trace_id).uniq.count).to eq(1)
|
157
149
|
end
|
158
150
|
end
|
159
151
|
|
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: 2.
|
4
|
+
version: 2.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Glia TechMovers
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-12-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -137,6 +137,7 @@ files:
|
|
137
137
|
- ".ruby-gemset"
|
138
138
|
- ".ruby-version"
|
139
139
|
- Gemfile
|
140
|
+
- Gemfile.lock
|
140
141
|
- LICENCE.txt
|
141
142
|
- README.md
|
142
143
|
- Rakefile
|