traces-backend-datadog 0.3.0 → 0.4.0

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: 0fad85a5252e40bc384ac7f1bddf51e25d22a582cda6c22f930815949acdeb3d
4
- data.tar.gz: 9b702dec052f2ebaa9353599917fc44c381437589b7920e3206de04c07b6c2cd
3
+ metadata.gz: f3464aff332ac62bf57972e0f9dfbc392eb76590a64adac1f604a9f26b1f5749
4
+ data.tar.gz: 52e97e8a9beb92d580c1a57c5692a371db4c12a6efaf18d52abb4438ba1eee33
5
5
  SHA512:
6
- metadata.gz: c61fa3e5f4e725411ba8126a0fd7657ef083922df2d96b700565498929994037c3771cb4916553ac9685c3804c5fde99ad8513c6873be5146502731c8bb01749
7
- data.tar.gz: 256d552b32219ea2eb5634a0967f70f9ef097093ec420feee745bc9749306650af2023f9c4a1f31d5f2adb9f85fc3db89f910f48240c7db5d4a52abb119199ea
6
+ metadata.gz: d806071886b1b79447b9a71b1cd046f338dc7ac4bac79c25ffc75f91a6a75444ed049c3b5520f866024ec96e5296c779d8e5631bed88c25114ccd3ae9bedeffe
7
+ data.tar.gz: 4a059578be07ddb252cc476ee40c5abeca022a4e960140739db7ea4ff8a461ddb8b9084af9f7cd75ad8a3ec9aafafe115c25d34f954fad940c8ec1e75dd408aa
checksums.yaml.gz.sig CHANGED
Binary file
@@ -28,42 +28,36 @@ require_relative 'version'
28
28
  module Traces
29
29
  module Backend
30
30
  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
31
  module Interface
40
32
  def trace(name, attributes: {}, resource: nil, &block)
41
- ::Datadog.tracer.trace(name, tags: attributes, resource: resource, &block)
33
+ ::Datadog::Tracing.trace(name, tags: attributes, resource: resource, &block)
42
34
  end
43
35
 
44
36
  def trace_context=(context)
45
37
  if context
46
- ::Datadog.tracer.provider.context = ::Datadog::Context.new(
38
+ trace_digest = ::Datadog::Tracing::TraceDigest.new(
47
39
  # We force these to be integers otherwise Datadog can fail internally:
48
40
  trace_id: context.trace_id.to_i,
49
41
  span_id: context.parent_id.to_i,
50
- sampled: context.sampled?,
42
+ trace_sampling_priority: context.sampled? ? 1 : 0,
51
43
  )
44
+
45
+ ::Datadog::Tracing.continue_trace!(trace_digest)
52
46
  end
53
47
  end
54
48
 
55
- def trace_context(span = ::Datadog.tracer.active_span)
56
- return nil unless span
49
+ def trace_context
50
+ return nil unless trace = ::Datadog::Tracing.active_trace
57
51
 
58
52
  flags = 0
59
53
 
60
- if span.sampled
54
+ if trace.sampled?
61
55
  flags |= Context::SAMPLED
62
56
  end
63
57
 
64
58
  return Context.new(
65
- span.trace_id,
66
- span.span_id,
59
+ trace.id,
60
+ trace.active_span.span_id,
67
61
  flags,
68
62
  nil,
69
63
  remote: false,
@@ -23,7 +23,7 @@
23
23
  module Traces
24
24
  module Backend
25
25
  module Datadog
26
- VERSION = "0.3.0"
26
+ VERSION = "0.4.0"
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.3.0
4
+ version: 0.4.0
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-05 00:00:00.000000000 Z
39
+ date: 2022-06-09 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
metadata.gz.sig CHANGED
Binary file