Skip to content
Open
43 changes: 43 additions & 0 deletions plugins/sentry-cli/skills/sentry-cli/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -627,6 +627,33 @@ sentry log view my-org/backend 968c763c740cfda8b6728f27fb9e9b01
sentry log list --json | jq '.[] | select(.level == "error")'
```

### Span

View spans in distributed traces

#### `sentry span list <args...>`

List spans in a trace

**Flags:**
- `-n, --limit <value> - Number of spans (1-1000) - (default: "25")`
- `-q, --query <value> - Filter spans (e.g., "op:db", "duration:>100ms", "project:backend")`
- `-s, --sort <value> - Sort by: time (default), duration - (default: "time")`
- `-f, --fresh - Bypass cache, re-detect projects, and fetch fresh data`
- `--json - Output as JSON`
- `--fields <value> - Comma-separated fields to include in JSON output (dot.notation supported)`

#### `sentry span view <args...>`

View details of specific spans

**Flags:**
- `-t, --trace <value> - Trace ID containing the span(s) (required)`
- `--spans <value> - Span tree depth limit (number, "all" for unlimited, "no" to disable) - (default: "3")`
- `-f, --fresh - Bypass cache, re-detect projects, and fetch fresh data`
- `--json - Output as JSON`
- `--fields <value> - Comma-separated fields to include in JSON output (dot.notation supported)`

### Trace

View distributed traces
Expand Down Expand Up @@ -798,6 +825,22 @@ List logs from a project
- `--json - Output as JSON`
- `--fields <value> - Comma-separated fields to include in JSON output (dot.notation supported)`

### Spans

List spans in a trace

#### `sentry spans <args...>`

List spans in a trace

**Flags:**
- `-n, --limit <value> - Number of spans (1-1000) - (default: "25")`
- `-q, --query <value> - Filter spans (e.g., "op:db", "duration:>100ms", "project:backend")`
- `-s, --sort <value> - Sort by: time (default), duration - (default: "time")`
- `-f, --fresh - Bypass cache, re-detect projects, and fetch fresh data`
- `--json - Output as JSON`
- `--fields <value> - Comma-separated fields to include in JSON output (dot.notation supported)`

### Traces

List recent traces in a project
Expand Down
5 changes: 5 additions & 0 deletions src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ import { projectRoute } from "./commands/project/index.js";
import { listCommand as projectListCommand } from "./commands/project/list.js";
import { repoRoute } from "./commands/repo/index.js";
import { listCommand as repoListCommand } from "./commands/repo/list.js";
import { spanRoute } from "./commands/span/index.js";
import { listCommand as spanListCommand } from "./commands/span/list.js";
import { teamRoute } from "./commands/team/index.js";
import { listCommand as teamListCommand } from "./commands/team/list.js";
import { traceRoute } from "./commands/trace/index.js";
Expand All @@ -50,6 +52,7 @@ const PLURAL_TO_SINGULAR: Record<string, string> = {
repos: "repo",
teams: "team",
logs: "log",
spans: "span",
traces: "trace",
trials: "trial",
};
Expand All @@ -67,6 +70,7 @@ export const routes = buildRouteMap({
issue: issueRoute,
event: eventRoute,
log: logRoute,
span: spanRoute,
trace: traceRoute,
trial: trialRoute,
init: initCommand,
Expand All @@ -77,6 +81,7 @@ export const routes = buildRouteMap({
repos: repoListCommand,
teams: teamListCommand,
logs: logListCommand,
spans: spanListCommand,
traces: traceListCommand,
trials: trialListCommand,
whoami: whoamiCommand,
Expand Down
24 changes: 24 additions & 0 deletions src/commands/span/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/**
* sentry span
*
* View and explore individual spans within distributed traces.
*/

import { buildRouteMap } from "@stricli/core";
import { listCommand } from "./list.js";
import { viewCommand } from "./view.js";

export const spanRoute = buildRouteMap({
routes: {
list: listCommand,
view: viewCommand,
},
docs: {
brief: "View spans in distributed traces",
fullDescription:
"View and explore individual spans within distributed traces.\n\n" +
"Commands:\n" +
" list List spans in a trace\n" +
" view View details of specific spans",
},
});
Loading
Loading