Skip to content

Commit c584f76

Browse files
committed
Handled the spanName equals to null.
1 parent 45aa6ec commit c584f76

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

instrumentation/mybatis-3.2/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/mybatis/v3_2/MyBatisSpanNameExtractor.java

+3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ public class MyBatisSpanNameExtractor implements SpanNameExtractor<MapperMethodR
1212
@Override
1313
public String extract(MapperMethodRequest request) {
1414
String mapperName = request.getMapperName();
15+
if (mapperName == null) {
16+
return "MyBatis execute";
17+
}
1518
// filter the package name in mapperName
1619
int lastDotIndex = mapperName.lastIndexOf('.');
1720
int secondLastDotIndex = mapperName.lastIndexOf('.', lastDotIndex - 1);

0 commit comments

Comments
 (0)