freddy 2.2.1 → 2.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/freddy/delivery.rb +3 -2
- data/lib/freddy/version.rb +1 -1
- data/spec/integration/tracing_spec.rb +12 -1
- data/spec/spec_helper.rb +7 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 445e69f7be1822b3d6f8703086134081d944758ca5013c1d0e24331ec0d3e6b3
|
4
|
+
data.tar.gz: 9d918d1713c809253187727bd4adfa84584171abc07921e97429a8f8381a4ab6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b76ebf99d84beea8fdb5e6557f780ab5ef0932cc177329e5524da4cf2a073ef8376e42f2c127614a60bd97566d3e460541d1c6a3e1a8ebe6f915e008b51e2577
|
7
|
+
data.tar.gz: 618367f3bb21b08a68d914c6f011b128764730a3555c7a46bd610703df13547b81aa4f09bc075058168b91fa5e9a72206de49ea6442d7c6cc1ae95ccf7901570
|
data/lib/freddy/delivery.rb
CHANGED
@@ -25,7 +25,7 @@ class Freddy
|
|
25
25
|
end
|
26
26
|
|
27
27
|
def in_span(force_follows_from: false, &block)
|
28
|
-
name = "#{@exchange}.#{@routing_key}
|
28
|
+
name = "#{@exchange}.#{@routing_key} process"
|
29
29
|
kind = OpenTelemetry::Trace::SpanKind::CONSUMER
|
30
30
|
producer_context = OpenTelemetry.propagation.extract(@metadata[:headers] || {})
|
31
31
|
|
@@ -36,8 +36,9 @@ class Freddy
|
|
36
36
|
links << OpenTelemetry::Trace::Link.new(producer_span_context) if producer_span_context.valid?
|
37
37
|
|
38
38
|
root_span = Freddy.tracer.start_root_span(name, attributes: span_attributes, links: links, kind: kind)
|
39
|
+
|
39
40
|
OpenTelemetry::Trace.with_span(root_span) do
|
40
|
-
|
41
|
+
block.call
|
41
42
|
ensure
|
42
43
|
root_span.finish
|
43
44
|
end
|
data/lib/freddy/version.rb
CHANGED
@@ -1,7 +1,11 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe 'Tracing' do
|
4
|
-
let(:
|
4
|
+
let(:exporter) { SPAN_EXPORTER }
|
5
|
+
|
6
|
+
before do
|
7
|
+
exporter.reset
|
8
|
+
end
|
5
9
|
|
6
10
|
context 'when receiving a traced request' do
|
7
11
|
let(:freddy) { Freddy.build(logger, config) }
|
@@ -128,6 +132,13 @@ describe 'Tracing' do
|
|
128
132
|
end
|
129
133
|
wait_for { @deliver_span }
|
130
134
|
|
135
|
+
expect(exporter.finished_spans.map(&:name))
|
136
|
+
.to match([
|
137
|
+
/\.\w+ send/,
|
138
|
+
'test',
|
139
|
+
/freddy-topic\.\w+ process/
|
140
|
+
])
|
141
|
+
|
131
142
|
expect(@deliver_span.fetch(:trace_id)).not_to eq(initiator_span.fetch(:trace_id))
|
132
143
|
|
133
144
|
link = @deliver_span.fetch(:links)[0]
|
data/spec/spec_helper.rb
CHANGED
@@ -11,6 +11,13 @@ require 'freddy'
|
|
11
11
|
require 'logger'
|
12
12
|
require 'hamster/experimental/mutable_set'
|
13
13
|
|
14
|
+
SPAN_EXPORTER = OpenTelemetry::SDK::Trace::Export::InMemorySpanExporter.new
|
15
|
+
span_processor = OpenTelemetry::SDK::Trace::Export::SimpleSpanProcessor.new(SPAN_EXPORTER)
|
16
|
+
|
17
|
+
OpenTelemetry::SDK.configure do |c|
|
18
|
+
c.add_span_processor(span_processor)
|
19
|
+
end
|
20
|
+
|
14
21
|
Thread.abort_on_exception = true
|
15
22
|
|
16
23
|
RSpec.configure do |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: 2.2.
|
4
|
+
version: 2.2.2
|
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-09-
|
11
|
+
date: 2021-09-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|