traces-backend-datadog 0.2.2 → 0.4.1

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: b0a183caf86af771c4aa92753557357acd0f1ea77b3a0212f06302c405fb4c31
4
- data.tar.gz: 580c70c389d8fe0b058b52fb0654a7f395fa430ad714a0509c35756df08f7f9c
3
+ metadata.gz: 040d8f2bc0f1a70fc3d5fa0174a3aecd9665c0c867600cd6f247f57793e4a8f9
4
+ data.tar.gz: 32ca025f992d65699eab61e4efeb8e5b36a74d362a06b7d3951d6d9d904be12e
5
5
  SHA512:
6
- metadata.gz: e7ff71c75078a63907b3b23f67ebbe0daa724d65006b694ecfff9ccb0b566c3313579fdf2c1b7c01df2e3c8943b75a3f5a96ac03ea67ef38962f65190cd8b721
7
- data.tar.gz: 5bc284e6fad54df93cf8d83cc34388cc071f0f8d963bd555dd512c31873fa30221e0956a88c265a8e9bca0dea3eaa29a913405db8c67a272be1218147554fa13
6
+ metadata.gz: cccf6a6ffe50dffbe16f54af386d94c37b61820eab7396793560b09431ce71b66a2759f55920da8b917801ca9c2868b05e1176c81a942554ee8ebd0caa71a5ad
7
+ data.tar.gz: 07a8a99b1ec459a1380d3db965ca86980863b089cdd401a3ac8a6b67a4e830c5279d4d8faca12f19fd23ec4c7102b6ed328f64878a65510f41f2898e7cfa75a9
checksums.yaml.gz.sig CHANGED
Binary file
@@ -20,49 +20,50 @@
20
20
  # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
21
  # THE SOFTWARE.
22
22
 
23
- require 'ddtrace'
23
+ require 'datadog/tracing'
24
24
 
25
25
  require 'traces/context'
26
26
  require_relative 'version'
27
27
 
28
+ # We introduce some compatibility interfaces for getting and setting tags:
29
+ module Datadog::Tracing::Metadata::Tagging
30
+ alias []= set_tag
31
+ alias [] get_tag
32
+ end
33
+
28
34
  module Traces
29
35
  module Backend
30
36
  module Datadog
31
- module SpanInterface
32
- def []= key, value
33
- set_tag(key, value)
34
- end
35
- end
36
-
37
- ::Datadog::Span.prepend(SpanInterface)
38
-
39
37
  module Interface
40
38
  def trace(name, attributes: {}, resource: nil, &block)
41
- ::Datadog.tracer.trace(name, tags: attributes, resource: resource, &block)
39
+ ::Datadog::Tracing.trace(name, tags: attributes, resource: resource, &block)
42
40
  end
43
41
 
44
42
  def trace_context=(context)
45
43
  if context
46
- ::Datadog.tracer.provider.context = ::Datadog::Context.new(
47
- trace_id: context.trace_id,
48
- span_id: context.parent_id,
49
- sampled: context.sampled?,
44
+ trace_digest = ::Datadog::Tracing::TraceDigest.new(
45
+ # We force these to be integers otherwise Datadog can fail internally:
46
+ trace_id: context.trace_id.to_i,
47
+ span_id: context.parent_id.to_i,
48
+ trace_sampling_priority: context.sampled? ? 1 : 0,
50
49
  )
50
+
51
+ ::Datadog::Tracing.continue_trace!(trace_digest)
51
52
  end
52
53
  end
53
54
 
54
- def trace_context(span = ::Datadog.tracer.active_span)
55
- return nil unless span
55
+ def trace_context
56
+ return nil unless trace = ::Datadog::Tracing.active_trace
56
57
 
57
58
  flags = 0
58
59
 
59
- if span.sampled
60
+ if trace.sampled?
60
61
  flags |= Context::SAMPLED
61
62
  end
62
63
 
63
64
  return Context.new(
64
- span.trace_id,
65
- span.span_id,
65
+ trace.id,
66
+ trace.active_span.span_id,
66
67
  flags,
67
68
  nil,
68
69
  remote: false,
@@ -23,7 +23,7 @@
23
23
  module Traces
24
24
  module Backend
25
25
  module Datadog
26
- VERSION = "0.2.2"
26
+ VERSION = "0.4.1"
27
27
  end
28
28
  end
29
29
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: traces-backend-datadog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
@@ -36,36 +36,36 @@ cert_chain:
36
36
  RAOsIl+HOBTb252nx1kIRN5hqQx272AJCbCjKx8egcUQKffFVVCI0nye09v5CK+a
37
37
  HiLJ8VOFx6w=
38
38
  -----END CERTIFICATE-----
39
- date: 2022-02-03 00:00:00.000000000 Z
39
+ date: 2022-06-10 00:00:00.000000000 Z
40
40
  dependencies:
41
41
  - !ruby/object:Gem::Dependency
42
- name: traces
42
+ name: ddtrace
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 0.5.0
47
+ version: '1.0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 0.5.0
54
+ version: '1.0'
55
55
  - !ruby/object:Gem::Dependency
56
- name: ddtrace
56
+ name: traces
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '0.53'
61
+ version: 0.6.0
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '0.53'
68
+ version: 0.6.0
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rspec
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -108,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
108
108
  - !ruby/object:Gem::Version
109
109
  version: '0'
110
110
  requirements: []
111
- rubygems_version: 3.1.6
111
+ rubygems_version: 3.3.7
112
112
  signing_key:
113
113
  specification_version: 4
114
114
  summary: A traces backend for Datadog.
metadata.gz.sig CHANGED
Binary file