Skip to content

Commit 4ffd2da

Browse files
db-api populate_span after sqlcomment creation
1 parent 7cbe586 commit 4ffd2da

File tree

1 file changed

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

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,6 @@ def traced_execution(
423423
with self._db_api_integration._tracer.start_as_current_span(
424424
name, kind=SpanKind.CLIENT
425425
) as span:
426-
self._populate_span(span, cursor, *args)
427426
if args and self._commenter_enabled:
428427
try:
429428
args_list = list(args)
@@ -464,6 +463,9 @@ def traced_execution(
464463
_logger.exception(
465464
"Exception while generating sql comment: %s", exc
466465
)
466+
467+
self._populate_span(span, cursor, *args)
468+
467469
return query_method(*args, **kwargs)
468470

469471

0 commit comments

Comments
 (0)