Skip to content

Commit 5f1ebc8

Browse files
committed
Check if duration is zero before overriding
Signed-off-by: Geoffrey Beausire <g.beausire@criteo.com>
1 parent caabb43 commit 5f1ebc8

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

model/converter/thrift/zipkin/to_domain.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -200,21 +200,20 @@ func (td toDomain) getStartTimeAndDuration(zSpan *zipkincore.Span) (int64, int64
200200
if cs != nil {
201201
timestamp = cs.Timestamp
202202
cr := td.findAnnotation(zSpan, zipkincore.CLIENT_RECV)
203-
if cr != nil {
203+
if cr != nil && duration == 0 {
204204
duration = cr.Timestamp - cs.Timestamp
205205
}
206206
} else if sr != nil {
207207
timestamp = sr.Timestamp
208208
ss := td.findAnnotation(zSpan, zipkincore.SERVER_SEND)
209-
if ss != nil {
209+
if ss != nil && duration == 0 {
210210
duration = ss.Timestamp - sr.Timestamp
211211
}
212212
}
213213
}
214214
return timestamp, duration
215215
}
216216

217-
218217
// generateProcess takes a Zipkin Span and produces a model.Process.
219218
// An optional error may also be returned, but it is not fatal.
220219
func (td toDomain) generateProcess(zSpan *zipkincore.Span) (*model.Process, error) {

0 commit comments

Comments
 (0)