datadog-lambda 0.8.0 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/datadog/lambda/trace/listener.rb +23 -9
- data/lib/datadog/lambda/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 15ddc462886c4a35ba66d327ebbc2be17c403b2d47cab973fa06e05d6df3d2d1
|
4
|
+
data.tar.gz: b90918aa8b2372e2149e4b084b5ee97d9a8268ebff7ebb83a0e1a6a3751488c1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 71b82b6b3ec47c17fff39fb4f3bfd40c6d2ef7ba477baa82de83a87bc710fc0114fa7aadc84153908db40de6af8437248e9634b8838a6d60af54e44fefbe8e29
|
7
|
+
data.tar.gz: ca9afd36577caa6b5efef5663add0b37e32bfa953b55ee2909bc2f104a139e0a6478fcddcdde67687537672ae88b2d50f81b3d79c4aefa2967c29cae4faf367b
|
@@ -37,15 +37,10 @@ module Datadog
|
|
37
37
|
def on_end; end
|
38
38
|
|
39
39
|
def on_wrap(request_context:, cold_start:, &block)
|
40
|
-
options =
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
request_id: request_context.aws_request_id,
|
45
|
-
resource_names: request_context.function_name
|
46
|
-
}
|
47
|
-
}
|
48
|
-
|
40
|
+
options = get_option_tags(
|
41
|
+
request_context: request_context,
|
42
|
+
cold_start: cold_start
|
43
|
+
)
|
49
44
|
options[:resource] = @handler_name
|
50
45
|
options[:service] = @function_name
|
51
46
|
options[:span_type] = 'serverless'
|
@@ -54,6 +49,25 @@ module Datadog
|
|
54
49
|
block.call
|
55
50
|
end
|
56
51
|
end
|
52
|
+
|
53
|
+
private
|
54
|
+
|
55
|
+
def get_option_tags(request_context:, cold_start:)
|
56
|
+
function_arn = request_context.invoked_function_arn.downcase
|
57
|
+
tk = function_arn.split(':')
|
58
|
+
function_arn = tk.length > 7 ? tk[0, 7].join(':') : function_arn
|
59
|
+
function_version = tk.length > 7 ? tk[7] : '$LATEST'
|
60
|
+
options = {
|
61
|
+
tags: {
|
62
|
+
cold_start: cold_start,
|
63
|
+
function_arn: function_arn,
|
64
|
+
function_version: function_version,
|
65
|
+
request_id: request_context.aws_request_id,
|
66
|
+
resource_names: request_context.function_name
|
67
|
+
}
|
68
|
+
}
|
69
|
+
options
|
70
|
+
end
|
57
71
|
end
|
58
72
|
end
|
59
73
|
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: 0.
|
4
|
+
version: 0.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Datadog, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-07-
|
11
|
+
date: 2020-07-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-xray-sdk
|
@@ -133,8 +133,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
133
133
|
- !ruby/object:Gem::Version
|
134
134
|
version: '0'
|
135
135
|
requirements: []
|
136
|
-
|
137
|
-
rubygems_version: 2.7.6
|
136
|
+
rubygems_version: 3.0.3
|
138
137
|
signing_key:
|
139
138
|
specification_version: 4
|
140
139
|
summary: Instruments your Ruby AWS Lambda functions with Datadog
|