Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Integrate with sofa-tracer for support opentracing. #131

Merged
merged 11 commits into from
May 23, 2018
Merged

Integrate with sofa-tracer for support opentracing. #131

merged 11 commits into from
May 23, 2018

Conversation

leizhiyuan
Copy link
Contributor

Motivation:

integration with sofa tracer

Modification:

based on @ujjboy 's tracer integration, add stat info print.

in order to test .I add com.alipay.sofa.rpc.tracer.sofatracer.factory.MemoryReporterImpl, annotationed by @justfortest

Result:

we will have stat infos in rpc-client-stat.log and rpc-server-stat.log as below.

➜  tracelog tail -f rpc-client-stat.log
{"time":"2018-05-18 07:02:19.716","stat.key":{"method":"method","local.app":"client","service":"app.service:2.0"},"count":20,"total.cost.milliseconds":1,"success":"Y"}
{"time":"2018-05-18 07:02:19.717","stat.key":{"method":"method","local.app":"client","service":"app.service:1.0"},"count":10,"total.cost.milliseconds":17,"success":"Y"}

service,method,localapp,remoteapp,count,time,success.


try {
invoke();
Thread.sleep(5000);
Copy link
Member

Choose a reason for hiding this comment

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

这个sleep是为了?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ujjboy 为了等一些 callback 回来.

Copy link
Member

Choose a reason for hiding this comment

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

嗯 那就在 callback 调完之后 用 CountdownLatch 等吧,这里可以不用等了。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

这个暂时不改了.看了一下,还有 oneway 等的处理.我之后看看怎么优化下

/***
* 弹性数据位
*/
public static final String ELASTIC_ID = "elastic.id";
Copy link
Member

Choose a reason for hiding this comment

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

我在想字段这几个要不要删掉?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

可以,我先删除,也没人用到现在.

@codecov-io
Copy link

codecov-io commented May 23, 2018

Codecov Report

Merging #131 into master will increase coverage by 1.69%.
The diff coverage is 78.94%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #131      +/-   ##
============================================
+ Coverage     66.39%   68.09%   +1.69%     
+ Complexity      756      729      -27     
============================================
  Files           280      302      +22     
  Lines         11897    12640     +743     
  Branches       1981     2077      +96     
============================================
+ Hits           7899     8607     +708     
+ Misses         3011     2988      -23     
- Partials        987     1045      +58
Impacted Files Coverage Δ Complexity Δ
...fa/rpc/tracer/sofatracer/log/tags/RpcSpanTags.java 0% <0%> (ø) 0 <0> (?)
...a/rpc/tracer/sofatracer/code/TracerResultCode.java 0% <0%> (ø) 0 <0> (?)
.../tracer/sofatracer/factory/MemoryReporterImpl.java 0% <0%> (ø) 0 <0> (?)
...c/tracer/sofatracer/log/type/RpcTracerLogEnum.java 100% <100%> (ø) 0 <0> (?)
...sofatracer/log/stat/RpcServerStatJsonReporter.java 100% <100%> (ø) 0 <0> (?)
...sofatracer/log/stat/RpcClientStatJsonReporter.java 100% <100%> (ø) 0 <0> (?)
...rpc/tracer/sofatracer/factory/ReporterFactory.java 57.14% <57.14%> (ø) 0 <0> (?)
...a/com/alipay/sofa/rpc/module/SofaTracerModule.java 57.14% <57.14%> (ø) 0 <0> (?)
.../sofa/rpc/tracer/sofatracer/RestTracerAdapter.java 65.11% <65.11%> (ø) 10 <10> (?)
...a/com/alipay/sofa/rpc/module/RestTracerModule.java 70.37% <70.37%> (ø) 4 <4> (?)
... and 75 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 00d62c1...07ca3e3. Read the comment docs.


try {
invoke();
Thread.sleep(5000);
Copy link
Member

Choose a reason for hiding this comment

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

嗯 那就在 callback 调完之后 用 CountdownLatch 等吧,这里可以不用等了。

@Test
public void testProviderServiceStats() throws InterruptedException {

Metric metric = fetchWithName("rpc.provider.service.stats");

for (Tag tag : metric.id().tags()) {
if (tag.key() == "method") {
Copy link
Member

Choose a reason for hiding this comment

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

这里要改掉吧。

@ujjboy ujjboy added this to the 5.4.0 milestone May 23, 2018
@ujjboy ujjboy added the extension Integrate with 3rd component label May 23, 2018
@ujjboy ujjboy changed the title Sofatracer integration Integrate with sofa-tracer for support opentracing. May 23, 2018
@ujjboy ujjboy merged commit 8cc5c1c into sofastack:master May 23, 2018
@leizhiyuan leizhiyuan deleted the sofatracer-integration branch November 9, 2018 04:00
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
extension Integrate with 3rd component
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants