Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Release Notes.
* Support kafka-clients-3.9.x intercept.
* Upgrade kafka-clients version in optional-reporter-plugins to 3.9.1.
* Fix AbstractLogger replaceParam when the replaced string contains a replacement marker.
* Fix `JDBCPluginConfig.Plugin.JDBC.SQL_BODY_MAX_LENGTH` was not working in some plugins.

All issues and pull requests are [here](https://github.com/apache/skywalking/milestone/242?closed=1)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import org.apache.skywalking.apm.agent.core.context.trace.AbstractSpan;
import org.apache.skywalking.apm.agent.core.context.trace.SpanLayer;
import org.apache.skywalking.apm.agent.core.context.ContextManager;
import org.apache.skywalking.apm.plugin.jdbc.SqlBodyUtil;

/**
* {@link CallableStatementTracing} create an exit span when the client call the method in the class that extend {@link
Expand All @@ -38,7 +39,7 @@ public static <R> R execute(java.sql.CallableStatement realStatement, Connection
Tags.DB_TYPE.set(span, connectInfo.getDBType());
SpanLayer.asDB(span);
Tags.DB_INSTANCE.set(span, connectInfo.getDatabaseName());
Tags.DB_STATEMENT.set(span, sql);
Tags.DB_STATEMENT.set(span, SqlBodyUtil.limitSqlBodySize(sql));
span.setComponent(connectInfo.getComponent());
return exec.exe(realStatement, sql);
} catch (SQLException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import org.apache.skywalking.apm.agent.core.context.trace.SpanLayer;
import org.apache.skywalking.apm.plugin.jdbc.JDBCPluginConfig;
import org.apache.skywalking.apm.plugin.jdbc.PreparedStatementParameterBuilder;
import org.apache.skywalking.apm.plugin.jdbc.SqlBodyUtil;
import org.apache.skywalking.apm.plugin.jdbc.define.StatementEnhanceInfos;

/**
Expand All @@ -42,7 +43,7 @@ public static <R> R execute(java.sql.PreparedStatement realStatement, Connection
try {
Tags.DB_TYPE.set(span, connectInfo.getDBType());
Tags.DB_INSTANCE.set(span, connectInfo.getDatabaseName());
Tags.DB_STATEMENT.set(span, sql);
Tags.DB_STATEMENT.set(span, SqlBodyUtil.limitSqlBodySize(sql));
span.setComponent(connectInfo.getComponent());
SpanLayer.asDB(span);
if (JDBCPluginConfig.Plugin.JDBC.TRACE_SQL_PARAMETERS && Objects.nonNull(statementEnhanceInfos)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import org.apache.skywalking.apm.agent.core.context.tag.Tags;
import org.apache.skywalking.apm.agent.core.context.trace.AbstractSpan;
import org.apache.skywalking.apm.agent.core.context.trace.SpanLayer;
import org.apache.skywalking.apm.plugin.jdbc.SqlBodyUtil;

/**
* {@link PreparedStatementTracing} create an exit span when the client call the method in the class that extend {@link
Expand All @@ -36,7 +37,7 @@ public static <R> R execute(java.sql.Statement realStatement, ConnectionInfo con
.getDatabasePeer());
Tags.DB_TYPE.set(span, connectInfo.getDBType());
Tags.DB_INSTANCE.set(span, connectInfo.getDatabaseName());
Tags.DB_STATEMENT.set(span, sql);
Tags.DB_STATEMENT.set(span, SqlBodyUtil.limitSqlBodySize(sql));
span.setComponent(connectInfo.getComponent());
SpanLayer.asDB(span);
return exec.exe(realStatement, sql);
Expand Down
Loading