diff --git a/src/promptflow-core/promptflow/contracts/run_info.py b/src/promptflow-core/promptflow/contracts/run_info.py index aaa9747a829..986ba4d7350 100644 --- a/src/promptflow-core/promptflow/contracts/run_info.py +++ b/src/promptflow-core/promptflow/contracts/run_info.py @@ -230,6 +230,7 @@ def deserialize(data: dict) -> "FlowRunInfo": system_metrics=data.get("system_metrics", None), result=data.get("result", None), upload_metrics=data.get("upload_metrics", False), + otel_trace_id=data.get("otel_trace_id", ""), message_format=data.get("message_format", MessageFormatType.BASIC), ) return flow_run_info diff --git a/src/promptflow/tests/executor/unittests/contracts/test_run_info.py b/src/promptflow/tests/executor/unittests/contracts/test_run_info.py index c0faa6ea51d..b6469a85518 100644 --- a/src/promptflow/tests/executor/unittests/contracts/test_run_info.py +++ b/src/promptflow/tests/executor/unittests/contracts/test_run_info.py @@ -125,6 +125,7 @@ def test_deserialize(self): "system_metrics": {"duration": "00:00:00.0154544", "total_tokens": 0}, "result": {"answer": "Hello world: What's promptflow?"}, "upload_metrics": False, + "otel_trace_id": "test_otel_trace_id", } flow_run_info = FlowRunInfo.deserialize(flow_run_info_dict) assert flow_run_info.index == 0 @@ -134,3 +135,4 @@ def test_deserialize(self): assert flow_run_info.api_calls is None assert flow_run_info.system_metrics == {"duration": "00:00:00.0154544", "total_tokens": 0} assert flow_run_info.output == {"answer": "Hello world: What's promptflow?"} + assert flow_run_info.otel_trace_id == "test_otel_trace_id"