activejob-traceable 0.3.3 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7d6ad88e74523ec04ab3eea7d338f32cdaa3b598814ae006d1a571ffc8d46d98
4
- data.tar.gz: 82dbd7a80b85a1f940fe750048f29dba50b7bf1af0abcf637cda0c6471bfb558
3
+ metadata.gz: c0dc49ffddefa127f83ab5d5e0c4a60c276ca7b7d86d96f976f43766fde9a7ac
4
+ data.tar.gz: 484dd54f1e047bde532909c076deae8f774b7a1b8c69651ae77a59caa3b38062
5
5
  SHA512:
6
- metadata.gz: d0f2d299607ebb232f4b46d3b82c1b21d769faacc0f7c6108556485dfa9ce7278b3c53e96732fa6ddbf4463d93231414195276539cd768d8fdddd3f67c6fe83d
7
- data.tar.gz: '078bd1149db4754e872a3bf1695bc609332a964f3b0124935b5c5c526456e35d5974550dad1cfb1ac1649644402e976c2415dbe9a0dd39f9b11819a1e45c5f70'
6
+ metadata.gz: d7a03098d61968eff1af46fb9f03e5268db5bf2bbb4131b3bff3fa220babf2562986582f8c516442daaae8f1ad97b79c249ef7036afbd5994eeaa919c7e27828
7
+ data.tar.gz: 468de74f9c8373331ef0557400c8f7f7a29cc277f6b299f638ed9571ab584fa7450d4414cbad1d115b957f31511fa94dbecca2e0033df9da9099b2b42e34228f
data/.gitignore CHANGED
@@ -6,6 +6,7 @@
6
6
  /pkg/
7
7
  /spec/reports/
8
8
  /tmp/
9
+ Gemfile.lock
9
10
 
10
11
  # rspec failure tracking
11
12
  .rspec_status
@@ -7,13 +7,15 @@ module ActiveJob
7
7
  included do
8
8
  attr_accessor :tracing_info
9
9
 
10
- def initialize(*arguments)
11
- super(*arguments)
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 || -> { {} }
@@ -2,6 +2,6 @@
2
2
 
3
3
  module ActiveJob
4
4
  module Traceable
5
- VERSION = '0.3.3'
5
+ VERSION = '0.3.6'
6
6
  end
7
7
  end
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.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: 2019-08-26 00:00:00.000000000 Z
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.0.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: []