* feat: seed Lens dev with configurable load profiles * feat: run Lens UI live through the dev launcher * fix: verify Lens UI startup before seeding * fix(ui): render run timestamps on one compact line The agent runs table printed the long locale form with timezone, which wrapped to two lines per row. Use a fixed-width 24h form with milliseconds that matches the timeline axis, keep the long form in the hover title, and show the timezone once in the column header Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * refactor(ui): use the root query client for the Lens demo Drop the demo's nested QueryClient. Cache keys are already partitioned by scope, and the root client now skips retries on 4xx ApiErrors, which covers the demo's not-in-demo and read-only rejections and live 4xx alike. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * chore: drop unused synthetic_spend reference from query help Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * chore(traces): drop the deeplite fixtures and map every SDK to a logo The deeplite captures predate the example repository and carried synthetic spend rows, which leaked a fixture-only column into the query help SQL and pinned tests to its shape. Replace them with the SDK captures in the ClickHouse round trip and query API tests, and derive the seed tenant lookup from the capture metadata The runs table only knew the two Anthropic framework slugs. Register the slugs the normalizer emits for LangChain, LangGraph, Deep Agents, CrewAI, Google ADK, LlamaIndex, OpenAI Agents, Pydantic AI, Strands, Vercel AI SDK, Codex, Cursor and Copilot, and fall back to the generic agent glyph when a run has no known framework Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * refactor(ui): inject the Lens sample through data sources instead of demo checks Components no longer ask whether they are in the demo. The traces source carries live and handoff, navigation state comes from a URL or memory route, and the preview action comes from context instead of onDemo props Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * feat(ui): infinite scroll for the agent runs list Replace the Load more button with a sentinel that fetches the next cursor page as the list nears its end. Placeholder rows hold the tail while more runs exist, and a failed page stops auto-loading until Retry. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * feat(ui): keep the whole Lens view in the URL Lens navigation now lives entirely in query params through nuqs: the sample session (demo=true, with a Demo data switch in the header), the open run (trace, trace_ref), the selected step, view and detail section (span, view, span_tab) and the list filters and range (q, agent, status, hours). Any Lens view is a shareable link and the back button walks runs RunView takes its selection injected: the drawer feeds it URL state and the investigations evidence sheet keeps a local one, so a finding's original run never writes step ids into the URL. Leaving the sample session clears every Lens key except the tab so sample ids never point at live data Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * style(traces): cargo fmt captures tests Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --------- Co-authored-by: Yujong Lee <yujong@berri.ai> Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com> Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> |
||
|---|---|---|
| .. | ||
| claude_agent_sdk_missing_request_id_simple_spend_logs.jsonl | ||
| claude_agent_sdk_missing_request_id_swarm_spend_logs.jsonl | ||
| claude_agent_sdk_simple_spend_logs.jsonl | ||
| claude_agent_sdk_swarm_spend_logs.jsonl | ||
| crewai_simple_spend_logs.jsonl | ||
| crewai_swarm_spend_logs.jsonl | ||
| deepagents_simple_spend_logs.jsonl | ||
| deepagents_swarm_spend_logs.jsonl | ||
| google_adk_billed_failure_spend_logs.jsonl | ||
| google_adk_retry_spend_logs.jsonl | ||
| google_adk_simple_spend_logs.jsonl | ||
| google_adk_stream_spend_logs.jsonl | ||
| google_adk_swarm_spend_logs.jsonl | ||
| langchain_simple_spend_logs.jsonl | ||
| langchain_swarm_spend_logs.jsonl | ||
| langgraph_simple_spend_logs.jsonl | ||
| langgraph_swarm_spend_logs.jsonl | ||
| llamaindex_simple_spend_logs.jsonl | ||
| llamaindex_swarm_spend_logs.jsonl | ||
| mastra_simple_spend_logs.jsonl | ||
| mastra_swarm_spend_logs.jsonl | ||
| openai_agents_simple_spend_logs.jsonl | ||
| openai_agents_swarm_spend_logs.jsonl | ||
| opentelemetry_simple_spend_logs.jsonl | ||
| opentelemetry_swarm_spend_logs.jsonl | ||
| pydantic_ai_billed_failure_spend_logs.jsonl | ||
| pydantic_ai_retry_spend_logs.jsonl | ||
| pydantic_ai_simple_spend_logs.jsonl | ||
| pydantic_ai_stream_spend_logs.jsonl | ||
| pydantic_ai_swarm_spend_logs.jsonl | ||
| pydantic_ai_swarm_stream_spend_logs.jsonl | ||
| pydantic_ai_token_limit_swarm_spend_logs.jsonl | ||
| README.md | ||
| spend_logs.jsonl | ||
| strands_billed_failure_spend_logs.jsonl | ||
| strands_retry_spend_logs.jsonl | ||
| strands_simple_spend_logs.jsonl | ||
| strands_swarm_spend_logs.jsonl | ||
| vercel_ai_sdk_billed_failure_spend_logs.jsonl | ||
| vercel_ai_sdk_py_simple_spend_logs.jsonl | ||
| vercel_ai_sdk_py_swarm_spend_logs.jsonl | ||
| vercel_ai_sdk_retry_spend_logs.jsonl | ||
| vercel_ai_sdk_simple_spend_logs.jsonl | ||
| vercel_ai_sdk_stream_spend_logs.jsonl | ||
| vercel_ai_sdk_swarm_spend_logs.jsonl | ||
ClickHouse query fixtures
Run cargo test -p litellm-traces-clickhouse --test queries --locked -- --test-threads=2 from litellm-rust with Docker running
Raw OTLP exports live in crates/traces/tests/fixtures/query_*.json. The seeded fixture decodes and normalizes them through litellm_traces::decode_otlp at test startup, then projects the decoded fields into ClickHouse columns. Team and key identities come from fixture setup rather than exporter claims. Root and child exports are inserted separately through the public insert API so materialized views process multiple blocks
The ClickHouse round-trip test replays the google_adk_billed_failure, pydantic_ai_retry, and deepagents_swarm exports and checks span identities, parent links, timestamps, durations, token counts, and statuses without pinning the provider's error wording. Exported ERROR and UNSET statuses are diagnostic and do not establish a failed execution, so the test preserves incoming statuses and checks root status separately from the count of error spans, deriving both from the decoded export. Framework-specific interpretation of control-flow exceptions belongs in the instrumentation integration
For a local dashboard with linked requests and traces, run make lens-dev ARGS=--seed from the repository root and open http://localhost:3000/ui/lens/. Log in as admin with the master key saved in .lens-dev/master_key. The launcher keeps the stack running until Ctrl-C and leaves the database volumes intact
Spend rows are stored here because traces-clickhouse owns the spend row schema
The simple and swarm exports for all twelve SDK examples were captured on 2026-10-03 against port 4002 using openai/gpt-6-luna. Each export has a matching <name>_spend_logs.jsonl with actual proxy spend, usage, request and response IDs, messages, and timestamps. Authorization headers, provider cookies, organization and project identifiers, and local paths were redacted. OTLP identifiers and enums use their canonical JSON encodings. metadata.fixture_capture identifies the associated export and whether model spans contain sufficient identity to join spend
The LlamaIndex captures contain provider IDs inside output.value.raw.id. Regression tests require normalization to retain those call keys and trace cost resolution to count nested model spans once. The Claude captures use the SDK example's local gateway adapter, which supplies the actual Anthropic message ID in the request-id response header. The two claude_agent_sdk_missing_request_id_* exports retain the earlier behavior: real spend rows exist, but model spans contain no matching call IDs, so trace spend remains unknown
scripts/seed_tracing_fixtures.py replays every JSON export in crates/traces/tests/fixtures through POST /v1/traces, then inserts all companion spend rows into ClickHouse through the production storage API and into Postgres through Prisma. The Requests table reads Postgres, while trace costs and Lens read ClickHouse. It shifts each capture into the current time window, keeping span, event, and paired spend timestamps aligned. The split query_*.json exports share a time shift and ID namespace to preserve cross-file parent links. Other captures get separate ID namespaces to avoid collisions between fixtures. It assigns fresh linked IDs for each run, including provider IDs inside managed response IDs, and reads the authenticated tenant from the ingested spans before stamping spend rows. The command exits unsuccessfully if any trace detail API result differs from its captured spend total or expected unknown cost. Exports without companion spend rows retain missing costs and do not create Requests entries
tests/test_litellm_rust/test_traces.py ingests these exports and spend rows into an isolated ClickHouse container, then checks trace detail costs and spend queries through the real FastAPI endpoints. Every SQL example returned by /v1/traces/query/help is executed through /v1/traces/query, including missing costs, free requests, replacement rows, and tenant ownership cases
spend_logs.jsonl contains spend insert rows with millisecond timestamps, including two versions of one request. Replace this small placeholder dataset when the actual data is available. The query fixture applies production migrations, then removes TTL from its isolated database so fixed timestamps do not expire. Background merges are stopped so rollup aggregation and FINAL deduplication are exercised on unmerged data. Retention behavior stays covered by the migration tests
Curated SQL lives in tests/queries/*.sql. Each query has a matching .expected.json containing ordered result rows for admin, team, key, and other_team readers. Update the exports and expected results together. Add a named case in tests/queries.rs for each new query. Assertions compare only result data, excluding server statistics and execution timing
Typed query tests execute the production SQL through litellm_storage_clickhouse::fetch using contracts from litellm-traces. The fixture projection is test setup, so this suite covers the Rust decoder, normalization, inserts, schema, readers, and queries. Python ingress transformations, including payload truncation and exception-event fallback, remain covered by the Python tests
crates/traces/tests/captures.rs resolves every capture against its spend rows without ClickHouse and checks the unrelated-transport and redundant-response-ID invariants