From 6b13da98e4c53b466eb2153690748911e5537f6f Mon Sep 17 00:00:00 2001 From: Sebastian Wiedenroth Date: Thu, 13 Feb 2020 17:44:13 +0100 Subject: [PATCH] Client should handle system clock changes better --- lightstep/http_converter.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lightstep/http_converter.py b/lightstep/http_converter.py index c17573d..64f9b1b 100644 --- a/lightstep/http_converter.py +++ b/lightstep/http_converter.py @@ -40,6 +40,8 @@ def create_span_record(self, span, guid): span_context = SpanContext(trace_id=span.context.trace_id, span_id=span.context.span_id) seconds, nanos = util._time_to_seconds_nanos(span.start_time) + if span.duration < 0: + span.duration = 0 span_record = Span(span_context=span_context, operation_name=util._coerce_str(span.operation_name), start_timestamp=Timestamp(seconds=seconds, nanos=nanos),