diff --git a/monitoring/Dockerfile b/monitoring/Dockerfile index 841605bb7c..4d24df27a8 100644 --- a/monitoring/Dockerfile +++ b/monitoring/Dockerfile @@ -9,7 +9,7 @@ # # This image is intended to be built from the repository root context/folder. -FROM python:3.8-slim +FROM python:3.11-slim # Not -alpine because: https://stackoverflow.com/a/58028091/651139 RUN apt-get update && apt-get install -y openssl curl libgeos-dev gcc && apt-get install ca-certificates diff --git a/monitoring/mock_uss/database.py b/monitoring/mock_uss/database.py index df72ee08f8..16180825de 100644 --- a/monitoring/mock_uss/database.py +++ b/monitoring/mock_uss/database.py @@ -25,9 +25,7 @@ def from_exception(trigger: str, e: BaseException): trigger=trigger, type=type(e).__name__, message=str(e), - stacktrace="".join( - traceback.format_exception(etype=type(e), value=e, tb=e.__traceback__) - ), + stacktrace="".join(traceback.format_exception(e)), ) diff --git a/monitoring/mock_uss/scd_injection/routes_injection.py b/monitoring/mock_uss/scd_injection/routes_injection.py index 89e695f189..1cf76e0b9f 100644 --- a/monitoring/mock_uss/scd_injection/routes_injection.py +++ b/monitoring/mock_uss/scd_injection/routes_injection.py @@ -68,9 +68,7 @@ def _make_stacktrace(e) -> str: - return "".join( - traceback.format_exception(etype=type(e), value=e, tb=e.__traceback__) - ) + return "".join(traceback.format_exception(e)) @webapp.route("/scdsc/v1/status", methods=["GET"]) diff --git a/monitoring/mock_uss/server.py b/monitoring/mock_uss/server.py index e7750c97a4..8bda9f3bed 100644 --- a/monitoring/mock_uss/server.py +++ b/monitoring/mock_uss/server.py @@ -21,9 +21,7 @@ def _get_trace(e: Exception) -> str: - return "".join( - traceback.format_exception(etype=type(e), value=e, tb=e.__traceback__) - ) + return "".join(traceback.format_exception(e)) class TaskTrigger(str, Enum): diff --git a/monitoring/monitorlib/fetch/__init__.py b/monitoring/monitorlib/fetch/__init__.py index d69a3eb321..b4ce9f27f4 100644 --- a/monitoring/monitorlib/fetch/__init__.py +++ b/monitoring/monitorlib/fetch/__init__.py @@ -281,11 +281,7 @@ def __init__(self, msg: str, queries: Optional[Union[Query, List[Query]]] = None @property def stacktrace(self) -> str: - return "".join( - traceback.format_exception( - etype=QueryError, value=self, tb=self.__traceback__ - ) - ) + return "".join(traceback.format_exception(self)) yaml.add_representer(Query, Representer.represent_dict) diff --git a/monitoring/monitorlib/multiprocessing.py b/monitoring/monitorlib/multiprocessing.py index d8bc9cbf8c..a0c8a19e59 100644 --- a/monitoring/monitorlib/multiprocessing.py +++ b/monitoring/monitorlib/multiprocessing.py @@ -46,7 +46,7 @@ def __init__( """ self._lock = multiprocessing.RLock() self._shared_memory = multiprocessing.shared_memory.SharedMemory( - create=True, size=capacity_bytes + self.SIZE_BYTES + create=True, size=int(capacity_bytes + self.SIZE_BYTES) ) self._encoder = ( encoder diff --git a/monitoring/uss_qualifier/reports/report.py b/monitoring/uss_qualifier/reports/report.py index 7be295136b..eb8e04335f 100644 --- a/monitoring/uss_qualifier/reports/report.py +++ b/monitoring/uss_qualifier/reports/report.py @@ -202,9 +202,7 @@ def create_from_exception(e: Exception): type=str(inspection.fullname(e.__class__)), message=str(e), timestamp=StringBasedDateTime(datetime.utcnow()), - stacktrace="".join( - traceback.format_exception(type(e), value=e, tb=e.__traceback__) - ), + stacktrace="".join(traceback.format_exception(e)), ) diff --git a/monitoring/uss_qualifier/scenarios/astm/netrid/common/misbehavior.py b/monitoring/uss_qualifier/scenarios/astm/netrid/common/misbehavior.py index 00ce4e9196..76411d768d 100644 --- a/monitoring/uss_qualifier/scenarios/astm/netrid/common/misbehavior.py +++ b/monitoring/uss_qualifier/scenarios/astm/netrid/common/misbehavior.py @@ -250,9 +250,7 @@ def cleanup(self): ) check.record_passed() except (RequestException, ValueError) as e: - stacktrace = "".join( - traceback.format_exception(type(e), value=e, tb=e.__traceback__) - ) + stacktrace = "".join(traceback.format_exception(e)) check.record_failed( summary="Error while trying to delete test flight", severity=Severity.Medium, diff --git a/monitoring/uss_qualifier/scenarios/astm/netrid/common/nominal_behavior.py b/monitoring/uss_qualifier/scenarios/astm/netrid/common/nominal_behavior.py index 92f95c81e1..12b715e2f7 100644 --- a/monitoring/uss_qualifier/scenarios/astm/netrid/common/nominal_behavior.py +++ b/monitoring/uss_qualifier/scenarios/astm/netrid/common/nominal_behavior.py @@ -136,9 +136,7 @@ def cleanup(self): ) check.record_passed() except (RequestException, ValueError) as e: - stacktrace = "".join( - traceback.format_exception(type(e), value=e, tb=e.__traceback__) - ) + stacktrace = "".join(traceback.format_exception(e)) check.record_failed( summary="Error while trying to delete test flight", severity=Severity.Medium,