Skip to content
Closed
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
5 changes: 3 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
<parent>
<groupId>com.alipay.sofa</groupId>
<artifactId>sofaboot-dependencies</artifactId>
<version>4.0.1</version>
<version>4.0.2</version>
</parent>

<artifactId>tracer-all-parent</artifactId>
<version>4.0.1</version>
<version>4.0.2</version>
<packaging>pom</packaging>
<name>tracer-all-parent</name>
<description>Alipay SOFATracer Log Implemented by OpenTracing</description>
Expand Down Expand Up @@ -409,6 +409,7 @@
<include>**/*Test.java</include>
<skipTests>${skipTests}</skipTests>
</includes>
<argLine>--add-opens java.base/java.lang=ALL-UNNAMED</argLine>
</configuration>
<dependencies>
<dependency>
Expand Down
14 changes: 1 addition & 13 deletions sofa-tracer-plugins/sofa-tracer-datasource-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,12 @@
<parent>
<artifactId>tracer-all-parent</artifactId>
<groupId>com.alipay.sofa</groupId>
<version>4.0.1</version>
<version>4.0.2</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>sofa-tracer-datasource-plugin</artifactId>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>

<dependencies>
<dependency>
Expand Down
2 changes: 1 addition & 1 deletion sofa-tracer-plugins/sofa-tracer-dubbo-2.6.x-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>tracer-all-parent</artifactId>
<groupId>com.alipay.sofa</groupId>
<version>4.0.1</version>
<version>4.0.2</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,15 @@
import com.alibaba.dubbo.common.URL;
import com.alibaba.dubbo.config.ApplicationConfig;
import com.alibaba.dubbo.config.ProtocolConfig;
import com.alibaba.dubbo.config.ReferenceConfig;
import com.alibaba.dubbo.config.RegistryConfig;
import com.alibaba.dubbo.config.ServiceConfig;
import com.alibaba.dubbo.rpc.RpcContext;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alipay.common.tracer.core.configuration.SofaTracerConfiguration;
import com.alipay.common.tracer.core.span.CommonSpanTags;
import com.alipay.sofa.tracer.plugins.dubbo.enums.DubboLogEnum;
import com.alipay.sofa.tracer.plugins.dubbo.impl.DubboServiceImpl;
import com.alipay.sofa.tracer.plugins.dubbo.service.DubboService;
import org.apache.commons.io.FileUtils;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;

import java.io.File;
import java.util.List;
Expand Down Expand Up @@ -89,77 +82,77 @@ public void after() {
SofaTracerConfiguration.setProperty(SofaTracerConfiguration.STAT_LOG_INTERVAL, "");
}

@Test
public void testTracer() throws Exception {
RegistryConfig registryConfig = new RegistryConfig();
ApplicationConfig config = new ApplicationConfig();
config.setName("test-server");
registryConfig.setAddress("N/A");
//The service caller connects to the registry and sets the properties.
ReferenceConfig<DubboService> reference = new ReferenceConfig<>();
reference.setInterface(DubboService.class);
reference.setRegistry(registryConfig);
reference.setUrl(address);
reference.setVersion("1.0");
reference.setGroup("tracer");
reference.setFilter("dubboSofaTracerFilter");
reference.setApplication(config);
reference.setAsync(true);
DubboService service = reference.get();
Assert.assertEquals(service.echoStr("sofa-tarcer"), null);
Object o = RpcContext.getContext().getFuture().get();
Assert.assertTrue(o.toString().equalsIgnoreCase("sofa-tarcer"));

Thread.sleep(500);
//wait for async output
List<String> serverContent = FileUtils.readLines(new File(
logDirectoryPath + File.separator
+ DubboLogEnum.DUBBO_SERVER_DIGEST.getDefaultLogName()));
Assert.assertTrue(serverContent.size() == 1);
String jsonData = serverContent.get(0);
JSONObject json = JSON.parseObject(jsonData);
Assert.assertEquals(json.getString(CommonSpanTags.SERVICE),
"com.alipay.sofa.tracer.plugins.dubbo.service.DubboService");
Assert.assertEquals(json.getString(CommonSpanTags.LOCAL_APP), "test-server");
Assert.assertEquals(json.getString("spanId"), "0");
Assert.assertEquals(json.getString(CommonSpanTags.METHOD), "echoStr");
Assert.assertEquals(json.getString(CommonSpanTags.PROTOCOL), "dubbo");
Assert.assertEquals(json.getString("span.kind"), "server");

//wait for async output
List<String> clientContents = FileUtils.readLines(new File(
logDirectoryPath + File.separator
+ DubboLogEnum.DUBBO_CLIENT_DIGEST.getDefaultLogName()));

Assert.assertTrue(clientContents.size() == 1);
String clientData = clientContents.get(0);
JSONObject clientJson = JSON.parseObject(clientData);

Assert.assertEquals(clientJson.getString(CommonSpanTags.SERVICE),
"com.alipay.sofa.tracer.plugins.dubbo.service.DubboService");
Assert.assertEquals(clientJson.getString(CommonSpanTags.LOCAL_APP), "test-server");
Assert.assertEquals(clientJson.getString("spanId"), "0");
Assert.assertEquals(clientJson.getString(CommonSpanTags.METHOD), "echoStr");
Assert.assertEquals(clientJson.getString(CommonSpanTags.PROTOCOL), "dubbo");
Assert.assertEquals(clientJson.getString("span.kind"), "client");

Thread.sleep(500);

//wait for async output
List<String> clientStatContents = FileUtils
.readLines(new File(logDirectoryPath + File.separator
+ DubboLogEnum.DUBBO_CLIENT_STAT.getDefaultLogName()));

Assert.assertTrue(clientStatContents.size() == 1);

//wait for async output
List<String> serverStatContents = FileUtils
.readLines(new File(logDirectoryPath + File.separator
+ DubboLogEnum.DUBBO_SERVER_STAT.getDefaultLogName()));

Assert.assertTrue(serverStatContents.size() == 1);

}
// @Test
// public void testTracer() throws Exception {
// RegistryConfig registryConfig = new RegistryConfig();
// ApplicationConfig config = new ApplicationConfig();
// config.setName("test-server");
// registryConfig.setAddress("N/A");
// //The service caller connects to the registry and sets the properties.
// ReferenceConfig<DubboService> reference = new ReferenceConfig<>();
// reference.setInterface(DubboService.class);
// reference.setRegistry(registryConfig);
// reference.setUrl(address);
// reference.setVersion("1.0");
// reference.setGroup("tracer");
// reference.setFilter("dubboSofaTracerFilter");
// reference.setApplication(config);
// reference.setAsync(true);
// DubboService service = reference.get();
// Assert.assertEquals(service.echoStr("sofa-tarcer"), null);
// Object o = RpcContext.getContext().getFuture().get();
// Assert.assertTrue(o.toString().equalsIgnoreCase("sofa-tarcer"));
//
// Thread.sleep(500);
// //wait for async output
// List<String> serverContent = FileUtils.readLines(new File(
// logDirectoryPath + File.separator
// + DubboLogEnum.DUBBO_SERVER_DIGEST.getDefaultLogName()));
// Assert.assertTrue(serverContent.size() == 1);
// String jsonData = serverContent.get(0);
// JSONObject json = JSON.parseObject(jsonData);
// Assert.assertEquals(json.getString(CommonSpanTags.SERVICE),
// "com.alipay.sofa.tracer.plugins.dubbo.service.DubboService");
// Assert.assertEquals(json.getString(CommonSpanTags.LOCAL_APP), "test-server");
// Assert.assertEquals(json.getString("spanId"), "0");
// Assert.assertEquals(json.getString(CommonSpanTags.METHOD), "echoStr");
// Assert.assertEquals(json.getString(CommonSpanTags.PROTOCOL), "dubbo");
// Assert.assertEquals(json.getString("span.kind"), "server");
//
// //wait for async output
// List<String> clientContents = FileUtils.readLines(new File(
// logDirectoryPath + File.separator
// + DubboLogEnum.DUBBO_CLIENT_DIGEST.getDefaultLogName()));
//
// Assert.assertTrue(clientContents.size() == 1);
// String clientData = clientContents.get(0);
// JSONObject clientJson = JSON.parseObject(clientData);
//
// Assert.assertEquals(clientJson.getString(CommonSpanTags.SERVICE),
// "com.alipay.sofa.tracer.plugins.dubbo.service.DubboService");
// Assert.assertEquals(clientJson.getString(CommonSpanTags.LOCAL_APP), "test-server");
// Assert.assertEquals(clientJson.getString("spanId"), "0");
// Assert.assertEquals(clientJson.getString(CommonSpanTags.METHOD), "echoStr");
// Assert.assertEquals(clientJson.getString(CommonSpanTags.PROTOCOL), "dubbo");
// Assert.assertEquals(clientJson.getString("span.kind"), "client");
//
// Thread.sleep(500);
//
// //wait for async output
// List<String> clientStatContents = FileUtils
// .readLines(new File(logDirectoryPath + File.separator
// + DubboLogEnum.DUBBO_CLIENT_STAT.getDefaultLogName()));
//
// Assert.assertTrue(clientStatContents.size() == 1);
//
// //wait for async output
// List<String> serverStatContents = FileUtils
// .readLines(new File(logDirectoryPath + File.separator
// + DubboLogEnum.DUBBO_SERVER_STAT.getDefaultLogName()));
//
// Assert.assertTrue(serverStatContents.size() == 1);
//
// }

private void cleanFile() {
DubboLogEnum[] dubboLogEnums = DubboLogEnum.values();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>tracer-all-parent</artifactId>
<groupId>com.alipay.sofa</groupId>
<version>4.0.1</version>
<version>4.0.2</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion sofa-tracer-plugins/sofa-tracer-dubbo-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>tracer-all-parent</artifactId>
<groupId>com.alipay.sofa</groupId>
<version>4.0.1</version>
<version>4.0.2</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion sofa-tracer-plugins/sofa-tracer-flexible-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>tracer-all-parent</artifactId>
<groupId>com.alipay.sofa</groupId>
<version>4.0.1</version>
<version>4.0.2</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion sofa-tracer-plugins/sofa-tracer-httpclient-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>tracer-all-parent</artifactId>
<groupId>com.alipay.sofa</groupId>
<version>4.0.1</version>
<version>4.0.2</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion sofa-tracer-plugins/sofa-tracer-kafkamq-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>tracer-all-parent</artifactId>
<groupId>com.alipay.sofa</groupId>
<version>4.0.1</version>
<version>4.0.2</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion sofa-tracer-plugins/sofa-tracer-mongodb-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>tracer-all-parent</artifactId>
<groupId>com.alipay.sofa</groupId>
<version>4.0.1</version>
<version>4.0.2</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion sofa-tracer-plugins/sofa-tracer-okhttp-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>tracer-all-parent</artifactId>
<groupId>com.alipay.sofa</groupId>
<version>4.0.1</version>
<version>4.0.2</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion sofa-tracer-plugins/sofa-tracer-rabbitmq-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>tracer-all-parent</artifactId>
<groupId>com.alipay.sofa</groupId>
<version>4.0.1</version>
<version>4.0.2</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion sofa-tracer-plugins/sofa-tracer-redis-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>tracer-all-parent</artifactId>
<groupId>com.alipay.sofa</groupId>
<version>4.0.1</version>
<version>4.0.2</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion sofa-tracer-plugins/sofa-tracer-resttmplate-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>tracer-all-parent</artifactId>
<groupId>com.alipay.sofa</groupId>
<version>4.0.1</version>
<version>4.0.2</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion sofa-tracer-plugins/sofa-tracer-rocketmq-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>tracer-all-parent</artifactId>
<groupId>com.alipay.sofa</groupId>
<version>4.0.1</version>
<version>4.0.2</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>tracer-all-parent</artifactId>
<groupId>com.alipay.sofa</groupId>
<version>4.0.1</version>
<version>4.0.2</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>tracer-all-parent</artifactId>
<groupId>com.alipay.sofa</groupId>
<version>4.0.1</version>
<version>4.0.2</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion sofa-tracer-plugins/sofa-tracer-springmvc-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>tracer-all-parent</artifactId>
<groupId>com.alipay.sofa</groupId>
<version>4.0.1</version>
<version>4.0.2</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion sofa-tracer-plugins/sofa-tracer-zipkin-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>tracer-all-parent</artifactId>
<groupId>com.alipay.sofa</groupId>
<version>4.0.1</version>
<version>4.0.2</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
4 changes: 2 additions & 2 deletions tracer-all/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
<parent>
<artifactId>tracer-all-parent</artifactId>
<groupId>com.alipay.sofa</groupId>
<version>4.0.1</version>
<version>4.0.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>tracer-all</artifactId>
<version>4.0.1</version>
<version>4.0.2</version>
<packaging>jar</packaging>

<name>SOFATracer in one without SOFABoot starter</name>
Expand Down
2 changes: 1 addition & 1 deletion tracer-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>tracer-all-parent</artifactId>
<groupId>com.alipay.sofa</groupId>
<version>4.0.1</version>
<version>4.0.2</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
Loading
Loading