@@ -96,9 +96,7 @@ def handle_s3(operation_name, service, instance, args, kwargs, context):
96
96
bucket = ""
97
97
signature = f"S3 { operation_name } { bucket } "
98
98
99
- context ["destination" ]["name" ] = span_subtype
100
- context ["destination" ]["resource" ] = bucket
101
- context ["destination" ]["service" ] = {"type" : span_type }
99
+ context ["destination" ]["service" ] = {"name" : span_subtype , "resource" : bucket , "type" : span_type }
102
100
103
101
return HandlerInfo (signature , span_type , span_subtype , span_action , context )
104
102
@@ -117,9 +115,7 @@ def handle_dynamodb(operation_name, service, instance, args, kwargs, context):
117
115
if operation_name == "Query" and len (args ) > 1 and "KeyConditionExpression" in args [1 ]:
118
116
context ["db" ]["statement" ] = args [1 ]["KeyConditionExpression" ]
119
117
120
- context ["destination" ]["name" ] = span_subtype
121
- context ["destination" ]["resource" ] = table
122
- context ["destination" ]["service" ] = {"type" : span_type }
118
+ context ["destination" ]["service" ] = {"name" : span_subtype , "resource" : table , "type" : span_type }
123
119
return HandlerInfo (signature , span_type , span_subtype , span_action , context )
124
120
125
121
@@ -137,9 +133,11 @@ def handle_sns(operation_name, service, instance, args, kwargs, context):
137
133
if "TopicArn" in args [1 ]:
138
134
topic_name = args [1 ]["TopicArn" ].rsplit (":" , maxsplit = 1 )[- 1 ]
139
135
signature = f"SNS { operation_name } { topic_name } " .rstrip ()
140
- context ["destination" ]["name" ] = span_subtype
141
- context ["destination" ]["resource" ] = f"{ span_subtype } /{ topic_name } " if topic_name else span_subtype
142
- context ["destination" ]["type" ] = span_type
136
+ context ["destination" ]["service" ] = {
137
+ "name" : span_subtype ,
138
+ "resource" : f"{ span_subtype } /{ topic_name } " if topic_name else span_subtype ,
139
+ "type" : span_type ,
140
+ }
143
141
return HandlerInfo (signature , span_type , span_subtype , span_action , context )
144
142
145
143
@@ -152,6 +150,8 @@ def handle_default(operation_name, service, instance, args, kwargs, destination)
152
150
span_subtype = service .lower ()
153
151
span_action = operation_name
154
152
153
+ destination ["service" ] = {"name" : span_subtype , "resource" : span_subtype , "type" : span_type }
154
+
155
155
signature = f"{ service } :{ operation_name } "
156
156
return HandlerInfo (signature , span_type , span_subtype , span_action , destination )
157
157
0 commit comments