Skip to content

Commit

Permalink
Added debug log message when suppress exception in StatementInstrumen…
Browse files Browse the repository at this point in the history
…tation
  • Loading branch information
ValentinZakharov committed Jun 25, 2024
1 parent 36af77f commit 51cacb3
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import net.bytebuddy.asm.Advice;
import net.bytebuddy.description.type.TypeDescription;
import net.bytebuddy.matcher.ElementMatcher;
import org.slf4j.LoggerFactory;

@AutoService(InstrumenterModule.class)
public final class StatementInstrumentation extends InstrumenterModule.Tracing
Expand Down Expand Up @@ -56,7 +57,10 @@ public Map<String, String> contextStore() {
@Override
public String[] helperClassNames() {
return new String[] {
packageName + ".JDBCDecorator", packageName + ".SQLCommenter",
packageName + ".JDBCDecorator",
packageName + ".SQLCommenter",
"org.slf4j.LoggerFactory",
"org.slf4j.Logger",
};
}

Expand Down Expand Up @@ -122,6 +126,8 @@ public static AgentScope onEnter(
throw e;
} catch (Throwable e) {
// suppress anything else
LoggerFactory.getLogger("datadog.trace.instrumentation.jdbc.StatementInstrumentation")
.debug("Failed to handle exception in instrumentation for " + statement.getClass(), e);
}
return activateSpan(span);
}
Expand Down

0 comments on commit 51cacb3

Please sign in to comment.