Trace
A trace is one top-level model call: a singlegenerateText,
streamText, generateObject, or streamObject invocation. It carries the
call’s identity (name, agent, workflow, run, session), free-form metadata, and
a list of spans.
Two rules are checked in the SDK and again at ingest:
- Every trace must set
traceNameoragentName(both is fine, see Trace name). workflowNameandworkflowRunIdgo together. Pass both or neither.
Span
A span is a unit of work inside a trace: a model step, a tool call, or anything else. Spans carry timing, status, model identity, token usage, and optional input/output text.Usage
Every usage field is an optional non-negative integer. Each is priced on its own at ingest.Workflow and run
A workflow is a named, repeatable process (for exampledeploy-digest). A
workflow run is one execution of it, identified by workflowRunId. Every
trace sharing a workflowRunId belongs to the same run, and the dashboard
shows them as a single timeline.
Trace name
A trace name (traceName) is the call’s human label. Use it for a one-off
call that isn’t an agent, like
fog.integration({ traceName: "classify-email" }), so the call is easy to find
and group in the dashboard.
The label a trace displays is traceName ?? agentName. If you set only
agentName, that’s the label. If you set both, the call belongs to the agent
and shows the traceName. Every trace must set at least one of the two.
Agent
An agent is a named actor (agentName) responsible for a call. Agents give
you per-agent totals for cost, latency, and errors across every trace they
produced, no matter which workflow they ran in.
Session
A session (sessionId) groups the traces that belong to one conversation
or user interaction, across workflows and agents. Use it to follow a single
user thread end to end.
Customer
A customer (customer) is the person or company your app is serving with a
call, such as a tenant or end user. It rolls cost up per customer (the
Customers card on the Overview), which is the
building block for usage-based pricing on top of Foglamp.
name and imageUrl are display-only and can change over time (Foglamp keeps
the latest). customer is optional; leaving it out changes nothing.
How it streams
Embeddings aren’t captured yet. Both SDK paths trace
generateText,
streamText, generateObject, and streamObject, plus the agent classes.
embed, embedMany, and rerank are not traced yet: an embed call today
produces a trace with a root span but no token usage or cost. The embedding
span type is reserved for when this lands..png?fit=max&auto=format&n=1sml0kwCw1BNtiz-&q=85&s=a7c846a133aa3480dc1e03a2da5fec2b)
.png?fit=max&auto=format&n=1sml0kwCw1BNtiz-&q=85&s=6534218552b79980770f11c40aafd6ec)