-
Notifications
You must be signed in to change notification settings - Fork 375
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
SOFATracer support report trace data to jaeger and skywalking #443
Comments
上报SW的span的转换每一个Span封装成一个Segment发送几种关键数据属性
Segmentpublic class Segment {
private String traceId;
private String traceSegmentId;
// 这一个segment中的所有span
private List<Span> spans = new LinkedList<>();
//执行同样操作的一组服务名,每一个服务名会在拓扑图中单独显示为一个节点,同一个服务名下的从span中得到的指标汇集到到一起作为这个服务的指标
private String service;
//实例名
private String serviceInstance;
// Whether the segment includes all tracked spans.
// In the production environment tracked, some tasks could include too many spans for one request context, such as a batch update for a cache, or an async job.
// The agent/SDK could optimize or ignore some tracked spans for better performance.
// In this case, the value should be flagged as TRUE.
private boolean isSizeLimited;
} Span private int spanId;
private int parentSpanId;
private Long startTime;
private Long endTime;
private List<SegmentReference> refs = new LinkedList<>();
private String operationName;
//peer在exit span中使用对构建拓扑图有至关重要的作用
private String peer;
private SpanType spanType;
// Span layer represent the component tech stack, related to the network tech.
private SpanLayer spanLayer;
private int componentId;
private boolean isError;
private List<KeyStringValuePair> tags = new LinkedList<>();
private List<Log> logs = new LinkedList<>();
private boolean skipAnalysis; SegmentReference代表segment之间的关系 public class SegmentReference {
private RefType refType;
private String traceId;
private String parentTraceSegmentId;
private int parentSpanId;
private String parentService;
private String parentServiceInstance;
private String parentEndpoint;
// The network address, including ip/hostname and port, which is used in the client side.
// Such as Client --> use 127.0.11.8:913 -> Server
// then, in the reference of entry span reported by Server, the value of this field is 127.0.11.8:913.
// This plays the important role in the SkyWalking STAM(Streaming Topology Analysis Method)
// For more details, read https://wu-sheng.github.io/STAM/
private String networkAddressUsedAtPeer;
} 把每一个span单独封装成一个segmentSW中的三种Span,EntrySpan(代表service provider),EntrySpan(代表没有和其他remote service关联的方法),ExitSpan(client of service ),在转换的过程中是根据SofaTracerSpan的 字段转换segment
EntrySpan
Span中refs
目前有的字段取不到数据还是空着的测试还是简单的测试例子 结果仪表盘trace数据一个线程中一次请求的所有span封装成一个segment发送在内部维护 一个segment,当一个span结束的时候看是clientSpan还是serverSpan,如果是serverSpan说明当前线程中所有需要的操作已完成可以发送segment了,如果是后者加入segment中继续。 segmentId: traceId+当前的EntrySpan的spanId |
关于SW展示拓扑图的不可行讨论
正常展示拓扑图需要的参数
图一 SofaRPC中网络API获取的IP与client span中的不一样同时未在segmentReference中设置父服务相关信息 不可行原因
图二 server端显示空白实例 设置 segmentReference.setParentService("dubbo-consumer");
segmentReference.setParentServiceInstance("dubbo-consumer@172.28.16.26");
segmentReference.setParentEndpoint("HelloService#SayHello"); 图三 拓扑图正常展示 |
@nobodyiam @xzchaoo 请评估下这个 PR 是否可以 merge 并且发布 |
#303 #372
The text was updated successfully, but these errors were encountered: