activejob-traceable 0.3.5 → 0.3.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b54c11e7a22889140d06573ff007ba010390e2b63a76acf3e89bec9c5925fd0f
4
- data.tar.gz: 2e7e17cd4c3b4575b26bdf648f9f8690879442255992ce803941ea6acc665186
3
+ metadata.gz: c0dc49ffddefa127f83ab5d5e0c4a60c276ca7b7d86d96f976f43766fde9a7ac
4
+ data.tar.gz: 484dd54f1e047bde532909c076deae8f774b7a1b8c69651ae77a59caa3b38062
5
5
  SHA512:
6
- metadata.gz: 9d8dc30daa8d03d34e0647ae4afd9c80a22b344d719a3b0414356e71d89ae4e198f16c7d93f9186eb8c2d0796e92e798ea2c9088fee52e9c868729a040bc2222
7
- data.tar.gz: dafe29b1bfe58ba46e3aa9944aec3b047727a19018567a302c681e8c1d5c304d63a4c283e6e9e420c548a8f06dac3ff8aeb7faeeb0fd53a04b94c3d97f99959c
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
@@ -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 || -> { {} }
@@ -2,6 +2,6 @@
2
2
 
3
3
  module ActiveJob
4
4
  module Traceable
5
- VERSION = '0.3.5'
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.5
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: 2021-05-07 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
@@ -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.1.4
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.