Authored by wangning

update

... ... @@ -32,5 +32,5 @@ public class SpanInfo implements Serializable {
*/
private String pageId;
private Map<String, String> tags;
private String httpHost;
}
\ No newline at end of file
... ...
... ... @@ -88,7 +88,9 @@ public class TraceAnalyzeHandler implements TraceHandler, Serializable {
spanInfo.setEndpoint(logEvent);
spanInfo.setIp(spans.getHost().getAddress());
spanInfo.setReceive(spans.getReceive());
spanInfo.setTags(span.tags());
if(span.tags()!=null){
spanInfo.setHttpHost(span.tags().get("http.host"));
}
spanInfoList.add(new Tuple2<>(spanInfo.getTraceid(), spanInfo));
}
}
... ... @@ -246,7 +248,7 @@ public class TraceAnalyzeHandler implements TraceHandler, Serializable {
sortSpanTrace.cache();
//处理span+ip的耗时分布
// handlerSpanIp(sortSpanTrace);
handlerSpanIp(sortSpanTrace);
JavaPairDStream<String, ApiTraceResult> apiResultTraceDStream = sortSpanTrace.mapToPair(analyzer.ConvertTraceResultFunc) ;
... ... @@ -285,11 +287,8 @@ public class TraceAnalyzeHandler implements TraceHandler, Serializable {
if(spanInfo.getTraceid().equals(spanInfo.getSpanid())){
ip = spanInfo.getIp();
}else{
if(spanInfo.getTags()!=null){
String httpHost = spanInfo.getTags().get("http.host");
if(StringUtils.isNoneBlank(httpHost)){
ip = httpHost;
}
if(StringUtils.isNotBlank(spanInfo.getHttpHost())){
ip = spanInfo.getHttpHost();
}
}
... ...