-
Couldn't load subscription status.
- Fork 18
CLI docs for spice trace #834
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
Merged
+67
−0
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
193eb4a
CLI docs for spice trace
Jeadie 6abd092
Update trace.md
Jeadie 7db7824
Update website/docs/cli/reference/trace.md
sgrebnov 256fa63
Update website/docs/cli/reference/trace.md
sgrebnov 04a3975
Merge branch 'trunk' into jeadie/25-02-04/trace
peasee 6425685
Update website/docs/cli/reference/trace.md
peasee File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| --- | ||
| title: "trace" | ||
| sidebar_label: "trace" | ||
| pagination_prev: null | ||
| pagination_next: null | ||
| --- | ||
|
|
||
| Provides a user-friendly trace stack into an operation that occurred in Spice. This command retrieves and displays task execution traces from the `runtime.task_history` table. | ||
|
|
||
| ### Usage | ||
|
|
||
| ```shell | ||
| spice trace [task] [flags] | ||
| ``` | ||
|
|
||
| `task` - The name of the task whose trace is requested. Supported tasks include: | ||
|
|
||
| - `ai_chat` | ||
| - `ai_completion` | ||
| - `sql_query` | ||
| - `nsql` | ||
| - `tool_use::document_similarity` | ||
| - `tool_use::list_datasets` | ||
| - `tool_use::sql` | ||
| - `tool_use::table_schema` | ||
| - `tool_use::sample_data` | ||
| - `tool_use::sql_query` | ||
| - `tool_use::memory` | ||
|
|
||
| These tasks are from the `task` column in the Spice SQL `runtime.task_history` table. | ||
|
|
||
| #### Flags | ||
|
|
||
| - `--trace-id` Retrieve the trace with the given trace ID (the column `trace_id` from `runtime.task_history`). | ||
| - `--id` Retrieve the trace with the given `id` label (i.e. the task has a valid `id` within the `labels` column of `runtime.task_history`). | ||
| - `--api-key` Specify the API key for authentication. | ||
|
|
||
| The latest trace for the task will be used if neither `--trace-id` nor `--id` is specified. | ||
|
|
||
| ### Examples | ||
|
|
||
| #### Retrieve the trace for the last text-to-SQL operation | ||
| ```shell | ||
| spice trace nsql | ||
| ``` | ||
|
|
||
| #### Retrieve the trace for a specific task by ID | ||
| ```shell | ||
| spice trace ai_chat --id chatcmpl-At6ZmDE8iAYRPeuQLA0FLlWxGKNnM | ||
| ``` | ||
|
|
||
| #### Retrieve a trace by `trace-id` | ||
| ```shell | ||
| spice trace sql_query --trace-id d5c6f1eed9f27257 | ||
| ``` | ||
|
|
||
| ### Output Example | ||
|
|
||
| ```shell | ||
| [d5c6f1eed9f27257] ( 3077.45ms) ai_chat | ||
| ├── [16eb97d757e4ea47] ( 0.85ms) tool_use::list_datasets | ||
| ├── [ece97973668bd54a] ( 1651.14ms) ai_completion | ||
| ├── [96fe526b54330e95] ( 0.62ms) tool_use::get_readiness | ||
| └── [8aa2bf4c94f42ba2] ( 1420.09ms) ai_completion | ||
| ``` | ||
|
|
||
| This output represents a structured trace of executed tasks. | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.