Skip to main content

record

Function record 

Source
pub fn record(
    label: &str,
    url: &str,
    request: &Value,
    outcome: &Result<Value>,
    attempts: u32,
    elapsed: Duration,
)
Expand description

Record one LLM/embedding call outcome. Best-effort: tracing failures never affect the caller (the LLM call result is returned regardless).

  • label — call-site kind from post_json_retry (“LLM” / “Anthropic” / “Embedding”).
  • url — full endpoint URL (only the host is stored).
  • request— the JSON body sent (contains the prompt/input; no API key).
  • outcome— the final Result after retries.
  • attempts / elapsed — retry count and total wall time.