Skip to content

Fix HF agent traces analysis query to use metadata.* fields - #103

Merged
DaRubberDuckieee merged 1 commit into
mainfrom
fix-cookbook-query
Jun 24, 2026
Merged

Fix HF agent traces analysis query to use metadata.* fields#103
DaRubberDuckieee merged 1 commit into
mainfrom
fix-cookbook-query

Conversation

@DaRubberDuckieee

Copy link
Copy Markdown
Contributor

The "Slicing the results" query in the HuggingFaceAgentTraces cookbook read top-level benchmark/harness/model columns and metrics.tokens, but the importer (import_logs.py METADATA_COLS) writes those under metadata.*, and the scored root session spans carry the session total as metadata.total_tokens (root spans have no metrics.tokens). As written, the query fails on missing fields / returns null token averages.

Fix: use metadata.benchmark, metadata.harness, metadata.models, and metadata.total_tokens in SELECT and GROUP BY. Caught in review on braintrustdata/braintrust#16126.

🤖 Generated with Claude Code

The importer writes benchmark/harness/models/total_tokens under metadata,
and the scored root spans have no metrics.tokens. Query top-level columns
and metrics.tokens both fail/return null; use metadata.benchmark,
metadata.harness, metadata.models, and metadata.total_tokens.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@DaRubberDuckieee
DaRubberDuckieee merged commit 7cc2a8d into main Jun 24, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants