Skip to content

Commit

Permalink
overlapping spans for prepared statements
Browse files Browse the repository at this point in the history
  • Loading branch information
nenadnoveljic committed Jul 5, 2024
1 parent db1b998 commit 02049b8
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,14 @@ public static AgentScope onEnter(@Advice.This final Statement statement) {
DECORATE.onConnection(span, dbInfo);
DECORATE.onPreparedStatement(span, queryInfo);

final AgentScope scope = activateSpan(span);
boolean isSqlServer = dbInfo.getType().equals("sqlserver");
boolean injectTraceContext = DECORATE.shouldInjectTraceContext(dbInfo);
if (isSqlServer && INJECT_COMMENT && injectTraceContext) {
DECORATE.setContextInfo(connection, span.getSpanId(), dbInfo);
}

return activateSpan(span);
return scope;
} catch (SQLException e) {
logSQLException(e);
// if we can't get the connection for any reason
Expand Down

0 comments on commit 02049b8

Please sign in to comment.