Skip to content

Commit

Permalink
refactor: migrate tracing core from boot-start to dubbo deployer
Browse files Browse the repository at this point in the history
  • Loading branch information
conghuhu committed Jun 12, 2023
1 parent 3fa5185 commit 2f422e8
Show file tree
Hide file tree
Showing 67 changed files with 1,456 additions and 246 deletions.
1 change: 1 addition & 0 deletions .artifacts
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,5 @@ dubbo-nacos-spring-boot-starter
dubbo-zookeeper-spring-boot-starter
dubbo-zookeeper-curator5-spring-boot-starter
dubbo-spring-security
dubbo-tracing
dubbo-xds
5 changes: 0 additions & 5 deletions dubbo-cluster/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,5 @@
<version>${project.parent.version}</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-tracing-integration-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
consumercontext=org.apache.dubbo.rpc.cluster.filter.support.ConsumerContextFilter
consumer-classloader=org.apache.dubbo.rpc.cluster.filter.support.ConsumerClassLoaderFilter
router-snapshot=org.apache.dubbo.rpc.cluster.router.RouterSnapshotFilter
observationsender=org.apache.dubbo.rpc.cluster.filter.support.ObservationSenderFilter
metricsClusterFilter=org.apache.dubbo.rpc.cluster.filter.support.MetricsClusterFilter

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ public interface LoggerCodeConstants {

String VULNERABILITY_WARNING = "0-28";

String COMMON_NOT_FOUND_TRACER_DEPENDENCY = "0-29";


// Registry module

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,19 @@ public class BaggageConfig implements Serializable {
*/
private List<String> remoteFields = new ArrayList<>();

public BaggageConfig() {
}

public BaggageConfig(Boolean enabled) {
this.enabled = enabled;
}

public BaggageConfig(Boolean enabled, Correlation correlation, List<String> remoteFields) {
this.enabled = enabled;
this.correlation = correlation;
this.remoteFields = remoteFields;
}

public Boolean getEnabled() {
return enabled;
}
Expand Down Expand Up @@ -76,6 +89,18 @@ public static class Correlation implements Serializable {
*/
private List<String> fields = new ArrayList<>();

public Correlation() {
}

public Correlation(boolean enabled) {
this.enabled = enabled;
}

public Correlation(boolean enabled, List<String> fields) {
this.enabled = enabled;
this.fields = fields;
}

public boolean isEnabled() {
return this.enabled;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@

package org.apache.dubbo.config.nested;

import org.apache.dubbo.config.support.Nested;

import java.io.Serializable;
import java.time.Duration;
import java.util.HashMap;
import java.util.Map;

import org.apache.dubbo.config.support.Nested;

public class ExporterConfig implements Serializable {

@Nested
Expand Down Expand Up @@ -56,15 +56,28 @@ public static class ZipkinConfig implements Serializable {
private String endpoint;

/**
* Connection timeout for requests to Zipkin.
* Connection timeout for requests to Zipkin. (seconds)
*/
private Duration connectTimeout = Duration.ofSeconds(1);

/**
* Read timeout for requests to Zipkin.
* Read timeout for requests to Zipkin. (seconds)
*/
private Duration readTimeout = Duration.ofSeconds(10);

public ZipkinConfig() {
}

public ZipkinConfig(String endpoint) {
this.endpoint = endpoint;
}

public ZipkinConfig(String endpoint, Duration connectTimeout, Duration readTimeout) {
this.endpoint = endpoint;
this.connectTimeout = connectTimeout;
this.readTimeout = readTimeout;
}

public String getEndpoint() {
return endpoint;
}
Expand Down Expand Up @@ -98,7 +111,7 @@ public static class OtlpConfig implements Serializable {
private String endpoint;

/**
* The maximum time to wait for the collector to process an exported batch of spans.
* The maximum time to wait for the collector to process an exported batch of spans. (seconds)
*/
private Duration timeout = Duration.ofSeconds(10);

Expand All @@ -110,6 +123,24 @@ public static class OtlpConfig implements Serializable {

private Map<String, String> headers = new HashMap<>();

public OtlpConfig() {
}

public OtlpConfig(String endpoint) {
this.endpoint = endpoint;
}

public OtlpConfig(String endpoint, Duration timeout) {
this.endpoint = endpoint;
this.timeout = timeout;
}

public OtlpConfig(String endpoint, Duration timeout, String compressionMethod) {
this.endpoint = endpoint;
this.timeout = timeout;
this.compressionMethod = compressionMethod;
}

public String getEndpoint() {
return endpoint;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ public class PropagationConfig implements Serializable {
*/
private String type = W3C;

public PropagationConfig() {
}

public PropagationConfig(String type) {
this.type = type;
}

public String getType() {
return type;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ public class SamplingConfig implements Serializable {
*/
private float probability = 0.10f;

public SamplingConfig() {
}

public SamplingConfig(float probability) {
this.probability = probability;
}

public float getProbability() {
return this.probability;
}
Expand Down
6 changes: 6 additions & 0 deletions dubbo-config/dubbo-config-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@
<version>${project.parent.version}</version>
</dependency>

<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-tracing</artifactId>
<version>${project.parent.version}</version>
</dependency>

<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-monitor-api</artifactId>
Expand Down
Loading

0 comments on commit 2f422e8

Please sign in to comment.