Skip to content
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

support opentracing & demo #311

Merged
merged 4 commits into from
Dec 21, 2016
Merged

support opentracing & demo #311

merged 4 commits into from
Dec 21, 2016

Conversation

rayzhang0603
Copy link
Collaborator

support opentracing

实现方式:motan filter SPI。OpenTracingFilter中按OT 的api对server端和client端进行trace处理。
可用通过spirng 配置方式或api方式替换OpenTracingContext中的TracerFactory, 来实现不同tracer的替换。
demo在test classpath下的com.weibo.api.motan.filter.opentracing.zipkin.demo包下,其中server端使用spring配置方式替换具体trace实现,client端通过代码api替换。

Copy link
Contributor

@wu-sheng wu-sheng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

请确保tracer的唯一性、确定性和非空特性 : )

if (implementations.hasNext()) {
tracer = implementations.next();
LoggerUtil.info("io.opentracing.Tracer load in DefaultTracerFactory, " + tracer.getClass().getSimpleName()
+ " is used as default tracer.");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

应该在此处判断,如果有超过一个实现,使用NoopTracer

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已修改。

+ " is used as default tracer.");
}
} catch (Exception e) {
LoggerUtil.warn("DefaultTracerFactory load Tracer fail.", e);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

如果发生任何异常,需要使用NoopTracer,确保tracer不能为空

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wu-sheng
Copy link
Contributor

好像目前版本有CI失败?

@rayzhang0603
Copy link
Collaborator Author

Travis CI有时会失败可能跟docker环境有关,mvn加载依赖类失败了,稍后我看一下

Copy link
Contributor

@wu-sheng wu-sheng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

修改完版本后,我认为可以直接合并了。

@@ -21,6 +21,7 @@
<url>https://github.com/weibocom/motan</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<opentracing.version>0.20.2</opentracing.version>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0.20.4应该是当前的release版本

@rayzhang0603
Copy link
Collaborator Author

非常感谢!

@wu-sheng
Copy link
Contributor

你们相关的图标么?要求黑白的矢量图,https://github.com/opentracing/opentracing.io/blob/master/img/frameworks/django.svg

我可以准备把你们提交到opentracing.io上了。

如果没有图片,也可以用文字。
@rayzhang0603

@rayzhang0603
Copy link
Collaborator Author

好的,我准备一下

@rayzhang0603 rayzhang0603 merged commit 18171d1 into master Dec 21, 2016
@rayzhang0603 rayzhang0603 deleted the feature/opentracing branch May 12, 2017 02:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants