Jump to content

Connect Leeroopedia MCP: Equip your AI agents to search best practices, build plans, verify code, diagnose failures, and look up hyperparameter defaults.

Principle:Wandb Weave Call Execution

From Leeroopedia
Knowledge Sources
Domains Observability, Distributed_Tracing
Last Updated 2026-02-14 00:00 GMT

Overview

A trace lifecycle mechanism that creates, manages, and finalizes call records to capture the full execution context of traced operations.

Description

Call Execution is the runtime phase where traced function invocations are recorded as structured Call objects. Each Call captures the operation name, inputs, outputs, timing, exceptions, and its position in the call hierarchy (parent-child relationships via trace and parent IDs).

This principle covers the full lifecycle: creating a call when execution begins, managing a thread-local call stack for automatic parent-child linking, and finalizing the call with output data and computed summaries when execution completes.

Usage

This principle operates automatically when traced functions (decorated with @weave.op) are invoked. It can also be used explicitly via the WeaveClient API for advanced scenarios like manual call management or custom instrumentation.

Theoretical Basis

Distributed tracing systems model execution as a tree of spans (or calls):

  1. Call Creation: Generate a unique call ID, record start time, capture inputs, and push onto the thread-local call stack.
  2. Stack Management: Use the call stack to automatically determine parent-child relationships. Each new call inherits the current stack top as its parent.
  3. Call Finalization: Record end time, capture output or exception, compute summary statistics (token usage, status counts), and pop from the stack.

Call={id,trace_id,parent_id,op_name,inputs,output,started_at,ended_at,summary}

The thread-local stack ensures correct parent-child relationships even in deeply nested call chains.

Related Pages

Implemented By

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment