-
Notifications
You must be signed in to change notification settings - Fork 714
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Trace ID is not passed down in Dubbo application #1363
Labels
Comments
Ping @shakuzen
…On Fri, 24 Feb 2023, 10:07 liunancun, ***@***.***> wrote:
This is a Dubbo application, which consists of three parts: demo-consumer,
demo-provider, and demo-test.
The calling process is
demo-consumer -> demo-provider -> demo-test
demo-consumer Configuration and code
dubbo.application.name=demo-consumer
dubbo.scan.basePackages=com.example.demo
dubbo.registry.address=zookeeper://192.168.99.214:2181
dubbo.application.qos-enable=false
dubbo.protocol.port=20883
dubbo.consumer.filter=tracing
@configuration
@import({ DelegatingTracingFilter.class, SpanCustomizingAsyncHandlerInterceptor.class })
public class WebZipkinConfig implements WebMvcConfigurer {
@resource
private SpanCustomizingAsyncHandlerInterceptor interceptor;
@resource
private Tracing tracing;
@OverRide
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(interceptor);
}
@bean
public HttpTracing httpTracing() {
return HttpTracing.create(tracing);
}
}
@configuration
public class ZipkinConfig {
@bean
public Tracing tracing() {
return Tracing.newBuilder().localServiceName("consumer")
.addSpanHandler(
AsyncZipkinSpanHandler.create(OkHttpSender.create("http://192.168.99.214:9411/api/v2/spans")))
.build();
}
}
@SpringBootApplication
@RestController
public class DemoApplication {
public static void main(String[] args) {
SpringApplication.run(DemoApplication.class, args);
}
@DubboReference
private DemoService demoService;
@GetMapping("hello")
public String hello() {
demoService.hello("liunancun");
return "hello";
}
}
demo-provider Configuration and code
dubbo.application.name=demo-provider
dubbo.scan.basePackages=com.example.demo
dubbo.registry.address=zookeeper://192.168.99.214:2181
dubbo.protocol.port=20882
dubbo.provider.filter=tracing
dubbo.consumer.filter=tracing
@configuration
public class ZipkinConfig {
@bean
public Tracing tracing() {
return Tracing.newBuilder().localServiceName("provider")
.addSpanHandler(
AsyncZipkinSpanHandler.create(OkHttpSender.create("http://192.168.99.214:9411/api/v2/spans")))
.build();
}
}
@DubboService
public class DemoServiceImpl implements DemoService {
@DubboReference
private TestService testService;
@OverRide
public String hello(String name) {
System.out.println("hello " + name);
testService.test(name);
return "hello " + name;
}
}
demo-test Configuration and code
dubbo.application.name=demo-test
dubbo.scan.basePackages=com.example.demo
dubbo.registry.address=zookeeper://192.168.99.214:2181
dubbo.protocol.port=20881
dubbo.provider.filter=tracing
@configuration
public class ZipkinConfig {
@bean
public Tracing tracing() {
return Tracing.newBuilder().localServiceName("test")
.addSpanHandler(
AsyncZipkinSpanHandler.create(OkHttpSender.create("http://192.168.99.214:9411/api/v2/spans")))
.build();
}
}
@DubboService
public class TestServiceImpl implements TestService {
@OverRide
public String test(String name) {
System.out.println("test, " + name);
return "test, " + name;
}
}
result
Three Trace IDs appear
[image: image]
<https://user-images.githubusercontent.com/12378933/221137548-a3bb4665-02d6-45b8-82a2-6db4ebc670e1.png>
There are only two calls to consumer. Normally, there should be three calls
[image: image]
<https://user-images.githubusercontent.com/12378933/221137748-a4182bd9-121e-422b-9100-5b79a363880e.png>
—
Reply to this email directly, view it on GitHub
<#1363>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAXOYAUCVCPHVWUSTXE3TETWZB24LANCNFSM6AAAAAAVGUWPDI>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
It is normal in version 2.7, but there is a problem in version 3 or above. Does it still not support Dubbo3? |
Dubbo has support for micrometer observation and micrometer tracing that has a bridge for brave. You can use that |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is a Dubbo application, which consists of three parts: demo-consumer, demo-provider, and demo-test.
The calling process is
demo-consumer -> demo-provider -> demo-test
demo-consumer Configuration and code
demo-provider Configuration and code
demo-test Configuration and code
result
Three Trace IDs appear
There are only two calls to consumer. Normally, there should be three calls
The text was updated successfully, but these errors were encountered: