Open codefromthecrypt opened 6 years ago
I tried integrating this with spring boot and found I had to manually call the tracing filter setter:
// TODO: Why isn't TracingFilter.setTracing called automatically by Dubbo's spring stuff
((TracingFilter) ExtensionLoader.getExtensionLoader(Filter.class)
.getExtension("tracing"))
.setTracing(tracing);
If anyone can try this branch and help me figure out what I don't understand, I would appreciate it. Also we can then have simple instructions for those wanting to try this.
cc @xionghuiCoder @chickenlj
https://github.com/openzipkin/sleuth-webmvc-example/compare/add-dubbo-tracing
sent email to dev@dubbo.apache.org
Everything in the example related with dubbo seems to be in the right way, i have also tested TraceFilter
in a separate Spring project and it works fine (tracing can be auto injected).
Will give a check on the “sleuth-webmvc-example” later, as i have no access to my computer now.
@adriancole please use official dubbo-spring-boot-starter
@mercyblitz The dubbo-spring-boot-starter adriancole use is the official one.
progress on the spring boot (via spring-cloud-sleuth) side https://github.com/spring-cloud/spring-cloud-sleuth/pull/885
@chickenlj @mercyblitz so I still have one question, which is how to externally register a filter so that all providers and consumers use it (as opposed to setting it on an annotation). We will need this for sleuth as we don't want users to have to change their annotations to switch on tracing
Check concepts of Consumer and Provider in dubbo:
http://dubbo.io/books/dubbo-user-book-en/references/xml/dubbo-consumer.html http://dubbo.io/books/dubbo-user-book-en/references/xml/dubbo-consumer.html http://dubbo.io/books/dubbo-user-book-en/references/xml/dubbo-provider.html http://dubbo.io/books/dubbo-user-book-en/references/xml/dubbo-provider.html
XML looks like this:
And annotation or spring boot, use .properties instead, for example:
dubbo.consumer.filter="tracing"
Is this what you want? Adrian
Best regards, Jun Liu
On 6 Mar 2018, at 3:58 PM, Adrian Cole notifications@github.com wrote:
@chickenlj https://github.com/chickenlj @mercyblitz https://github.com/mercyblitz so I still have one question, which is how to externally register a filter so that all providers and consumers use it (as opposed to setting it on an annotation). We will need this for sleuth as we don't want users to have to change their annotations to switch on tracing
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/openzipkin/brave/issues/632#issuecomment-370695232, or mute the thread https://github.com/notifications/unsubscribe-auth/ARQliQy8Fx6W2c1t1vy_eerUof8K3-gMks5tbkG0gaJpZM4Sa2cy.
spring boot (via sleuth) side of things is near perfect I added some notes https://github.com/openzipkin/sleuth-webmvc-example/compare/add-dubbo-tracing
I will update the readme shortly about manual config
Most things out there use spring or spring boot. It would be nice to have a demo for how to configure tracing for dubbo when someone is only using the api (per @chickenlj)
http://dubbo.io/books/dubbo-user-book-en/configuration/api.html
One challenge is I can't see how Dubbo manages lifecycle if any for extensions. It would seem instructions should include shutting down the component.
At any rate I don't know how to do this, except maybe a hard-coded extension factory like so: