> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rua.hud.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Recording Traces

> Record robot runs onto HUD traces: what DirectControl and CodeControl stream automatically, and TraceRecorder for a custom producer.

rua records each robot run onto a HUD trace as **robot steps**: labelled numeric state per tick, the rows
each request played, and one H.264 video stream per camera. The steps carry the schema tag
`hud.robot.step.v1`, which the HUD trace viewer reads.

Reporting needs a HUD API key. With `HUD_API_KEY` unset (or `HUD_TELEMETRY_ENABLED=false`), every recorder
still runs but reports nothing, so the same code runs offline.

```bash theme={"dark"}
export HUD_API_KEY=your-key-here  # from hud.ai/project/api-keys
```

## What records automatically

| Producer | Records |
| - | - |
| `DirectControl` | Every played tick's state, measured parts and camera frames, and every `move` request with how it ended, onto the rollout's trace, on the sim clock. |
| `CodeControl` | The same, for every tick and request of a cell's `robot.move` and `robot.step`. |

Nothing to set up: run the rollout with a key set.

## Custom producers

For a loop of your own, use the recorder directly.

`TraceRecorder` streams one trace. Build it with a HUD `Run` (steps land on `run.trace`) or a bare `trace_id`
(steps are emitted directly, from any thread), then call `record_observation(data, tick=...)` and
`record_inference(chunk, tick=...)`, and `close()` to flush the video tails. The trace's lifecycle (entering and
exiting it on the platform) stays with you.

See the [Telemetry reference](https://docs.rua.hud.ai/reference/telemetry.md) for every argument and the step schemas.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.