Skip to content

Commit 1a515a1

Browse files
Update comment
1 parent 0829a79 commit 1a515a1

File tree

1 file changed

+4
-3
lines changed
  • instrumentation/opentelemetry-instrumentation-dbapi/src/opentelemetry/instrumentation/dbapi

1 file changed

+4
-3
lines changed

instrumentation/opentelemetry-instrumentation-dbapi/src/opentelemetry/instrumentation/dbapi/__init__.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -552,19 +552,20 @@ def traced_execution(
552552
if span.is_recording():
553553
if args and self._commenter_enabled:
554554
if self._enable_attribute_commenter:
555-
# sqlcomment in query and span attribute
555+
# sqlcomment is added to executed query and db.statement span attribute
556556
args = self._update_args_with_added_sql_comment(
557557
args, cursor
558558
)
559559
self._populate_span(span, cursor, *args)
560560
else:
561-
# sqlcomment in query only
561+
# sqlcomment is only added to executed query
562+
# so db.statement is set before add_sql_comment
562563
self._populate_span(span, cursor, *args)
563564
args = self._update_args_with_added_sql_comment(
564565
args, cursor
565566
)
566567
else:
567-
# no sqlcomment
568+
# no sqlcomment anywhere
568569
self._populate_span(span, cursor, *args)
569570
return query_method(*args, **kwargs)
570571

0 commit comments

Comments
 (0)