fix an error when no statement with slowStatement (#5243) (#5245)

Co-authored-by: jingjiu <jingjiu@tsign.cn>
This commit is contained in:
gnr163 2020-08-06 09:06:09 +08:00 committed by GitHub
parent 567c6b59f2
commit 68ab389021
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -210,7 +210,7 @@ public class MultiScopesAnalysisListener implements EntryAnalysisListener, ExitA
if (SpanTags.DB_STATEMENT.equals(tag.getKey())) {
String sqlStatement = tag.getValue();
if (StringUtil.isEmpty(sqlStatement)) {
statement.setStatement("[No statement]/" + sourceBuilder.getDestEndpointName());
statement.setStatement("[No statement]/" + span.getOperationName());
} else if (sqlStatement.length() > config.getMaxSlowSQLLength()) {
statement.setStatement(sqlStatement.substring(0, config.getMaxSlowSQLLength()));
} else {