Skip to content

Commit

Permalink
Add Open telemetry span event on test runner validation retries
Browse files Browse the repository at this point in the history
  • Loading branch information
fredjn committed Jun 11, 2024
1 parent 6fa23a4 commit dc421c9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion python/src/etos_api/library/validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
from pydantic import BaseModel # pylint:disable=no-name-in-module
from pydantic import ValidationError, conlist, constr, field_validator
from pydantic.fields import PrivateAttr
from opentelemetry import trace

from etos_api.library.docker import Docker

Expand Down Expand Up @@ -181,6 +182,7 @@ async def validate(self, test_suite_url):
:type test_suite_url: str
:raises ValidationError: If the suite did not validate.
"""
span = trace.get_current_span()
downloaded_suite = await self._download_suite(test_suite_url)
for suite_json in downloaded_suite:
test_runners = set()
Expand All @@ -197,7 +199,9 @@ async def validate(self, test_suite_url):
result = await docker.digest(test_runner)
if result:
break

span.add_event(
f"Test runner validation unsuccessful, retrying {3 - attempt} more times"
)
self.logger.warning(
"Test runner %s validation unsuccessful, retrying %d more times",
test_runner,
Expand Down

0 comments on commit dc421c9

Please sign in to comment.