Skip to content

feat(tb-lf): real tag listing and --tags filter on traces#29

Merged
trogulja merged 3 commits into
mainfrom
tb-lf-tags-filter
May 5, 2026
Merged

feat(tb-lf): real tag listing and --tags filter on traces#29
trogulja merged 3 commits into
mainfrom
tb-lf-tags-filter

Conversation

@trogulja
Copy link
Copy Markdown
Collaborator

@trogulja trogulja commented May 5, 2026

Summary

  • tb-lf tags 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 optional --prefix filter.
  • Added --tags <a,b,c> to tb-lf traces so traces can be filtered by Langfuse tag values.

Why now

ai-agent #1117 replaces the single discovery_agent Langfuse 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, but tb-lf couldn't surface it — /traces/tags and the tags= filter on /traces both 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 values
  • tb-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 traces

CI checks locally:

  • cargo fmt --check
  • cargo clippy --workspace -- -D warnings
  • cargo test --workspace ✅ (34 passed)

Breaking change

tb-lf tags previously returned distinct trace names. It now returns Langfuse tag values. Anyone scripting against the old behavior should switch to tb-lf names.

Bumped tb-lf to 0.6.0.

Test plan

  • tb-lf tags --from 7d lists tag values
  • tb-lf tags --prefix resource filters to resource:* once ai-agent#1117 deploys
  • tb-lf names --from 7d lists trace names (replacement for old tags)
  • tb-lf traces --tags resource:deal,tool:plan --from 7d filters traces

🤖 Generated with Claude Code

trogulja and others added 2 commits May 5, 2026 21:37
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>
@trogulja trogulja marked this pull request as ready for review May 5, 2026 19:46
`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>
@trogulja trogulja force-pushed the tb-lf-tags-filter branch from 610779a to 6b4bc0d Compare May 5, 2026 19:52
@trogulja trogulja merged commit 787ae8b into main May 5, 2026
1 check passed
@trogulja trogulja deleted the tb-lf-tags-filter branch May 5, 2026 19:54
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.

1 participant