Updates to brave 3.0.0, removing zipkin's Annotation.duration
This commit is contained in:
2
pom.xml
2
pom.xml
@@ -196,7 +196,7 @@
|
||||
</dependencyManagement>
|
||||
|
||||
<properties>
|
||||
<brave.version>3.0.0-rc-1</brave.version>
|
||||
<brave.version>3.0.0</brave.version>
|
||||
<spring-cloud-netflix.version>1.1.0.BUILD-SNAPSHOT</spring-cloud-netflix.version>
|
||||
<aspectj.version>1.8.4</aspectj.version>
|
||||
<spock.version>1.0-groovy-2.4</spock.version>
|
||||
|
||||
@@ -191,26 +191,9 @@ public class ZipkinSpanListener {
|
||||
*/
|
||||
private List<Annotation> createZipkinAnnotations(Span span, Endpoint endpoint) {
|
||||
List<Annotation> annotationList = new ArrayList<>();
|
||||
|
||||
long srTime = 0, csTime = 0;
|
||||
// add sleuth time annotation
|
||||
for (TimelineAnnotation ta : span.getTimelineAnnotations()) {
|
||||
Annotation zipkinAnnotation = createZipkinAnnotation(ta.getMsg(),
|
||||
ta.getTime(), 0, endpoint, true);
|
||||
if (zipkinCoreConstants.SERVER_RECV.equals(ta.getMsg())) {
|
||||
srTime = ta.getTime();
|
||||
}
|
||||
if (zipkinCoreConstants.SERVER_SEND.equals(ta.getMsg()) && srTime != 0) {
|
||||
zipkinAnnotation
|
||||
.setDuration(new Long(ta.getTime() - srTime).intValue() * 1000);
|
||||
}
|
||||
if (zipkinCoreConstants.CLIENT_SEND.equals(ta.getMsg())) {
|
||||
csTime = ta.getTime();
|
||||
}
|
||||
if (zipkinCoreConstants.CLIENT_RECV.equals(ta.getMsg()) && csTime != 0) {
|
||||
zipkinAnnotation
|
||||
.setDuration(new Long(ta.getTime() - csTime).intValue() * 1000);
|
||||
}
|
||||
ta.getTime(), endpoint, true);
|
||||
annotationList.add(zipkinAnnotation);
|
||||
}
|
||||
return annotationList;
|
||||
@@ -249,7 +232,7 @@ public class ZipkinSpanListener {
|
||||
* @param sendRequest use the first or last timestamp.
|
||||
*/
|
||||
private static Annotation createZipkinAnnotation(String value, long time,
|
||||
int duration, Endpoint endpoint, boolean sendRequest) {
|
||||
Endpoint endpoint, boolean sendRequest) {
|
||||
Annotation annotation = new Annotation();
|
||||
annotation.setHost(endpoint);
|
||||
|
||||
@@ -260,10 +243,6 @@ public class ZipkinSpanListener {
|
||||
else {
|
||||
annotation.setTimestamp(time * 1000);
|
||||
}
|
||||
|
||||
if (duration > 0) {
|
||||
annotation.setDuration(duration * 1000);
|
||||
}
|
||||
annotation.setValue(value);
|
||||
return annotation;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user