-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Decouples AsyncZipkinSpanHandler from ZipkinSpanHandler to avoid leak (…
…#238) * Decouples AsyncZipkinSpanHandler from ZipkinSpanHandler to avoid leak ZipkinSpanHandler leaks the `zipkin2.Span` type through its factory methods. This prevents libraries that scan types, such as Spring, from avoiding a zipkin dep. The error shows up like below. The alternative is to not share a base class that uses a type you can't load. So, this changes AsyncZipkinSpanHandler to not extend ZipkinSpanHandler. This allows a portable change, except the more extreme interpretation, and lets spring apps exclude zipkin2.Span (or rather not include it when using brave). ``` Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'zipkinSpanHandler' defined in class path resource [brave/example/TracingAutoConfiguration.class]: Initialization of bean failed; nested exception is java.lang.TypeNotPresentException: Type zipkin2.Span not present at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:562) ~[spring-beans-4.3.25.RELEASE.jar:4.3.25.RELEASE] --snip-- ``` Signed-off-by: Adrian Cole <adrian@tetrate.io>
- Loading branch information
1 parent
af0f4d5
commit 3e6f163
Showing
4 changed files
with
81 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters