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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/traces/backend/datadog/interface.rb +20 -19
- data/lib/traces/backend/datadog/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +9 -9
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 040d8f2bc0f1a70fc3d5fa0174a3aecd9665c0c867600cd6f247f57793e4a8f9
|
4
|
+
data.tar.gz: 32ca025f992d65699eab61e4efeb8e5b36a74d362a06b7d3951d6d9d904be12e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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 '
|
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.
|
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
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
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
|
55
|
-
return nil unless
|
55
|
+
def trace_context
|
56
|
+
return nil unless trace = ::Datadog::Tracing.active_trace
|
56
57
|
|
57
58
|
flags = 0
|
58
59
|
|
59
|
-
if
|
60
|
+
if trace.sampled?
|
60
61
|
flags |= Context::SAMPLED
|
61
62
|
end
|
62
63
|
|
63
64
|
return Context.new(
|
64
|
-
|
65
|
-
|
65
|
+
trace.id,
|
66
|
+
trace.active_span.span_id,
|
66
67
|
flags,
|
67
68
|
nil,
|
68
69
|
remote: false,
|
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.
|
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-
|
39
|
+
date: 2022-06-10 00:00:00.000000000 Z
|
40
40
|
dependencies:
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: ddtrace
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
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:
|
54
|
+
version: '1.0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: traces
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
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:
|
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.
|
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
|