File tree 1 file changed +10
-4
lines changed
1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change 2
2
import logging
3
3
from typing import List
4
4
5
- from ddtrace ._trace .utils_botocore .span_pointers import _aws_s3_object_span_pointer_description
5
+ from ddtrace ._trace .utils_botocore .span_pointers import (
6
+ _aws_s3_object_span_pointer_description ,
7
+ )
6
8
from ddtrace ._trace ._span_pointer import _SpanPointerDirection
7
9
from ddtrace ._trace ._span_pointer import _SpanPointerDescription
8
10
from datadog_lambda .trigger import EventTypes
@@ -40,20 +42,24 @@ def _calculate_s3_span_pointers_for_event(event) -> List[_SpanPointerDescription
40
42
)
41
43
42
44
43
- def _calculate_s3_span_pointers_for_event_record (record ) -> List [_SpanPointerDescription ]:
45
+ def _calculate_s3_span_pointers_for_event_record (
46
+ record ,
47
+ ) -> List [_SpanPointerDescription ]:
44
48
# Event types:
45
49
# https://docs.aws.amazon.com/AmazonS3/latest/userguide/notification-how-to-event-types-and-destinations.html
46
50
47
51
if record .get ("eventName" ).startswith ("ObjectCreated:" ):
48
52
s3_information = record .get ("s3" , None )
49
53
if s3_information is not None :
50
- return _calculate_s3_span_pointers_for_object_created_s3_information (s3_information )
54
+ return _calculate_s3_span_pointers_for_object_created_s3_information (
55
+ s3_information
56
+ )
51
57
52
58
return []
53
59
54
60
55
61
def _calculate_s3_span_pointers_for_object_created_s3_information (
56
- s3_information
62
+ s3_information ,
57
63
) -> List [_SpanPointerDescription ]:
58
64
try :
59
65
bucket = s3_information ["bucket" ]["name" ]
You can’t perform that action at this time.
0 commit comments