datadog-lambda 2.22.0 → 2.23.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9cddc5701e2fd24ab4ae01089f2eb7a1beee75da183f2540060639a898279637
|
4
|
+
data.tar.gz: 94ba04342ac432d6ab95d40bbfbbbfb44b2e186a84c8571e1e2c93514448b29b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 784af632d4b1a84667eb6ff68a32cea62c92d3861237bc414eee868f6c39c9d257153330d691eb53c6e496ce5dadc366e18f03b4e79550b3ded5718692b49d64
|
7
|
+
data.tar.gz: 720cfbdba885607139157881b78a3ce398368e96828d896b9782d57a5d75b45f8fe27e348f097732db65e36c7f5c250cc6160ae5db4ffebff9e7d6de1d8aa001
|
@@ -10,15 +10,15 @@ end
|
|
10
10
|
module Datadog
|
11
11
|
# TraceListener tracks tracing context information
|
12
12
|
module Trace
|
13
|
-
class <<self
|
13
|
+
class << self
|
14
14
|
def apply_datadog_trace_context(context)
|
15
15
|
unless context.nil?
|
16
16
|
trace_id = context[:trace_id].to_i
|
17
17
|
span_id = context[:parent_id].to_i
|
18
18
|
sampling_priority = context[:sample_mode]
|
19
19
|
trace_digest = Datadog::Tracing::TraceDigest.new(
|
20
|
-
span_id
|
21
|
-
trace_id
|
20
|
+
span_id:,
|
21
|
+
trace_id:,
|
22
22
|
trace_sampling_priority: sampling_priority
|
23
23
|
)
|
24
24
|
Datadog::Tracing.continue_trace!(trace_digest)
|
@@ -32,8 +32,8 @@ module Datadog
|
|
32
32
|
Datadog::Trace.trace_context = trace_context
|
33
33
|
Datadog::Utils.logger.debug "extracted trace context #{trace_context}"
|
34
34
|
options = get_option_tags(
|
35
|
-
request_context
|
36
|
-
cold_start:
|
35
|
+
request_context:,
|
36
|
+
cold_start:
|
37
37
|
)
|
38
38
|
context = Datadog::Trace.trace_context
|
39
39
|
source = context[:source] if context
|
@@ -43,7 +43,7 @@ module Datadog
|
|
43
43
|
options[:span_type] = 'serverless'
|
44
44
|
Datadog::Trace.apply_datadog_trace_context(Datadog::Trace.trace_context)
|
45
45
|
|
46
|
-
trace_digest = Datadog::Utils.send_start_invocation_request(event:
|
46
|
+
trace_digest = Datadog::Utils.send_start_invocation_request(event:)
|
47
47
|
# Only continue trace from a new one if it exist, or else,
|
48
48
|
# it will create a new trace, which is not ideal here.
|
49
49
|
options[:continue_from] = trace_digest if trace_digest
|
@@ -53,7 +53,7 @@ module Datadog
|
|
53
53
|
# rubocop:enable Metrics/AbcSize
|
54
54
|
|
55
55
|
def on_end(response:)
|
56
|
-
Datadog::Utils.send_end_invocation_request(response:
|
56
|
+
Datadog::Utils.send_end_invocation_request(response:)
|
57
57
|
@trace&.finish
|
58
58
|
end
|
59
59
|
|
@@ -65,17 +65,16 @@ module Datadog
|
|
65
65
|
function_arn = tk.length > 7 ? tk[0, 7].join(':') : function_arn
|
66
66
|
function_version = tk.length > 7 ? tk[7] : '$LATEST'
|
67
67
|
function_name = request_context.function_name
|
68
|
-
|
68
|
+
{
|
69
69
|
tags: {
|
70
|
-
cold_start
|
71
|
-
function_arn
|
72
|
-
function_version
|
70
|
+
cold_start:,
|
71
|
+
function_arn:,
|
72
|
+
function_version:,
|
73
73
|
request_id: request_context.aws_request_id,
|
74
74
|
functionname: function_name.nil? || function_name.empty? ? nil : function_name.downcase,
|
75
75
|
resource_names: function_name
|
76
76
|
}
|
77
77
|
}
|
78
|
-
options
|
79
78
|
end
|
80
79
|
end
|
81
80
|
end
|
@@ -30,9 +30,9 @@ module Datadog
|
|
30
30
|
return nil
|
31
31
|
end
|
32
32
|
{
|
33
|
-
trace_id
|
34
|
-
parent_id
|
35
|
-
sample_mode
|
33
|
+
trace_id:,
|
34
|
+
parent_id:,
|
35
|
+
sample_mode:,
|
36
36
|
source: SOURCE_XRAY
|
37
37
|
}
|
38
38
|
end
|
@@ -95,7 +95,7 @@ module Datadog
|
|
95
95
|
trace_id, parent_id, sampled = header.split(';')
|
96
96
|
.map { |v| parse_assignment(v) }
|
97
97
|
|
98
|
-
return nil if trace_id.nil? || parent_id.nil? || sampled.
|
98
|
+
return nil if trace_id.nil? || parent_id.nil? || sampled.nil?
|
99
99
|
|
100
100
|
{
|
101
101
|
xray_trace_id: trace_id,
|
data/lib/datadog/lambda.rb
CHANGED
@@ -61,7 +61,7 @@ module Datadog
|
|
61
61
|
record_enhanced('invocations', context)
|
62
62
|
begin
|
63
63
|
cold = @is_cold_start
|
64
|
-
@listener&.on_start(event
|
64
|
+
@listener&.on_start(event:, request_context: context, cold_start: cold)
|
65
65
|
@response = block.call
|
66
66
|
rescue StandardError => e
|
67
67
|
record_enhanced('errors', context)
|
@@ -88,7 +88,7 @@ module Datadog
|
|
88
88
|
raise 'name must be a string' unless name.is_a?(String)
|
89
89
|
raise 'value must be a number' unless value.is_a?(Numeric)
|
90
90
|
|
91
|
-
@metrics_client.distribution(name, value, time
|
91
|
+
@metrics_client.distribution(name, value, time:, **tags)
|
92
92
|
end
|
93
93
|
|
94
94
|
def self.dd_lambda_layer_tag
|
@@ -129,7 +129,7 @@ module Datadog
|
|
129
129
|
tags[:executedversion] = context.function_version
|
130
130
|
end
|
131
131
|
# Append the alias to the resource tag
|
132
|
-
tags[:resource] = context.function_name
|
132
|
+
tags[:resource] = "#{context.function_name}:#{function_alias}"
|
133
133
|
end
|
134
134
|
|
135
135
|
tags
|
@@ -196,7 +196,7 @@ module Datadog
|
|
196
196
|
handler_name: handler,
|
197
197
|
function_name: function,
|
198
198
|
patch_http: @patch_http,
|
199
|
-
merge_xray_traces:
|
199
|
+
merge_xray_traces:
|
200
200
|
)
|
201
201
|
end
|
202
202
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: datadog-lambda
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.23.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Datadog, Inc.
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-09-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-xray-sdk
|
@@ -38,20 +38,34 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '5.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: nokogiri
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 1.16.0
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 1.16.0
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: ddtrace
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
44
58
|
requirements:
|
45
59
|
- - "~>"
|
46
60
|
- !ruby/object:Gem::Version
|
47
|
-
version: 1.
|
61
|
+
version: 1.23.3
|
48
62
|
type: :development
|
49
63
|
prerelease: false
|
50
64
|
version_requirements: !ruby/object:Gem::Requirement
|
51
65
|
requirements:
|
52
66
|
- - "~>"
|
53
67
|
- !ruby/object:Gem::Version
|
54
|
-
version: 1.
|
68
|
+
version: 1.23.3
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
70
|
name: rake
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -100,14 +114,14 @@ dependencies:
|
|
100
114
|
requirements:
|
101
115
|
- - "~>"
|
102
116
|
- !ruby/object:Gem::Version
|
103
|
-
version: '
|
117
|
+
version: '1'
|
104
118
|
type: :development
|
105
119
|
prerelease: false
|
106
120
|
version_requirements: !ruby/object:Gem::Requirement
|
107
121
|
requirements:
|
108
122
|
- - "~>"
|
109
123
|
- !ruby/object:Gem::Version
|
110
|
-
version: '
|
124
|
+
version: '1'
|
111
125
|
- !ruby/object:Gem::Dependency
|
112
126
|
name: solargraph
|
113
127
|
requirement: !ruby/object:Gem::Requirement
|
@@ -148,7 +162,7 @@ licenses:
|
|
148
162
|
- Apache-2.0
|
149
163
|
metadata:
|
150
164
|
allowed_push_host: https://rubygems.org
|
151
|
-
post_install_message:
|
165
|
+
post_install_message:
|
152
166
|
rdoc_options: []
|
153
167
|
require_paths:
|
154
168
|
- lib
|
@@ -156,15 +170,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
156
170
|
requirements:
|
157
171
|
- - ">="
|
158
172
|
- !ruby/object:Gem::Version
|
159
|
-
version: 2.
|
173
|
+
version: 3.2.0
|
160
174
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
161
175
|
requirements:
|
162
176
|
- - ">="
|
163
177
|
- !ruby/object:Gem::Version
|
164
178
|
version: '0'
|
165
179
|
requirements: []
|
166
|
-
rubygems_version: 3.
|
167
|
-
signing_key:
|
180
|
+
rubygems_version: 3.5.3
|
181
|
+
signing_key:
|
168
182
|
specification_version: 4
|
169
183
|
summary: Instruments your Ruby AWS Lambda functions with Datadog
|
170
184
|
test_files: []
|