Implements OSS9. New relay-traces crate reads chat/json inferences by the
GIN-indexed tensorzero::api_key_public_id tag, joined with model_inferences
for model, provider, tokens, latency, cost and finish reason.
- GET /relay/traces: caller's own traces, newest first, keyset paging,
window bounded (1-2160 h). Operator keys may use scope=all and key=.
- GET /relay/traces/{inference_id}: model calls plus stored bodies; a trace
owned by another key returns 404, same as a missing one.
- relay-traces-retention: 14 d bodies, 90 d metadata (OD-RY2 defaults, env
overridable), batched deletes against one cutoff, dry-run mode. Shipped in
the relay image; systemd service/timer in crates/relay-traces/deploy (not
installed).
- Relay UI: /observability/keys list (live refresh on the first page) and
detail page; sidebar "Key Traces".
- No new tables or migrations.
Tests: 8 unit tests; live test on a scratch copy of the inference tables
proves key isolation, operator scope, paging and window-exact retention;
UI vitest 7/7, tsc and eslint clean; cargo check -p gateway clean.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
TensorZero UI
The TensorZero UI provides a web interface to help manage your TensorZero deployments. The UI provides functionality for observability, optimization, and more.
Running the UI
The easiest way to run the UI is to use the tensorzero/ui Docker image.
See the Quick Start and the TensorZero UI Deployment Guide for more information.
Development Setup
Follow the instructions from CONTRIBUTING.md to set up your development environment.
Things to note
- To test optimization workflows without real provider APIs, spin up the
mock-provider-apiand setTENSORZERO_INTERNAL_MOCK_PROVIDER_API=http://localhost:3030when running the gateway. - For any new code, prefer
undefinedovernull. The only place to usenullis fornapi-rscompatibility, because it usesnullto represent anOption<T>. Never write a type asT | undefined | null.