mirror of
https://github.com/langgenius/dify.git
synced 2026-02-23 03:17:57 +08:00
Integrate enterprise per-node telemetry into workflow execution pipeline and complete parent trace context propagation through the trace system. Enterprise node execution tracing (GATED): - Add WorkflowNodeTraceInfo entity with full node execution metadata - Emit node trace on every node completion (succeeded/failed/exception/paused) - Include LLM tokens, tool info, iteration/loop context, and timing data - Hook into workflow persistence layer via _enqueue_node_trace_task() Parent trace context wiring (COMMUNITY): - Pass parent_trace_context through TraceTask to WorkflowTraceInfo.metadata - Enables child workflows to include parent attributes for all trace providers - Completes the distributed tracing feature started in first commit Dual processing architecture: - TraceQueueManager processes traces when enterprise OR per-app tracing enabled - Celery task calls both EnterpriseDataTrace AND per-app trace providers - Single queue, dual dispatch pattern Files changed: - core/ops/entities/trace_entity.py: Add WorkflowNodeTraceInfo + NODE_EXECUTION_TRACE - core/app/workflow/layers/persistence.py: Emit node traces + parent context - core/ops/ops_trace_manager.py: node_execution_trace() + dual dispatch - tasks/ops_trace_task.py: Call enterprise trace handler