activejob-traceable 0.3.3 → 0.3.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/lib/activejob/traceable/traceable.rb +16 -2
- data/lib/activejob/traceable/version.rb +1 -1
- metadata +7 -7
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
@@ -7,13 +7,15 @@ module ActiveJob
|
|
7
7
|
included do
|
8
8
|
attr_accessor :tracing_info
|
9
9
|
|
10
|
-
def initialize(*
|
11
|
-
super(*
|
10
|
+
def initialize(*args)
|
11
|
+
super(*args)
|
12
12
|
|
13
13
|
@tracing_info = Traceable.tracing_info_getter.call.deep_stringify_keys
|
14
14
|
end
|
15
|
+
ruby2_keywords :initialize if respond_to?(:ruby2_keywords, true)
|
15
16
|
|
16
17
|
def serialize
|
18
|
+
add_telemetry_data!
|
17
19
|
super.merge!('tracing_info' => tracing_info)
|
18
20
|
end
|
19
21
|
|
@@ -24,10 +26,22 @@ module ActiveJob
|
|
24
26
|
self.tracing_info = job_data['tracing_info']
|
25
27
|
end
|
26
28
|
|
29
|
+
add_telemetry_data!
|
30
|
+
|
27
31
|
Traceable.tracing_info_setter.call(tracing_info.with_indifferent_access)
|
28
32
|
end
|
29
33
|
end
|
30
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
|
+
|
31
45
|
class << self
|
32
46
|
def tracing_info_getter
|
33
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
|
-
autorequire:
|
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
|
@@ -94,7 +94,7 @@ dependencies:
|
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '3.8'
|
97
|
-
description:
|
97
|
+
description:
|
98
98
|
email:
|
99
99
|
- backend@qonto.eu
|
100
100
|
executables: []
|
@@ -117,7 +117,7 @@ homepage: https://github.com/qonto/activejob-traceable
|
|
117
117
|
licenses:
|
118
118
|
- MIT
|
119
119
|
metadata: {}
|
120
|
-
post_install_message:
|
120
|
+
post_install_message:
|
121
121
|
rdoc_options: []
|
122
122
|
require_paths:
|
123
123
|
- lib
|
@@ -132,8 +132,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
132
132
|
- !ruby/object:Gem::Version
|
133
133
|
version: '0'
|
134
134
|
requirements: []
|
135
|
-
rubygems_version: 3.
|
136
|
-
signing_key:
|
135
|
+
rubygems_version: 3.4.10
|
136
|
+
signing_key:
|
137
137
|
specification_version: 4
|
138
138
|
summary: Patches ActiveJob to add trace_id attribute.
|
139
139
|
test_files: []
|