Skip to content

Commit

Permalink
Merge branch 'release'
Browse files Browse the repository at this point in the history
  • Loading branch information
gunlee01 committed Jan 20, 2019
2 parents 80e4582 + bff1fea commit 4e79be6
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 7 deletions.
2 changes: 1 addition & 1 deletion autoconfigure/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>io.github.scouter-project</groupId>
<artifactId>zipkin-scouter-parent</artifactId>
<version>1.1.1</version>
<version>1.2.0</version>
</parent>

<artifactId>zipkin-autoconfigure-scouter</artifactId>
Expand Down
4 changes: 2 additions & 2 deletions autoconfigure/storage-scouter-udp-conf/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>io.github.scouter-project</groupId>
<artifactId>zipkin-autoconfigure-scouter</artifactId>
<version>1.1.1</version>
<version>1.2.0</version>
</parent>

<artifactId>zipkin-autoconfigure-storage-scouter-udp</artifactId>
Expand All @@ -41,8 +41,8 @@
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<directory>src/main/resources</directory>
</resource>
</resources>
<plugins>
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>io.github.scouter-project</groupId>
<artifactId>zipkin-scouter-parent</artifactId>
<version>1.1.1</version>
<version>1.2.0</version>
<packaging>pom</packaging>

<name>Zipkin Scouter (Parent)</name>
Expand Down Expand Up @@ -216,7 +216,7 @@
<executions>
<execution>
<id>sign-artifacts</id>
<phase>deploy</phase>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
Expand Down
2 changes: 1 addition & 1 deletion storage-scouter-udp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>io.github.scouter-project</groupId>
<artifactId>zipkin-scouter-parent</artifactId>
<version>1.1.1</version>
<version>1.2.0</version>
</parent>

<artifactId>zipkin-storage-scouter-udp</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,14 @@
import java.util.List;
import java.util.Map;
import java.util.logging.Logger;
import java.util.regex.Pattern;
import java.util.stream.Collectors;

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

private static int getSqlHash(String sql) {
if (sql.length() < 100)
Expand Down Expand Up @@ -298,7 +300,6 @@ private static SpanPack makeSpanPack(Span span) {
}
}

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

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

String serviceName = StringUtil.emptyToDefault(span.name(), "").trim();
if (pack.spanType == SpanTypes.CLIENT) {
if (pack.tags.getText("sql.query") != null) {
//serviceName = pack.tags.getText("sql.query").replaceAll("[\r\n]+", " ");
serviceName = WHITE_SPACE.matcher(pack.tags.getText("sql.query")).replaceAll(" ");
} else if (pack.tags.getText("http.path") != null) {
serviceName = pack.tags.getText("http.method") + " " + pack.tags.getText("http.path");
}
}
pack.name = sendServiceName(serviceName);

return pack;
}

Expand Down

0 comments on commit 4e79be6

Please sign in to comment.