Circle V2 API Docs
    Preparing search index...

    Function withStepTrace

    • Opens a Datadog/OTel child span (always, unless component:ai is disabled) and, when LangSmith tracing is enabled, an intermediate LangSmith CHILD span that nests under the active root (opened by withRootTrace). Reuses the process-wide getLangSmithClient() so every LangSmith span lands in one trace tree and shares a single batch queue. Unlike withRootTrace, it does NOT flush — the enclosing root owns the flush.

      This is the call-site escape hatch: prefer defineStep, which wraps a function at its definition so the callable keeps its name and there's no traced twin. Reach for withStepTrace only for inline regions or third-party functions you can't wrap at the definition.

      Type Parameters

      • T

      Parameters

      Returns Promise<T>