activejob-traceable 0.3.5 → 0.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/lib/activejob/traceable/traceable.rb +13 -0
- data/lib/activejob/traceable/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c0dc49ffddefa127f83ab5d5e0c4a60c276ca7b7d86d96f976f43766fde9a7ac
|
4
|
+
data.tar.gz: 484dd54f1e047bde532909c076deae8f774b7a1b8c69651ae77a59caa3b38062
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d7a03098d61968eff1af46fb9f03e5268db5bf2bbb4131b3bff3fa220babf2562986582f8c516442daaae8f1ad97b79c249ef7036afbd5994eeaa919c7e27828
|
7
|
+
data.tar.gz: 468de74f9c8373331ef0557400c8f7f7a29cc277f6b299f638ed9571ab584fa7450d4414cbad1d115b957f31511fa94dbecca2e0033df9da9099b2b42e34228f
|
data/.gitignore
CHANGED
@@ -15,6 +15,7 @@ module ActiveJob
|
|
15
15
|
ruby2_keywords :initialize if respond_to?(:ruby2_keywords, true)
|
16
16
|
|
17
17
|
def serialize
|
18
|
+
add_telemetry_data!
|
18
19
|
super.merge!('tracing_info' => tracing_info)
|
19
20
|
end
|
20
21
|
|
@@ -25,10 +26,22 @@ module ActiveJob
|
|
25
26
|
self.tracing_info = job_data['tracing_info']
|
26
27
|
end
|
27
28
|
|
29
|
+
add_telemetry_data!
|
30
|
+
|
28
31
|
Traceable.tracing_info_setter.call(tracing_info.with_indifferent_access)
|
29
32
|
end
|
30
33
|
end
|
31
34
|
|
35
|
+
private
|
36
|
+
|
37
|
+
def add_telemetry_data!
|
38
|
+
if ENV["OTEL_EXPORTER_OTLP_ENDPOINT"].present?
|
39
|
+
current_span = OpenTelemetry::Trace.current_span
|
40
|
+
@tracing_info[:trace_id] = current_span.context.trace_id.unpack1("H*")
|
41
|
+
@tracing_info[:span_id] = current_span.context.span_id.unpack1("H*")
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
32
45
|
class << self
|
33
46
|
def tracing_info_getter
|
34
47
|
@tracing_info_getter || -> { {} }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activejob-traceable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Qonto team
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-06-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activejob
|
@@ -132,7 +132,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
132
132
|
- !ruby/object:Gem::Version
|
133
133
|
version: '0'
|
134
134
|
requirements: []
|
135
|
-
rubygems_version: 3.
|
135
|
+
rubygems_version: 3.4.10
|
136
136
|
signing_key:
|
137
137
|
specification_version: 4
|
138
138
|
summary: Patches ActiveJob to add trace_id attribute.
|