Closed mdvorak closed 6 years ago
@mdvorak thanks for the PR.
The auto-configuration part looks fine.
RestTemplateBuilder
? Can be TracingRestTemplateCustomizer
moved to the starter module?
You mean opentracing-spring-web-autoconfigure
? Of course.
Moving it to opentracing-spring-cloud
would split RestTemplate config into two separate projects, which I don't like.
Commit coming up :)
Note: While RestTemplateCustomizer
should not break anything, its a new feature, and should at least have version bump to 0.3.x
.
I've tested the change with opentracing-spring-cloud, and indeed there are plenty of failing tests - whenever they expect exact span count in the tracer and TestRestTemplate is used. I can prepare patch for otsc that will work with this version by disabling client tracing for all tests where servlet is tested.
@mdvorak sorry for the delay, I am fine with changes, I will have the last look and merge/comment.
You don't have to create a PR to bump the version, it will be done automatically as part of the release.
No problem, thanks for the review, I know its as hard as coding :-)
@mdvorak thanks! I will cut 0.3.0
WebClientTracingProperties
, withenabled
andcomponentName
RestTemplate
andAsyncRestTemplate
AutoConfig into once umbrella classRestTemplateTracingAutoConfiguration
, which allows us to have all@Conditional
annotations in one place. Actual configurations are in nested static classes, which is pattern used heavily by Spring Boot itself. Allows us to use additional conditions on each configuration class.TracingRestTemplateCustomizer
, which is used by Spring BootRestTemplateBuilder
(not included in Spring Framework itself). With SB, its valid pattern to have one preconfigured builder bean, and consumers createRestTemplate
instances locally, private, even on demand - but still share common configuration.RestTemplateCustomizer
is pattern to hook into builder config without directly modifying the bean. Side effect is that alsoTestRestTemplate
now creates traces - therefore disabled client tracing for Servlet tests.This is a big PR including multiple changes, but I found it would be complicated to split it across several PRs. It should however be non-breaking backwards compatible. Only change in behavior should be for
RestTemplateBuilder
beans, which might influence some applications. But its likely it will fix them instead of breaking them.Discussion is welcome :)