datadog-lambda 0.8.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 88a466fc2c14e5abead82a19cf71b2f7b96005ce98570475ed894c8ab98504c9
4
- data.tar.gz: 69d3a77bc438037552865f7c6649ee3130b32d4c179a2c73ac6a35abcd3b3981
3
+ metadata.gz: 15ddc462886c4a35ba66d327ebbc2be17c403b2d47cab973fa06e05d6df3d2d1
4
+ data.tar.gz: b90918aa8b2372e2149e4b084b5ee97d9a8268ebff7ebb83a0e1a6a3751488c1
5
5
  SHA512:
6
- metadata.gz: 15677a13c06d71ecc401db19e5b36baca72c252ba078105bca108c1388d2ee4542c23588eade9447e7c2611d2f7a696318d41fc8f27d3ad28dbff6dccdbab356
7
- data.tar.gz: f1735e753b714ff1d43d444bb0b623c93b3714e54f54509f7ddb31e36eee3f6748938f56455b6c73f824bf4f27f6e03fbb675655131a3d066f9f9c3eea0f5289
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
- tags: {
42
- cold_start: cold_start,
43
- function_arn: request_context.invoked_function_arn.downcase,
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
@@ -12,7 +12,7 @@ module Datadog
12
12
  module Lambda
13
13
  module VERSION
14
14
  MAJOR = 0
15
- MINOR = 8
15
+ MINOR = 9
16
16
  PATCH = 0
17
17
  PRE = nil
18
18
 
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.8.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-09 00:00:00.000000000 Z
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
- rubyforge_project:
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