console-output-datadog 0.2.0 → 0.4.0
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/console/output/datadog/version.rb +3 -20
- data/lib/console/output/datadog/wrapper.rb +25 -6
- data/lib/console/output/datadog.rb +2 -19
- data/license.md +22 -0
- data/readme.md +27 -0
- data.tar.gz.sig +0 -0
- metadata +32 -43
- 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: 752c83de9079facd51a560278f4e526cf2e3fe50411f70355fc2b22f0ecc156f
|
4
|
+
data.tar.gz: 5939cf8ddadd5d55a3946ed6a474dc5a73263f43a344c752e1391b7b7f65f323
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2929aa0415b40d4e3ae85d7d48b38a703af6d5ff33a5831a50d7cccc2ce49b1f28d63fb22958cda5ccd163c8143f5f6cb2e95de344a02ae7396b9aaa19741897
|
7
|
+
data.tar.gz: '08e3adf7b6aba68af6d4ac230990fc1091e29dc2c89ffef184ab445aed98ccdc6f39937bad309404f7d4dcf5e11e5f4d5d2f43a19fbb493b8100a174ae2404aa'
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
@@ -1,29 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
#
|
4
|
-
#
|
5
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
# of this software and associated documentation files (the "Software"), to deal
|
7
|
-
# in the Software without restriction, including without limitation the rights
|
8
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
# copies of the Software, and to permit persons to whom the Software is
|
10
|
-
# furnished to do so, subject to the following conditions:
|
11
|
-
#
|
12
|
-
# The above copyright notice and this permission notice shall be included in
|
13
|
-
# all copies or substantial portions of the Software.
|
14
|
-
#
|
15
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
-
# THE SOFTWARE.
|
3
|
+
# Released under the MIT License.
|
4
|
+
# Copyright, 2021-2023, by Samuel Williams.
|
22
5
|
|
23
6
|
module Console
|
24
7
|
module Output
|
25
8
|
module Datadog
|
26
|
-
VERSION = "0.
|
9
|
+
VERSION = "0.4.0"
|
27
10
|
end
|
28
11
|
end
|
29
12
|
end
|
@@ -1,3 +1,9 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Released under the MIT License.
|
4
|
+
# Copyright, 2021-2023, by Samuel Williams.
|
5
|
+
# Copyright, 2022, by Catalino Cuadrado.
|
6
|
+
|
1
7
|
require 'ddtrace'
|
2
8
|
# frozen_string_literal: true
|
3
9
|
|
@@ -21,6 +27,8 @@ require 'ddtrace'
|
|
21
27
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
22
28
|
# THE SOFTWARE.
|
23
29
|
|
30
|
+
# frozen_string_literal: true
|
31
|
+
|
24
32
|
module Console
|
25
33
|
module Output
|
26
34
|
# The reason why this is a serialized logger rather than an output filter, is because it needs to directly modify the top level of the record.
|
@@ -32,16 +40,27 @@ module Console
|
|
32
40
|
|
33
41
|
def call(subject = nil, *arguments, **options, &block)
|
34
42
|
if trace = ::Datadog::Tracing.active_trace
|
35
|
-
span = trace.active_span
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
43
|
+
if span = trace.active_span
|
44
|
+
options[:dd] = {
|
45
|
+
span_id: span.id.to_s,
|
46
|
+
trace_id: format_trace_id(trace.id)
|
47
|
+
}
|
48
|
+
else
|
49
|
+
options[:dd] = {
|
50
|
+
trace_id: format_trace_id(trace.id)
|
51
|
+
}
|
52
|
+
end
|
41
53
|
end
|
42
54
|
|
43
55
|
@output.call(subject, *arguments, **options, &block)
|
44
56
|
end
|
57
|
+
|
58
|
+
private
|
59
|
+
|
60
|
+
def format_trace_id(id)
|
61
|
+
# 128-bit tracing is not supported by the Datadog agent, so we need to convert it to 64-bit. We expect that this will be changed in the future.
|
62
|
+
::Datadog::Tracing::Utils::TraceId.to_low_order(id).to_s
|
63
|
+
end
|
45
64
|
end
|
46
65
|
end
|
47
66
|
end
|
@@ -1,24 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
#
|
4
|
-
#
|
5
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
# of this software and associated documentation files (the "Software"), to deal
|
7
|
-
# in the Software without restriction, including without limitation the rights
|
8
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
# copies of the Software, and to permit persons to whom the Software is
|
10
|
-
# furnished to do so, subject to the following conditions:
|
11
|
-
#
|
12
|
-
# The above copyright notice and this permission notice shall be included in
|
13
|
-
# all copies or substantial portions of the Software.
|
14
|
-
#
|
15
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
-
# THE SOFTWARE.
|
3
|
+
# Released under the MIT License.
|
4
|
+
# Copyright, 2021-2023, by Samuel Williams.
|
22
5
|
|
23
6
|
begin
|
24
7
|
require 'ddtrace'
|
data/license.md
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
# MIT License
|
2
|
+
|
3
|
+
Copyright, 2021-2023, by Samuel Williams.
|
4
|
+
Copyright, 2022, by Catalino Cuadrado.
|
5
|
+
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
8
|
+
in the Software without restriction, including without limitation the rights
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
11
|
+
furnished to do so, subject to the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be included in all
|
14
|
+
copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
22
|
+
SOFTWARE.
|
data/readme.md
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
# Console::Output::Datadog
|
2
|
+
|
3
|
+
Attach Datadog `trace_id` and `span_id` to log entries.
|
4
|
+
|
5
|
+
[![Development Status](https://github.com/socketry/console-output-datadog/workflows/Test/badge.svg)](https://github.com/socketry/console-output-datadog/actions?workflow=Test)
|
6
|
+
|
7
|
+
## Usage
|
8
|
+
|
9
|
+
Please see the [project documentation](https://socketry.github.io/console-output-datadog).
|
10
|
+
|
11
|
+
## Contributing
|
12
|
+
|
13
|
+
We welcome contributions to this project.
|
14
|
+
|
15
|
+
1. Fork it.
|
16
|
+
2. Create your feature branch (`git checkout -b my-new-feature`).
|
17
|
+
3. Commit your changes (`git commit -am 'Add some feature'`).
|
18
|
+
4. Push to the branch (`git push origin my-new-feature`).
|
19
|
+
5. Create new Pull Request.
|
20
|
+
|
21
|
+
### Developer Certificate of Origin
|
22
|
+
|
23
|
+
This project uses the [Developer Certificate of Origin](https://developercertificate.org/). All contributors to this project must agree to this document to have their contributions accepted.
|
24
|
+
|
25
|
+
### Contributor Covenant
|
26
|
+
|
27
|
+
This project is governed by [Contributor Covenant](https://www.contributor-covenant.org/). All contributors and participants agree to abide by its terms.
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: console-output-datadog
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
@@ -11,33 +11,34 @@ bindir: bin
|
|
11
11
|
cert_chain:
|
12
12
|
- |
|
13
13
|
-----BEGIN CERTIFICATE-----
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-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jKcXcY//qiSW
|
28
|
+
xm4erY3XAgMBAAGjgZowgZcwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAwHQYDVR0O
|
29
|
+
BBYEFO9t7XWuFf2SKLmuijgqR4sGDlRsMC4GA1UdEQQnMCWBI3NhbXVlbC53aWxs
|
30
|
+
aWFtc0BvcmlvbnRyYW5zZmVyLmNvLm56MC4GA1UdEgQnMCWBI3NhbXVlbC53aWxs
|
31
|
+
aWFtc0BvcmlvbnRyYW5zZmVyLmNvLm56MA0GCSqGSIb3DQEBCwUAA4IBgQB5sxkE
|
32
|
+
cBsSYwK6fYpM+hA5B5yZY2+L0Z+27jF1pWGgbhPH8/FjjBLVn+VFok3CDpRqwXCl
|
33
|
+
xCO40JEkKdznNy2avOMra6PFiQyOE74kCtv7P+Fdc+FhgqI5lMon6tt9rNeXmnW/
|
34
|
+
c1NaMRdxy999hmRGzUSFjozcCwxpy/LwabxtdXwXgSay4mQ32EDjqR1TixS1+smp
|
35
|
+
8C/NCWgpIfzpHGJsjvmH2wAfKtTTqB9CVKLCWEnCHyCaRVuKkrKjqhYCdmMBqCws
|
36
|
+
JkxfQWC+jBVeG9ZtPhQgZpfhvh+6hMhraUYRQ6XGyvBqEUe+yo6DKIT3MtGE2+CP
|
37
|
+
eX9i9ZWBydWb8/rvmwmX2kkcBbX0hZS1rcR593hGc61JR6lvkGYQ2MYskBveyaxt
|
38
|
+
Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
|
39
|
+
voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
|
39
40
|
-----END CERTIFICATE-----
|
40
|
-
date:
|
41
|
+
date: 2024-02-08 00:00:00.000000000 Z
|
41
42
|
dependencies:
|
42
43
|
- !ruby/object:Gem::Dependency
|
43
44
|
name: console
|
@@ -67,20 +68,6 @@ dependencies:
|
|
67
68
|
- - "~>"
|
68
69
|
- !ruby/object:Gem::Version
|
69
70
|
version: '1.0'
|
70
|
-
- !ruby/object:Gem::Dependency
|
71
|
-
name: rspec
|
72
|
-
requirement: !ruby/object:Gem::Requirement
|
73
|
-
requirements:
|
74
|
-
- - ">="
|
75
|
-
- !ruby/object:Gem::Version
|
76
|
-
version: '0'
|
77
|
-
type: :development
|
78
|
-
prerelease: false
|
79
|
-
version_requirements: !ruby/object:Gem::Requirement
|
80
|
-
requirements:
|
81
|
-
- - ">="
|
82
|
-
- !ruby/object:Gem::Version
|
83
|
-
version: '0'
|
84
71
|
description:
|
85
72
|
email:
|
86
73
|
executables: []
|
@@ -90,6 +77,8 @@ files:
|
|
90
77
|
- lib/console/output/datadog.rb
|
91
78
|
- lib/console/output/datadog/version.rb
|
92
79
|
- lib/console/output/datadog/wrapper.rb
|
80
|
+
- license.md
|
81
|
+
- readme.md
|
93
82
|
homepage: https://github.com/socketry/console-output-datadog
|
94
83
|
licenses:
|
95
84
|
- MIT
|
@@ -102,14 +91,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
102
91
|
requirements:
|
103
92
|
- - ">="
|
104
93
|
- !ruby/object:Gem::Version
|
105
|
-
version: '
|
94
|
+
version: '2.7'
|
106
95
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
107
96
|
requirements:
|
108
97
|
- - ">="
|
109
98
|
- !ruby/object:Gem::Version
|
110
99
|
version: '0'
|
111
100
|
requirements: []
|
112
|
-
rubygems_version: 3.
|
101
|
+
rubygems_version: 3.5.3
|
113
102
|
signing_key:
|
114
103
|
specification_version: 4
|
115
104
|
summary: Attach Datadog trace and span details to logs.
|
metadata.gz.sig
CHANGED
Binary file
|