diff --git a/beeline/middleware/flask/__init__.py b/beeline/middleware/flask/__init__.py index a1d418e..126ea41 100644 --- a/beeline/middleware/flask/__init__.py +++ b/beeline/middleware/flask/__init__.py @@ -148,7 +148,7 @@ def after_cursor_execute(self, conn, cursor, statement, parameters, context, exe beeline.add_context({ "db.duration": query_duration.total_seconds() * 1000, - "db.last_insert_id": cursor.lastrowid, + "db.last_insert_id": getattr(cursor, 'lastrowid', None), "db.rows_affected": cursor.rowcount, }) if self.state.span: