Skip to content

Observe and debug agents

View as Markdown

weft records a run as OpenTelemetry data: spans for its structure, log records for its events, transcript and requests. otel.Install sends them to one or more destinations, by default the local sink ./.weft/weft.db. Studio, the devtools panel, the playground and the weft command all read that recording back; the playground also sends commands to your running app, which dials Studio through weft/runtime.

Recording: the app's runs go through otel.Install to the local sink or a Studio, and the Inspector reads them back.Your app runs agents with agt.Generate; every run leaves as OpenTelemetry spans and log records. otel.Install starts the pipeline and sends them to every destination at once; with no options and no destination named by the environment it writes the local sink only. otel.Local writes .weft/weft.db synchronously; otel.Studio exports OTLP over HTTP to a running weft studio. The Inspector reads them back: embedded with studio.Handler over otel.LocalDB(), or served by weft studio.
One pipeline, several destinations. The local sink and Studio hold content; the Inspector reads the recording back.

The core reports every run through the OTel API, which does nothing until a provider is registered. weft/otel registers one, configured for weft: one line installs it, each destination has its own content policy, and the local sink needs no network. Any OTLP backend takes the same data, and a non-Go agent that exports the standard GenAI spans appears in Studio too.

Start here. Every other page reads what these pages set up.

The Inspector: a web UI and JSON API over the recording, embedded in your app or run as weft studio.

Your app dials Studio and runs its experiment commands as runs of the agents you register.

Studio’s run view inside your own web page, scoped to the conversation on screen.