mirror of
https://github.com/deepset-ai/haystack.git
synced 2026-01-05 11:38:20 +00:00
feat: Trace pipeline run input/output data (#7590)
* Trace pipeline run * Add reno note * Update tracing tests to check input_data and output_data * empty --------- Co-authored-by: anakin87 <stefanofiorucci@gmail.com> Co-authored-by: Silvano Cerza <3314350+silvanocerza@users.noreply.github.com>
This commit is contained in:
parent
451fae880e
commit
8cb3cecf34
@ -796,17 +796,19 @@ class Pipeline:
|
||||
|
||||
include_outputs_from = set() if include_outputs_from is None else include_outputs_from
|
||||
|
||||
# This is what we'll return at the end
|
||||
final_outputs: Dict[Any, Any] = {}
|
||||
|
||||
with tracing.tracer.trace(
|
||||
"haystack.pipeline.run",
|
||||
tags={
|
||||
"haystack.pipeline.input_data": data,
|
||||
"haystack.pipeline.output_data": final_outputs,
|
||||
"haystack.pipeline.debug": debug,
|
||||
"haystack.pipeline.metadata": self.metadata,
|
||||
"haystack.pipeline.max_loops_allowed": self.max_loops_allowed,
|
||||
},
|
||||
):
|
||||
# This is what we'll return at the end
|
||||
final_outputs: Dict[Any, Any] = {}
|
||||
|
||||
# Cache for extra outputs, if enabled.
|
||||
extra_outputs: Dict[Any, Any] = {}
|
||||
|
||||
|
||||
@ -0,0 +1,4 @@
|
||||
---
|
||||
enhancements:
|
||||
- |
|
||||
Improved pipeline run tracing to include pipeline input/output data.
|
||||
@ -39,6 +39,8 @@ class TestTracing:
|
||||
SpyingSpan(
|
||||
operation_name="haystack.pipeline.run",
|
||||
tags={
|
||||
"haystack.pipeline.input_data": {"hello": {"word": "world"}},
|
||||
"haystack.pipeline.output_data": {"hello2": {"output": "Hello, Hello, world!!"}},
|
||||
"haystack.pipeline.debug": False,
|
||||
"haystack.pipeline.metadata": {},
|
||||
"haystack.pipeline.max_loops_allowed": 100,
|
||||
@ -97,6 +99,8 @@ class TestTracing:
|
||||
"haystack.pipeline.debug": False,
|
||||
"haystack.pipeline.metadata": {},
|
||||
"haystack.pipeline.max_loops_allowed": 100,
|
||||
"haystack.pipeline.input_data": {"hello": {"word": "world"}},
|
||||
"haystack.pipeline.output_data": {"hello2": {"output": "Hello, Hello, world!!"}},
|
||||
},
|
||||
trace_id=ANY,
|
||||
span_id=ANY,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user