Skip to content

Commit 4e79be6

Browse files
committed
Merge branch 'release'
2 parents 80e4582 + bff1fea commit 4e79be6

File tree

5 files changed

+19
-7
lines changed

5 files changed

+19
-7
lines changed

autoconfigure/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<parent>
2222
<groupId>io.github.scouter-project</groupId>
2323
<artifactId>zipkin-scouter-parent</artifactId>
24-
<version>1.1.1</version>
24+
<version>1.2.0</version>
2525
</parent>
2626

2727
<artifactId>zipkin-autoconfigure-scouter</artifactId>

autoconfigure/storage-scouter-udp-conf/pom.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<parent>
2222
<groupId>io.github.scouter-project</groupId>
2323
<artifactId>zipkin-autoconfigure-scouter</artifactId>
24-
<version>1.1.1</version>
24+
<version>1.2.0</version>
2525
</parent>
2626

2727
<artifactId>zipkin-autoconfigure-storage-scouter-udp</artifactId>
@@ -41,8 +41,8 @@
4141
<build>
4242
<resources>
4343
<resource>
44-
<directory>src/main/resources</directory>
4544
<filtering>true</filtering>
45+
<directory>src/main/resources</directory>
4646
</resource>
4747
</resources>
4848
<plugins>

pom.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>io.github.scouter-project</groupId>
88
<artifactId>zipkin-scouter-parent</artifactId>
9-
<version>1.1.1</version>
9+
<version>1.2.0</version>
1010
<packaging>pom</packaging>
1111

1212
<name>Zipkin Scouter (Parent)</name>
@@ -216,7 +216,7 @@
216216
<executions>
217217
<execution>
218218
<id>sign-artifacts</id>
219-
<phase>deploy</phase>
219+
<phase>verify</phase>
220220
<goals>
221221
<goal>sign</goal>
222222
</goals>

storage-scouter-udp/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<parent>
2222
<groupId>io.github.scouter-project</groupId>
2323
<artifactId>zipkin-scouter-parent</artifactId>
24-
<version>1.1.1</version>
24+
<version>1.2.0</version>
2525
</parent>
2626

2727
<artifactId>zipkin-storage-scouter-udp</artifactId>

storage-scouter-udp/src/main/java/zipkin2/storage/scouter/udp/net/DataProxy.java

+13-1
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,14 @@
4545
import java.util.List;
4646
import java.util.Map;
4747
import java.util.logging.Logger;
48+
import java.util.regex.Pattern;
4849
import java.util.stream.Collectors;
4950

5051
public class DataProxy {
5152
private static final Logger logger = Logger.getLogger(DataProxy.class.getName());
5253
private static UDPDataSendThread udpCollect = UDPDataSendThread.getInstance();
5354
private static IntIntLinkedMap sqlHash = new IntIntLinkedMap().setMax(5000);
55+
private static final Pattern WHITE_SPACE = Pattern.compile("\\s\\s+");
5456

5557
private static int getSqlHash(String sql) {
5658
if (sql.length() < 100)
@@ -298,7 +300,6 @@ private static SpanPack makeSpanPack(Span span) {
298300
}
299301
}
300302

301-
pack.name = sendServiceName(span.name());
302303
String error = span.tags().get("error");
303304
if (StringUtil.isNotEmpty(error)) {
304305
pack.error = sendError(error);
@@ -329,6 +330,17 @@ private static SpanPack makeSpanPack(Span span) {
329330

330331
pack.tags = MapValue.ofStringValueMap(span.tags());
331332

333+
String serviceName = StringUtil.emptyToDefault(span.name(), "").trim();
334+
if (pack.spanType == SpanTypes.CLIENT) {
335+
if (pack.tags.getText("sql.query") != null) {
336+
//serviceName = pack.tags.getText("sql.query").replaceAll("[\r\n]+", " ");
337+
serviceName = WHITE_SPACE.matcher(pack.tags.getText("sql.query")).replaceAll(" ");
338+
} else if (pack.tags.getText("http.path") != null) {
339+
serviceName = pack.tags.getText("http.method") + " " + pack.tags.getText("http.path");
340+
}
341+
}
342+
pack.name = sendServiceName(serviceName);
343+
332344
return pack;
333345
}
334346

0 commit comments

Comments
 (0)