Skip to content

feat(tb-lf): add trace-metrics command, rename metrics to daily-metrics#18

Merged
trogulja merged 2 commits intomainfrom
feat/tb-lf-trace-metrics
Apr 16, 2026
Merged

feat(tb-lf): add trace-metrics command, rename metrics to daily-metrics#18
trogulja merged 2 commits intomainfrom
feat/tb-lf-trace-metrics

Conversation

@trogulja
Copy link
Copy Markdown
Collaborator

Summary

  • Rename metricsdaily-metrics (backward-compatible metrics alias preserved)
  • New trace-metrics command consuming the DevPortal /trace_metrics API:
    • Aggregated view with --group-by day|outcome|agent_type|flag:<name>
    • Per-trace detail: tb-lf trace-metrics <trace_id> — shows metrics, tool breakdown, flags, triage
  • Deserialization types + 3 unit tests for response parsing

Usage

# Aggregated (default: group by day, last 7 days)
tb-lf trace-metrics --from 7d

# Group by outcome
tb-lf trace-metrics --group-by outcome --from 14d

# A/B test a feature flag
tb-lf trace-metrics --group-by flag:coreAgents --from 7d

# Per-trace detail
tb-lf trace-metrics abc123def456

Related

  • productiveio/devportal#250 — fix: date filtering uses trace timestamp (merged)
  • productiveio/devportal#251 — fix: sync token counts + agent_type from Langfuse v2 API (pending)

Test plan

  • cargo clippy — clean
  • cargo fmt — clean
  • cargo test — 3 new deserialization tests pass
  • Manually tested all commands against production data

🤖 Generated with Claude Code

trogulja and others added 2 commits April 16, 2026 23:22
- Rename `metrics` → `daily-metrics` (hidden `metrics` alias for backward compat)
- New `trace-metrics` command for trace-level scoring aggregates:
  - `tb-lf trace-metrics --from 7d` — daily aggregate view
  - `tb-lf trace-metrics --group-by outcome|agent_type|flag:<name>`
  - `tb-lf trace-metrics <trace_id>` — per-trace detail with metrics,
    flags, tool breakdown, and triage info
- Add deserialization types + tests for trace metrics API responses

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@trogulja trogulja marked this pull request as ready for review April 16, 2026 21:26
@trogulja trogulja merged commit 3ae87c9 into main Apr 16, 2026
1 check passed
@trogulja trogulja deleted the feat/tb-lf-trace-metrics branch April 16, 2026 21:36
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