From bd9a035b1a011c49cf7de8888ac7e4c3c6402300 Mon Sep 17 00:00:00 2001 From: Fredrik Fristedt Date: Fri, 17 May 2024 11:17:09 +0200 Subject: [PATCH] Fix rebase misstake that removed otel spans --- .../environment_provider.py | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/src/environment_provider/environment_provider.py b/src/environment_provider/environment_provider.py index 096b54a..888fbc4 100644 --- a/src/environment_provider/environment_provider.py +++ b/src/environment_provider/environment_provider.py @@ -418,18 +418,21 @@ def checkout( timeout = self.checkout_timeout() while time.time() < timeout: self.set_total_test_count_and_test_runners(test_runners) - # Check out and assign IUTs to test runners. - iuts = self.iut_provider.wait_for_and_checkout_iuts( - minimum_amount=1, - maximum_amount=self.dataset.get( - "maximum_amount", - os.getenv( - "ETOS_MAX_PARALLEL_IUTS", - self.etos.config.get("TOTAL_TEST_COUNT"), + + with self.tracer.start_as_current_span("request_iuts", kind=SpanKind.CLIENT) as span: + # Check out and assign IUTs to test runners. + iuts = self.iut_provider.wait_for_and_checkout_iuts( + minimum_amount=1, + maximum_amount=self.dataset.get( + "maximum_amount", + os.getenv( + "ETOS_MAX_PARALLEL_IUTS", + self.etos.config.get("TOTAL_TEST_COUNT"), + ), ), - ), - ) - self.splitter.assign_iuts(test_runners, iuts) + ) + self.splitter.assign_iuts(test_runners, iuts) + span.set_attribute(SemConvAttributes.IUT_DESCRIPTION, str(iuts)) for test_runner in test_runners.keys(): self.dataset.add("test_runner", test_runner)