File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
instrumentation/opentelemetry-instrumentation-dbapi/src/opentelemetry/instrumentation/dbapi Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments