Skip to main content
A run reaches SenseLab flat unless the agent says otherwise: the memory it read, the tools it called and the contexts it recorded, in order, with no durations, no nesting, no token counts and no cost. The Runs page shows that list and a hint — Want tokens, cost and nested steps? Instrument your agent. Instrumenting adds three things to each run:
  • 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_usd on the run.
  • Attributes. Dimensions to filter and group runs by: customer, task type, environment, ticket.
Judges are shown the same tree, so a fail can point at the exact step.

Pick a path

All three land as the same sealed trace. You can mix them across agents.

OpenTelemetry

SenseLab accepts OTLP/HTTP at POST /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:
The dashboard’s Connect page carries this block with your environment’s host filled in, and a run’s flat step tree links to it with the agent’s id already set. Use the _TRACES_ variables as written: exporters append /v1/traces to the generic OTEL_EXPORTER_OTLP_ENDPOINT themselves. Or configure it in code:
Every OTLP trace becomes one run. The root span is the run; its children are the steps.

What is read from your spans

SenseLab understands the OpenTelemetry GenAI conventions, OpenInference, and its own amfs.* 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, and amfs_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. Pass response_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.
Put these in the agent’s instructions rather than hoping it discovers them: “open a span for each sub-task with amfs_start_span, record every model call with amfs_record_llm_call, close spans with amfs_end_span, and pass task_input and response_text on amfs_commit_outcome.”
Requires amfs-mcp-server-pro 0.1.53 or later; response_text needs 0.1.54.

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 an llm 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.