Replies: 2 comments
|
The traces view is excluded from the unstable API and widget builder in Langfuse v4 due to performance concerns. In Langfuse v4's data model, the traces view must aggregate multiple rows per trace to reconstruct trace-level fields, which is expensive for large projects.(1) Why the Traces View Is ExcludedIn Langfuse v4, all data lives in a single denormalized ClickHouse table—the wide observations table. The legacy traces view still exists for backward compatibility but is expensive to query at scale. It is no longer possible to create new custom widgets relying on this view, and existing widgets should be migrated away from it.(1) How to Get Trace-Level Latency Using ObservationsTrace counts and trace-level metrics are now derived from observations. Specifically:
To create a trace-level latency widget using the observations view, you would group by Practical ApproachIf you need latency percentiles (p50, p90, p95, p99), you can create widgets using the observations view with appropriate dimensions like There is also an open issue regarding trace latency percentile queries timing out on large observations tables, which the team is addressing more fundamentally in the new data model.(2) 📚 Sources:
Have another question? Just tag @inkeep. |
|
No, trace-level widgets aren't ruled out. The restriction sits only on what the create and update endpoints accept, right now that's the observations and score views. Widgets you build in the UI with the trace view still come back fine when you read them via the API. In the meantime you can get trace latency from the observations view. A trace's latency is just its root span's latency, so build a latency widget on observations and filter it down to root spans only. Those are the observations with no parent observation. Group by trace name if you want a breakdown per trace type. |
Uh oh!
There was an error while loading. Please reload this page.
Describe your question
I want to use the latest unstable/dashboard-widgets api to create a trace-level view widget to get latency stats. However, the documentation mentions:
The legacy traces view is not supported by this unstable API.I am able to do this from the UI.Does this mean that the trace level view will never be supported? How can I create a widget for trace level latency using the observation view via SDK?
Langfuse Cloud or Self-Hosted?
Self-Hosted
If Self-Hosted
v3.224.2
If Langfuse Cloud
No response
SDK and integration versions
SDK v.4.14.1
Pre-Submission Checklist
All reactions