observability

package
v1.4.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 3, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EmitNodeComplete

func EmitNodeComplete(ctx context.Context, workflowID, nodeID, nodeType string, latencyMs int64)

EmitNodeComplete 发射 node_complete 事件。

func EmitNodeError

func EmitNodeError(ctx context.Context, workflowID, nodeID, nodeType string, latencyMs int64, err error)

EmitNodeError 发射 node_error 事件。

func EmitNodeStart

func EmitNodeStart(ctx context.Context, workflowID, nodeID, nodeType string)

EmitNodeStart 发射 node_start 事件。

func WithNodeEventEmitter

func WithNodeEventEmitter(ctx context.Context, emitter NodeEventEmitter) context.Context

WithNodeEventEmitter 将 NodeEventEmitter 注入 context。

Types

type NodeEvent

type NodeEvent struct {
	Type       NodeEventType `json:"type"`
	TraceID    string        `json:"trace_id,omitempty"`
	RunID      string        `json:"run_id,omitempty"`
	WorkflowID string        `json:"workflow_id,omitempty"`
	NodeID     string        `json:"node_id"`
	NodeType   string        `json:"node_type,omitempty"`
	LatencyMs  int64         `json:"latency_ms,omitempty"`
	Error      string        `json:"error,omitempty"`
	Timestamp  time.Time     `json:"timestamp"`
}

NodeEvent 节点级观测事件,统一跨层字段。

type NodeEventEmitter

type NodeEventEmitter func(NodeEvent)

NodeEventEmitter 节点事件发射回调。

func NodeEventEmitterFromContext

func NodeEventEmitterFromContext(ctx context.Context) (NodeEventEmitter, bool)

NodeEventEmitterFromContext 从 context 提取 NodeEventEmitter。

type NodeEventType

type NodeEventType = types.WorkflowNodeEventType

NodeEventType 节点事件类型。

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL