{"action":"closed","issue":{"url":"https://api.github.com/repos/alipay/sofa-tracer/issues/65","repository_url":"https://api.github.com/repos/alipay/sofa-tracer","labels_url":"https://api.github.com/repos/alipay/sofa-tracer/issues/65/labels{/name}","comments_url":"https://api.github.com/repos/alipay/sofa-tracer/issues/65/comments","events_url":"https://api.github.com/repos/alipay/sofa-tracer/issues/65/events","html_url":"https://github.com/alipay/sofa-tracer/issues/65","id":356344196,"node_id":"MDU6SXNzdWUzNTYzNDQxOTY=","number":65,"title":"zipkin 模型兼容 SOFARpc ","user":{"login":"glmapper","id":35319286,"node_id":"MDQ6VXNlcjM1MzE5Mjg2","avatar_url":"https://avatars1.githubusercontent.com/u/35319286?v=4","gravatar_id":"","url":"https://api.github.com/users/glmapper","html_url":"https://github.com/glmapper","followers_url":"https://api.github.com/users/glmapper/followers","following_url":"https://api.github.com/users/glmapper/following{/other_user}","gists_url":"https://api.github.com/users/glmapper/gists{/gist_id}","starred_url":"https://api.github.com/users/glmapper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/glmapper/subscriptions","organizations_url":"https://api.github.com/users/glmapper/orgs","repos_url":"https://api.github.com/users/glmapper/repos","events_url":"https://api.github.com/users/glmapper/events{/privacy}","received_events_url":"https://api.github.com/users/glmapper/received_events","type":"User","site_admin":false},"labels":[{"id":932402734,"node_id":"MDU6TGFiZWw5MzI0MDI3MzQ=","url":"https://api.github.com/repos/alipay/sofa-tracer/labels/bug","name":"bug","color":"d73a4a","default":true},{"id":932402738,"node_id":"MDU6TGFiZWw5MzI0MDI3Mzg=","url":"https://api.github.com/repos/alipay/sofa-tracer/labels/enhancement","name":"enhancement","color":"a2eeef","default":true}],"state":"closed","locked":false,"assignee":{"login":"glmapper","id":35319286,"node_id":"MDQ6VXNlcjM1MzE5Mjg2","avatar_url":"https://avatars1.githubusercontent.com/u/35319286?v=4","gravatar_id":"","url":"https://api.github.com/users/glmapper","html_url":"https://github.com/glmapper","followers_url":"https://api.github.com/users/glmapper/followers","following_url":"https://api.github.com/users/glmapper/following{/other_user}","gists_url":"https://api.github.com/users/glmapper/gists{/gist_id}","starred_url":"https://api.github.com/users/glmapper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/glmapper/subscriptions","organizations_url":"https://api.github.com/users/glmapper/orgs","repos_url":"https://api.github.com/users/glmapper/repos","events_url":"https://api.github.com/users/glmapper/events{/privacy}","received_events_url":"https://api.github.com/users/glmapper/received_events","type":"User","site_admin":false},"assignees":[{"login":"glmapper","id":35319286,"node_id":"MDQ6VXNlcjM1MzE5Mjg2","avatar_url":"https://avatars1.githubusercontent.com/u/35319286?v=4","gravatar_id":"","url":"https://api.github.com/users/glmapper","html_url":"https://github.com/glmapper","followers_url":"https://api.github.com/users/glmapper/followers","following_url":"https://api.github.com/users/glmapper/following{/other_user}","gists_url":"https://api.github.com/users/glmapper/gists{/gist_id}","starred_url":"https://api.github.com/users/glmapper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/glmapper/subscriptions","organizations_url":"https://api.github.com/users/glmapper/orgs","repos_url":"https://api.github.com/users/glmapper/repos","events_url":"https://api.github.com/users/glmapper/events{/privacy}","received_events_url":"https://api.github.com/users/glmapper/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/alipay/sofa-tracer/milestones/2","html_url":"https://github.com/alipay/sofa-tracer/milestone/2","labels_url":"https://api.github.com/repos/alipay/sofa-tracer/milestones/2/labels","id":3491081,"node_id":"MDk6TWlsZXN0b25lMzQ5MTA4MQ==","number":2,"title":"2.2.0","description":"2.2.0","creator":{"login":"guanchao-yang","id":32863418,"node_id":"MDQ6VXNlcjMyODYzNDE4","avatar_url":"https://avatars3.githubusercontent.com/u/32863418?v=4","gravatar_id":"","url":"https://api.github.com/users/guanchao-yang","html_url":"https://github.com/guanchao-yang","followers_url":"https://api.github.com/users/guanchao-yang/followers","following_url":"https://api.github.com/users/guanchao-yang/following{/other_user}","gists_url":"https://api.github.com/users/guanchao-yang/gists{/gist_id}","starred_url":"https://api.github.com/users/guanchao-yang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guanchao-yang/subscriptions","organizations_url":"https://api.github.com/users/guanchao-yang/orgs","repos_url":"https://api.github.com/users/guanchao-yang/repos","events_url":"https://api.github.com/users/guanchao-yang/events{/privacy}","received_events_url":"https://api.github.com/users/guanchao-yang/received_events","type":"User","site_admin":false},"open_issues":5,"closed_issues":16,"state":"open","created_at":"2018-07-12T10:48:41Z","updated_at":"2018-09-11T12:14:17Z","due_on":null,"closed_at":null},"comments":0,"created_at":"2018-09-03T03:04:46Z","updated_at":"2018-09-11T12:14:17Z","closed_at":"2018-09-11T12:14:17Z","author_association":"COLLABORATOR","body":"### Describe the bug\r\n\r\nSOFATracer 上报数据到 zipkin 时，在v2模型中，zipkin 会通过广度优先遍历来构建依赖树，实际上在展示services 或者 dependencies时，zipkin ui中的展示会依赖endpiont中的serviceName。\r\n* 当前SOFATracer 上报 SOFARpc 的数据时，存在一个问题，SOFARpc 的 span有两个（client&server），但是这两个span具有相同的spanId和parentId，区别在于span.kind 不同。\r\n* 当前zipkin在构建依赖树时，因为依赖于endpiont中的serviceName。该 servieName 依赖于 idToNode（Node.TreeBuilder 中的属性，Map 结构，映射关系为 spanId -> span）。\r\n\r\n```\r\n Node<V> previous = idToNode.put(id, node);\r\n if (previous != null) \r\n\tnode.setValue(mergeFunction.merge(previous.value, node.value));\r\n```\r\n这里当前node为rpc server 类型时，previous 返回结果不为null，会执行merge操作，该merge操作的核心就是设置当前rpc node的remoteEndpoint，值为 rpc client 的 localEndpoint。\r\n\r\n这样会有一个问题，因为SOFARpc上报的 span 数据，client 和 server 除了span.kind 之外是相同的。所以最终得到的idToNode中只会包含kind为server的span ，client 被 merge了。这样就会导致 server -> server 的情况，与zipkin的client -> server 链路模型有冲突。\r\n\r\n* 通过构建 httpclient->mvc->rpc->h2 的链路进行测试，结果表明:在没有做SOFARpc数据上报适配时 ，dependencies中链路展示有问题，实际构建出来的链路是：httpclient->mvc ，rpc->h2 ，链路被分段。\r\n\r\n### Expected behavior\r\n\r\n在使用SOFARpc组件时，SOFATracer可以构建完整的调用链路。 httpclient->mvc->rpc->h2 \r\nE.g\r\n\r\n### Steps to reproduce\r\n基于当前版本并且使用SOFARpc来构建链路\r\n\r\n"}}
{"actor":{"display_login":"guanchao-yang"}}