-
Notifications
You must be signed in to change notification settings - Fork 5
feat(traces): add list_traces and get_trace endpoints #47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Expose trace listing with full filter/pagination support and single-trace fetch via the public API, with corresponding Client delegation, tests, and API reference docs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Adds trace read APIs to the Langfuse Ruby SDK so users can query traces back from the Langfuse public API for debugging/monitoring/tooling use cases.
Changes:
- Add
Client#list_tracesandClient#get_tracemethods delegating to the API client. - Add
ApiClient#list_traces,#list_traces_paginated, and#get_traceplus query-param building for trace filters. - Add specs for the new client and API client methods and update API reference docs.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| spec/langfuse/client_spec.rb | Adds client-level tests for list_traces and get_trace. |
| spec/langfuse/api_client_spec.rb | Adds API client tests covering params, filters, errors, and pagination response shape. |
| lib/langfuse/client.rb | Exposes list_traces / get_trace on the public SDK client. |
| lib/langfuse/api_client.rb | Implements HTTP calls + query param mapping for trace listing and fetching. |
| docs/API_REFERENCE.md | Documents the new Client#list_traces and Client#get_trace APIs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| | Parameter | Type | Required | Description | | ||
| | --------- | ------ | -------- | ----------- | | ||
| | `id` | String | Yes | Trace ID | | ||
|
|
Copilot
AI
Feb 9, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Client#get_trace parameters table also uses || instead of standard Markdown | separators, so it likely won't render as a table. Please convert these rows to proper single-pipe table syntax.
| | Parameter | Type | Required | Description | | ||
| | ---------------- | ------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------- | | ||
| | `page` | Integer | No | Page number | | ||
| | `limit` | Integer | No | Results per page | | ||
| | `user_id` | String | No | Filter by user ID | | ||
| | `name` | String | No | Filter by trace name | | ||
| | `session_id` | String | No | Filter by session ID | |
Copilot
AI
Feb 9, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The parameters table markup uses double leading pipes (|| ...) which breaks GitHub-flavored Markdown table rendering. Update the header and rows to use single pipes (| ... |) consistently so the table renders correctly.
Greptile OverviewGreptile SummaryAdds trace read support to the Ruby SDK by introducing Confidence Score: 5/5
|
| Filename | Overview |
|---|---|
| docs/API_REFERENCE.md | Documents new list_traces and get_trace SDK methods and their parameters/usage. |
| lib/langfuse/api_client.rb | Adds list_traces/get_trace API client methods plus parameter mapping for trace list queries. |
| lib/langfuse/client.rb | Exposes list_traces and get_trace on the high-level client by delegating to ApiClient. |
| spec/langfuse/api_client_spec.rb | Adds request/response specs for trace listing and retrieval, including query parameter mapping. |
| spec/langfuse/client_spec.rb | Adds high-level client specs ensuring list_traces/get_trace delegate correctly to ApiClient. |
Sequence Diagram
sequenceDiagram
autonumber
participant U as User Code
participant C as Langfuse::Client
participant A as Langfuse::ApiClient
participant F as Langfuse Public API
U->>C: list_traces(params)
C->>A: get("/api/public/traces", query: params)
A->>F: HTTP GET /api/public/traces?...
F-->>A: 200 JSON (trace list)
A-->>C: parsed response
C-->>U: traces
U->>C: get_trace(trace_id)
C->>A: get("/api/public/traces/{trace_id}")
A->>F: HTTP GET /api/public/traces/{trace_id}
F-->>A: 200 JSON (trace)
A-->>C: parsed response
C-->>U: trace
TL;DRAdd
list_tracesandget_tracemethods to the SDK for querying traces via the Langfuse public API.WhyThe SDK had no way to read traces back from Langfuse. These endpoints enable fetching trace data for debugging, monitoring, and building tooling on top of the SDK.
ChecklistCloses #