aggregate_by_group
Aggregate trace metrics by user group to compare performance, usage, and costs across segments. Returns counts, accuracy, latency, and cost per group, sorted by volume.
Instructions
Aggregate trace metrics by user group.
Returns per-group: trace count, unique sessions, unique users, accuracy rate, average latency, total cost. Sorted by trace count.
group_by options:
'name': trace/agent name (default — works for everyone)
'userId': per-user breakdown
'domain': extracts domain from email-based user IDs (e.g. user@acme.com → acme.com)
'tag': groups by trace tags
Set exclude_internal=true and LANGFUSE_INTERNAL_DOMAINS env var to filter out internal team users (only relevant with group_by='domain').
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tags | No | ||
| top_n | No | ||
| project | No | ||
| end_date | No | ||
| group_by | No | name | |
| start_date | No | ||
| time_range | No | ||
| exclude_internal | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||