Skip to main content

Copy this into your coding agent

Paste into Cursor, Codex, Claude Code, or another coding agent in your project.
The Rust SDK is a preview. Use the installation source provided in Bench. The crate is trybench-sdk, imported as trybench_sdk.

Record one interaction

Choose Rust on the SDK setup page. Use Rust 1.88 or later and a Tokio async application.
Open the system’s Production tab to confirm receipt.

Wrap your application

Replace the callback with a Rig or custom application operation. Outputs must implement serde::Serialize. Pass Some(&context) to child traces and use .kind("TOOL") for tools. Context is explicit, so concurrent requests remain separate. For streaming, keep a start_span guard open while reading the stream. Call set_output on success, set_error on failure, then end. Dropping an unfinished guard records an error without capturing the exception message. Content capture defaults to off. Set capture_content = true and provide SpanInput::input(...) when needed. Built-in filters run before sending; use Options.redact to remove extra application fields. See privacy and redaction. Await flush() at request boundaries and shutdown() after active requests finish. Delivery retries once, then counts the events in stats().dropped. Set SpanInput.component_id to a real Bench prompt component for production checks. This crate provides tracing. Automatic framework adapters and native application evaluation helpers are coming soon.

Run in CI

Use Bench with your existing pull-request checks. See Run tests in CI for setup, report handling and the features available in each language.