feat(tb-lf): real tag listing and --tags filter on traces#29
Merged
Conversation
The previous `tb-lf tags` command was misnamed — it called `/traces/names` and listed distinct trace names, not Langfuse tags. Renamed it to `tb-lf names` and added a real `tb-lf tags` that hits `/traces/tags` with an optional `--prefix` filter. Also added `--tags <a,b,c>` on `tb-lf traces` to filter traces by Langfuse tag values. With ai-agent#1117 emitting structured tags (`resource:<type>`, `tool:<name>`, `skill:<id>`, `report:<type>`), slicing traces by what the run actually consumed is now useful. Breaking: `tb-lf tags` now returns tag values instead of trace names. Switch to `tb-lf names` for the old behavior. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
`tb-lf human` listed `--name` filter under Investigating Traces but not the new `--tags` filter, `names`, or `tags` commands. Added them so users running the full help discover them. Also added an `explain tags` topic that documents the Langfuse tag schema produced by ai-agent#1117 (`resource:`, `tool:`, `skill:`, `report:`) plus older ad-hoc tags (`Object:`, `Type:`). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
610779a to
6b4bc0d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tb-lf tagswas misnamed — it called/traces/namesand listed distinct trace names, not Langfuse tags. Renamed it totb-lf namesand added a realtb-lf tagsthat hits/traces/tagswith optional--prefixfilter.--tags <a,b,c>totb-lf tracesso traces can be filtered by Langfuse tag values.Why now
ai-agent #1117 replaces the single
discovery_agentLangfuse tag with structured tags derived from the tools each run consumed:resource:<type>,tool:<name>,skill:<id>,report:<type>. Slicing traces by what the run actually used is now useful, buttb-lfcouldn't surface it —/traces/tagsand thetags=filter on/tracesboth already exist in DevPortal, just weren't wired up.Verification
Built and ran live against production DevPortal:
tb-lf tags --from 7d— returns 89 distinct tag valuestb-lf tags --prefix resource— empty (PR #1117 not deployed yet, expected)tb-lf names --from 1d— returns trace names (agent-generation,litellm-acompletion, …)tb-lf traces --tags 'Object: Deal' --from 1d— returns 1737 matching tracesCI checks locally:
cargo fmt --check✅cargo clippy --workspace -- -D warnings✅cargo test --workspace✅ (34 passed)Breaking change
tb-lf tagspreviously returned distinct trace names. It now returns Langfuse tag values. Anyone scripting against the old behavior should switch totb-lf names.Bumped
tb-lfto0.6.0.Test plan
tb-lf tags --from 7dlists tag valuestb-lf tags --prefix resourcefilters toresource:*once ai-agent#1117 deploystb-lf names --from 7dlists trace names (replacement for oldtags)tb-lf traces --tags resource:deal,tool:plan --from 7dfilters traces🤖 Generated with Claude Code