datadog_lambda 6.101.0__tar.gz → 6.102.0__tar.gz
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.
- {datadog_lambda-6.101.0 → datadog_lambda-6.102.0}/PKG-INFO +1 -1
- {datadog_lambda-6.101.0 → datadog_lambda-6.102.0}/datadog_lambda/span_pointers.py +47 -14
- datadog_lambda-6.102.0/datadog_lambda/version.py +1 -0
- {datadog_lambda-6.101.0 → datadog_lambda-6.102.0}/pyproject.toml +1 -1
- datadog_lambda-6.101.0/datadog_lambda/version.py +0 -1
- {datadog_lambda-6.101.0 → datadog_lambda-6.102.0}/LICENSE +0 -0
- {datadog_lambda-6.101.0 → datadog_lambda-6.102.0}/LICENSE-3rdparty.csv +0 -0
- {datadog_lambda-6.101.0 → datadog_lambda-6.102.0}/NOTICE +0 -0
- {datadog_lambda-6.101.0 → datadog_lambda-6.102.0}/README.md +0 -0
- {datadog_lambda-6.101.0 → datadog_lambda-6.102.0}/datadog_lambda/__init__.py +0 -0
- {datadog_lambda-6.101.0 → datadog_lambda-6.102.0}/datadog_lambda/api.py +0 -0
- {datadog_lambda-6.101.0 → datadog_lambda-6.102.0}/datadog_lambda/cold_start.py +0 -0
- {datadog_lambda-6.101.0 → datadog_lambda-6.102.0}/datadog_lambda/constants.py +0 -0
- {datadog_lambda-6.101.0 → datadog_lambda-6.102.0}/datadog_lambda/dogstatsd.py +0 -0
- {datadog_lambda-6.101.0 → datadog_lambda-6.102.0}/datadog_lambda/extension.py +0 -0
- {datadog_lambda-6.101.0 → datadog_lambda-6.102.0}/datadog_lambda/handler.py +0 -0
- {datadog_lambda-6.101.0 → datadog_lambda-6.102.0}/datadog_lambda/logger.py +0 -0
- {datadog_lambda-6.101.0 → datadog_lambda-6.102.0}/datadog_lambda/metric.py +0 -0
- {datadog_lambda-6.101.0 → datadog_lambda-6.102.0}/datadog_lambda/module_name.py +0 -0
- {datadog_lambda-6.101.0 → datadog_lambda-6.102.0}/datadog_lambda/patch.py +0 -0
- {datadog_lambda-6.101.0 → datadog_lambda-6.102.0}/datadog_lambda/stats_writer.py +0 -0
- {datadog_lambda-6.101.0 → datadog_lambda-6.102.0}/datadog_lambda/statsd_writer.py +0 -0
- {datadog_lambda-6.101.0 → datadog_lambda-6.102.0}/datadog_lambda/tag_object.py +0 -0
- {datadog_lambda-6.101.0 → datadog_lambda-6.102.0}/datadog_lambda/tags.py +0 -0
- {datadog_lambda-6.101.0 → datadog_lambda-6.102.0}/datadog_lambda/thread_stats_writer.py +0 -0
- {datadog_lambda-6.101.0 → datadog_lambda-6.102.0}/datadog_lambda/tracing.py +0 -0
- {datadog_lambda-6.101.0 → datadog_lambda-6.102.0}/datadog_lambda/trigger.py +0 -0
- {datadog_lambda-6.101.0 → datadog_lambda-6.102.0}/datadog_lambda/wrapper.py +0 -0
- {datadog_lambda-6.101.0 → datadog_lambda-6.102.0}/datadog_lambda/xray.py +0 -0
|
@@ -2,6 +2,7 @@ from itertools import chain
|
|
|
2
2
|
import logging
|
|
3
3
|
import os
|
|
4
4
|
from typing import List
|
|
5
|
+
from typing import Optional
|
|
5
6
|
|
|
6
7
|
from ddtrace._trace._span_pointer import _SpanPointerDirection
|
|
7
8
|
from ddtrace._trace._span_pointer import _SpanPointerDescription
|
|
@@ -30,7 +31,7 @@ def calculate_span_pointers(
|
|
|
30
31
|
return _calculate_dynamodb_span_pointers_for_event(event)
|
|
31
32
|
|
|
32
33
|
except Exception as e:
|
|
33
|
-
logger.
|
|
34
|
+
logger.debug(
|
|
34
35
|
"failed to calculate span pointers for event: %s",
|
|
35
36
|
e,
|
|
36
37
|
)
|
|
@@ -75,7 +76,7 @@ def _calculate_s3_span_pointers_for_object_created_s3_information(
|
|
|
75
76
|
etag = s3_information["object"]["eTag"]
|
|
76
77
|
|
|
77
78
|
except KeyError as e:
|
|
78
|
-
logger.
|
|
79
|
+
logger.debug(
|
|
79
80
|
"missing s3 information required to make a span pointer: %s",
|
|
80
81
|
e,
|
|
81
82
|
)
|
|
@@ -86,17 +87,31 @@ def _calculate_s3_span_pointers_for_object_created_s3_information(
|
|
|
86
87
|
_aws_s3_object_span_pointer_description,
|
|
87
88
|
)
|
|
88
89
|
|
|
89
|
-
|
|
90
|
-
_aws_s3_object_span_pointer_description(
|
|
90
|
+
try:
|
|
91
|
+
span_pointer_description = _aws_s3_object_span_pointer_description(
|
|
92
|
+
operation="S3.LambdaEvent",
|
|
91
93
|
pointer_direction=_SpanPointerDirection.UPSTREAM,
|
|
92
94
|
bucket=bucket,
|
|
93
95
|
key=key,
|
|
94
96
|
etag=etag,
|
|
95
97
|
)
|
|
96
|
-
|
|
98
|
+
except TypeError:
|
|
99
|
+
# The older version of this function did not have an operation
|
|
100
|
+
# parameter.
|
|
101
|
+
span_pointer_description = _aws_s3_object_span_pointer_description(
|
|
102
|
+
pointer_direction=_SpanPointerDirection.UPSTREAM,
|
|
103
|
+
bucket=bucket,
|
|
104
|
+
key=key,
|
|
105
|
+
etag=etag,
|
|
106
|
+
)
|
|
107
|
+
|
|
108
|
+
if span_pointer_description is None:
|
|
109
|
+
return []
|
|
110
|
+
|
|
111
|
+
return [span_pointer_description]
|
|
97
112
|
|
|
98
113
|
except Exception as e:
|
|
99
|
-
logger.
|
|
114
|
+
logger.debug(
|
|
100
115
|
"failed to generate S3 span pointer: %s",
|
|
101
116
|
e,
|
|
102
117
|
)
|
|
@@ -120,10 +135,13 @@ def _calculate_dynamodb_span_pointers_for_event_record(
|
|
|
120
135
|
) -> List[_SpanPointerDescription]:
|
|
121
136
|
try:
|
|
122
137
|
table_name = _extract_table_name_from_dynamodb_stream_record(record)
|
|
138
|
+
if table_name is None:
|
|
139
|
+
return []
|
|
140
|
+
|
|
123
141
|
primary_key = record["dynamodb"]["Keys"]
|
|
124
142
|
|
|
125
143
|
except Exception as e:
|
|
126
|
-
logger.
|
|
144
|
+
logger.debug(
|
|
127
145
|
"missing DynamoDB information required to make a span pointer: %s",
|
|
128
146
|
e,
|
|
129
147
|
)
|
|
@@ -134,23 +152,36 @@ def _calculate_dynamodb_span_pointers_for_event_record(
|
|
|
134
152
|
_aws_dynamodb_item_span_pointer_description,
|
|
135
153
|
)
|
|
136
154
|
|
|
137
|
-
|
|
138
|
-
_aws_dynamodb_item_span_pointer_description(
|
|
155
|
+
try:
|
|
156
|
+
span_pointer_description = _aws_dynamodb_item_span_pointer_description(
|
|
157
|
+
operation="DynamoDB.LambdaEvent",
|
|
139
158
|
pointer_direction=_SpanPointerDirection.UPSTREAM,
|
|
140
159
|
table_name=table_name,
|
|
141
160
|
primary_key=primary_key,
|
|
142
161
|
)
|
|
143
|
-
|
|
162
|
+
except TypeError:
|
|
163
|
+
# The older version of this function did not have an operation
|
|
164
|
+
# parameter.
|
|
165
|
+
span_pointer_description = _aws_dynamodb_item_span_pointer_description(
|
|
166
|
+
pointer_direction=_SpanPointerDirection.UPSTREAM,
|
|
167
|
+
table_name=table_name,
|
|
168
|
+
primary_key=primary_key,
|
|
169
|
+
)
|
|
170
|
+
|
|
171
|
+
if span_pointer_description is None:
|
|
172
|
+
return []
|
|
173
|
+
|
|
174
|
+
return [span_pointer_description]
|
|
144
175
|
|
|
145
176
|
except Exception as e:
|
|
146
|
-
logger.
|
|
177
|
+
logger.debug(
|
|
147
178
|
"failed to generate DynamoDB span pointer: %s",
|
|
148
179
|
e,
|
|
149
180
|
)
|
|
150
181
|
return []
|
|
151
182
|
|
|
152
183
|
|
|
153
|
-
def _extract_table_name_from_dynamodb_stream_record(record) -> str:
|
|
184
|
+
def _extract_table_name_from_dynamodb_stream_record(record) -> Optional[str]:
|
|
154
185
|
# Example eventSourceARN:
|
|
155
186
|
# arn:aws:dynamodb:us-east-2:123456789012:table/my-table/stream/2024-06-10T19:26:16.525
|
|
156
187
|
event_source_arn = record["eventSourceARN"]
|
|
@@ -159,10 +190,12 @@ def _extract_table_name_from_dynamodb_stream_record(record) -> str:
|
|
|
159
190
|
":", maxsplit=5
|
|
160
191
|
)
|
|
161
192
|
if _arn != "arn" or _aws != "aws" or _dynamodb != "dynamodb":
|
|
162
|
-
|
|
193
|
+
logger.debug("unexpected eventSourceARN format: %s", event_source_arn)
|
|
194
|
+
return None
|
|
163
195
|
|
|
164
196
|
[_table, table_name, _stream, _timestamp] = dynamodb_info.split("/")
|
|
165
197
|
if _table != "table" or _stream != "stream":
|
|
166
|
-
|
|
198
|
+
logger.debug("unexpected eventSourceARN format: %s", event_source_arn)
|
|
199
|
+
return None
|
|
167
200
|
|
|
168
201
|
return table_name
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "6.102.0"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "6.101.0"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|