Skip to content

Commit 457b01e

Browse files
committed
adding tracing for dynamodb module
1 parent 7b48225 commit 457b01e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

aws_sra_examples/solutions/genai/bedrock_org/lambda/src/sra_dynamodb.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ def insert_item(self, table_name, dynamodb_resource, solution_name):
108108
return record_id, date_time
109109

110110
def update_item(self, table_name, dynamodb_resource, solution_name, record_id, attributes_and_values):
111+
self.LOGGER.info(f"Updating {table_name} dynamodb table with {attributes_and_values}")
111112
table = dynamodb_resource.Table(table_name)
112113
update_expression = ""
113114
expression_attribute_values = {}
@@ -141,6 +142,7 @@ def find_item(self, table_name, dynamodb_resource, solution_name, additional_att
141142
Returns:
142143
True and the item if found, otherwise False and empty dict
143144
"""
145+
self.LOGGER.info(f"Searching for {additional_attributes} in {table_name} dynamodb table")
144146
table = dynamodb_resource.Table(table_name)
145147
expression_attribute_values = {":solution_name": solution_name}
146148

@@ -164,7 +166,7 @@ def find_item(self, table_name, dynamodb_resource, solution_name, additional_att
164166
)
165167
elif len(response["Items"]) < 1:
166168
return False, {}
167-
169+
self.LOGGER.info(f"Found record id {response['Items'][0]}")
168170
return True, response["Items"][0]
169171

170172
def get_unique_values_from_list(self, list_of_values):

0 commit comments

Comments
 (0)