From 7eb9dd4f36670e277113e90f4e9375f6948fab8c Mon Sep 17 00:00:00 2001 From: Yangtong Xu Date: Thu, 25 Apr 2024 17:45:06 +0800 Subject: [PATCH 1/2] [Bugfix] Fix missing otel_trace_id in FlowRunInfo.otel_trace_id --- src/promptflow-core/promptflow/contracts/run_info.py | 1 + 1 file changed, 1 insertion(+) 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 From 5858612b12a10bfb540732db6bb637275d2c6390 Mon Sep 17 00:00:00 2001 From: Yangtong Xu Date: Thu, 25 Apr 2024 17:47:03 +0800 Subject: [PATCH 2/2] fix --- .../tests/executor/unittests/contracts/test_run_info.py | 2 ++ 1 file changed, 2 insertions(+) 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"