Sync with Remove time_ns from API (#342)

This commit is contained in:
Diego Hurtado
2021-03-10 10:21:45 -06:00
committed by GitHub
parent 9ef4410fa8
commit 0917dad997
7 changed files with 30 additions and 15 deletions

View File

@ -21,7 +21,7 @@ from opentelemetry.context import Context, attach, detach, set_value
from opentelemetry.sdk.trace import Span, SpanProcessor
from opentelemetry.sdk.trace.export import SpanExporter
from opentelemetry.trace import INVALID_TRACE_ID
from opentelemetry.util.time import time_ns
from opentelemetry.util._time import _time_ns
logger = logging.getLogger(__name__)
@ -127,9 +127,9 @@ class DatadogExportSpanProcessor(SpanProcessor):
break
# substract the duration of this export call to the next timeout
start = time_ns()
start = _time_ns()
self.export()
end = time_ns()
end = _time_ns()
duration = (end - start) / 1e9
timeout = self.schedule_delay_millis / 1e3 - duration