diff --git a/mlrun/model_monitoring/applications/_application_steps.py b/mlrun/model_monitoring/applications/_application_steps.py index 532203ba52f9..c155ddc6d365 100644 --- a/mlrun/model_monitoring/applications/_application_steps.py +++ b/mlrun/model_monitoring/applications/_application_steps.py @@ -13,6 +13,7 @@ # limitations under the License. import json +import traceback from typing import Any, Optional, Union import mlrun.common.schemas.alert as alert_objects @@ -164,11 +165,15 @@ def do(self, event): error_data = { "Endpoint ID": event.body.endpoint_id, "Application Class": event.body.application_name, - "Error": event.error, + "Error": "".join( + traceback.format_exception(None, event.error, event.error.__traceback__) + ), "Timestamp": event.timestamp, } logger.error("Error in application step", **error_data) + error_data["Error"] = event.error + event_data = alert_objects.Event( kind=alert_objects.EventKind.MM_APP_FAILED, entity=alert_objects.EventEntities(