- Nested steps with durations. Which tool call belonged to which plan, and how long each took.
- LLM calls. Model, input and output tokens, latency and cost per call, and
total_tokens/total_cost_usdon the run. - Attributes. Dimensions to filter and group runs by: customer, task type, environment, ticket.
Pick a path
All of them land as the same sealed trace. You can mix them across agents.
OpenTelemetry
SenseLab accepts OTLP/HTTP atPOST /v1/traces, in protobuf or JSON, gzip
optional. Authenticate with your API key in X-AMFS-API-Key or
Authorization: Bearer amfs_....
Point an existing exporter at it with environment variables:
_TRACES_ variables as written: exporters append
/v1/traces to the generic OTEL_EXPORTER_OTLP_ENDPOINT themselves.
Or configure it in code:
What is read from your spans
SenseLab understands the OpenTelemetry GenAI conventions, OpenInference, and its ownamfs.* attributes. The first match wins.
Cost is not estimated from the model name on this path. Set
amfs.llm.cost_usd on each LLM span if you want spend on the run; without it
the run shows tokens and no cost.Batches and retries
Exporters batch by time, so one trace often arrives in several requests. Late spans are merged into the run as a new version in the same session chain, and the Runs page shows the latest. A request that repeats spans already recorded writes nothing. The response is the standard OTLP one:200 with an empty body
on success, partial_success listing rejected spans otherwise — never a 4xx
for a mapping problem, so the exporter does not retry spans that were accepted.
Bodies are capped at 4 MiB and each account at 600 requests a minute.
MCP tools
An agent working through the SenseLab MCP server already gets a step for every memory read, recorded action and context. Four tools add the rest, andamfs_commit_outcome seals everything into the run.
A run that reads as a tree:
kind is one of tool, retrieval, agent, chain, memory_read,
memory_write, llm or custom. Inputs and outputs are scanned for secrets
and capped before storage. Spans left open are closed at commit.
The response
The one thing no tool call can capture is what the agent said. SenseLab sees its own tools, so a run committed through MCP has a task, steps and an outcome — and no response, which is what a judge grading the answer reads. Passresponse_text on amfs_commit_outcome: the final message to the user, in
full. Without it the run’s response is empty and any judge that asks about the
answer fails on "response_text": null.
Requires amfs-mcp-server-pro 0.1.53 or later; response_text needs 0.1.54.
Python SDK
An agent built on the Python SDK and connected through the HTTP adapter already commits a run with every memory read, recorded action and context as a step. Two calls add the attributes and the LLM calls, andcommit_outcome seals them in with the rest:
Both the attributes and the calls can also be handed straight to
commit_outcome(attributes={...}, llm_calls=[...]) for a session that did not
record them as it went.
This path gives a run its attributes, tokens and cost. It does not nest
steps — they stay the flat list the run already had. For a step tree with
durations, send the run over OpenTelemetry or
HTTP. Cost is not estimated here either: pass
cost_usd on each
call, or the run shows tokens and no cost.amfs 0.5.10 or later. The TypeScript SDK does not have these calls
yet; use OpenTelemetry or HTTP from Node.js.
HTTP
POST /api/v1/traces persists a run in one request. Steps, LLM calls and
attributes travel inside session_metadata under spans, llm_calls and
attributes; the response carries the sealed run’s id as immutable_trace_id.
run.json
Span fields
llm_calls is what total_tokens and total_cost_usd are summed from. Leave
cost_usd out of a call and the run’s cost is left blank rather than
understated.
What you see afterwards
Open Agents → your agent → Runs and pick a run. The header shows its duration and, once LLM calls are recorded, agent spend — tokens and cost. The Steps pane is the tree you sent; clicking anllm step shows model,
tokens and cost for that call, and the instrumentation hint is gone. Judges
that fail the run point at spans in this tree.
Runs that arrived before you instrumented keep their flat shape. Sealed traces
are never rewritten.
