Skip to content

Commit 821cf63

Browse files
chore: [SVLS-5973] account for the new function signature
1 parent 32b306b commit 821cf63

File tree

1 file changed

+34
-11
lines changed

1 file changed

+34
-11
lines changed

datadog_lambda/span_pointers.py

Lines changed: 34 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,24 @@ def _calculate_s3_span_pointers_for_object_created_s3_information(
8787
_aws_s3_object_span_pointer_description,
8888
)
8989

90-
span_pointer_description = _aws_s3_object_span_pointer_description(
91-
pointer_direction=_SpanPointerDirection.UPSTREAM,
92-
bucket=bucket,
93-
key=key,
94-
etag=etag,
95-
)
90+
try:
91+
span_pointer_description = _aws_s3_object_span_pointer_description(
92+
operation="S3.LambdaEvent",
93+
pointer_direction=_SpanPointerDirection.UPSTREAM,
94+
bucket=bucket,
95+
key=key,
96+
etag=etag,
97+
)
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+
96108
if span_pointer_description is None:
97109
return []
98110

@@ -140,11 +152,22 @@ def _calculate_dynamodb_span_pointers_for_event_record(
140152
_aws_dynamodb_item_span_pointer_description,
141153
)
142154

143-
span_pointer_description = _aws_dynamodb_item_span_pointer_description(
144-
pointer_direction=_SpanPointerDirection.UPSTREAM,
145-
table_name=table_name,
146-
primary_key=primary_key,
147-
)
155+
try:
156+
span_pointer_description = _aws_dynamodb_item_span_pointer_description(
157+
operation="DynamoDB.LambdaEvent",
158+
pointer_direction=_SpanPointerDirection.UPSTREAM,
159+
table_name=table_name,
160+
primary_key=primary_key,
161+
)
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+
148171
if span_pointer_description is None:
149172
return []
150173

0 commit comments

Comments
 (0)