diff --git a/src/frontend/config/sidebar/reference.topics.ts b/src/frontend/config/sidebar/reference.topics.ts index dc7c9a3e8..c49724654 100644 --- a/src/frontend/config/sidebar/reference.topics.ts +++ b/src/frontend/config/sidebar/reference.topics.ts @@ -349,6 +349,28 @@ export const referenceTopics: StarlightSidebarTopicsUserConfig = { ], }, { label: 'aspire new', slug: 'reference/cli/commands/aspire-new' }, + { + label: 'aspire otel', + collapsed: true, + items: [ + { + label: 'aspire otel', + slug: 'reference/cli/commands/aspire-otel', + }, + { + label: 'aspire otel logs', + slug: 'reference/cli/commands/aspire-otel-logs', + }, + { + label: 'aspire otel spans', + slug: 'reference/cli/commands/aspire-otel-spans', + }, + { + label: 'aspire otel traces', + slug: 'reference/cli/commands/aspire-otel-traces', + }, + ], + }, { label: 'aspire ps', slug: 'reference/cli/commands/aspire-ps' }, { label: 'aspire publish', diff --git a/src/frontend/src/content/docs/reference/cli/commands/aspire-otel-logs.mdx b/src/frontend/src/content/docs/reference/cli/commands/aspire-otel-logs.mdx new file mode 100644 index 000000000..6bc8cde97 --- /dev/null +++ b/src/frontend/src/content/docs/reference/cli/commands/aspire-otel-logs.mdx @@ -0,0 +1,98 @@ +--- +title: aspire otel logs command +description: Learn about the aspire otel logs command and its usage. This command views structured logs from the Dashboard telemetry API. +--- + +import Include from '@components/Include.astro'; + +## Name + +`aspire otel logs` - View structured logs from the Dashboard telemetry API. + +## Synopsis + +```bash title="Aspire CLI" +aspire otel logs [resource] [options] +``` + +## Description + +The `aspire otel logs` command retrieves and displays structured logs collected by the Aspire Dashboard. You can filter logs by resource name, trace ID, or severity level. Use `--follow` to stream logs in real-time as they arrive. + +## Arguments + +- **`[resource]`** + + Filter by resource name. When specified, only logs from the matching resource are shown. Supports both exact instance names and base resource names (which match all replicas). + +## Options + +The following options are available: + +- **`--apphost`** + + The path to the Aspire AppHost project file. + +- **`-f, --follow`** + + Stream telemetry in real-time as it arrives. + +- **`--format `** + + Output format (Table or Json). + +- **`-n, --limit `** + + Maximum number of items to return. + +- **`--trace-id `** + + Filter by trace ID. + +- **`--severity `** + + Filter logs by minimum severity (Trace, Debug, Information, Warning, Error, Critical). + +- + +- + +- + +## Examples + +- View all structured logs: + + ```bash title="Aspire CLI" + aspire otel logs + ``` + +- View logs for a specific resource: + + ```bash title="Aspire CLI" + aspire otel logs apiservice + ``` + +- Stream logs in real-time: + + ```bash title="Aspire CLI" + aspire otel logs --follow + ``` + +- View only error-level logs in JSON format: + + ```bash title="Aspire CLI" + aspire otel logs --severity Error --format Json + ``` + +- View the last 50 logs for a resource: + + ```bash title="Aspire CLI" + aspire otel logs apiservice --limit 50 + ``` + +## See also + +- [aspire otel command](../aspire-otel/) +- [aspire otel spans command](../aspire-otel-spans/) +- [aspire otel traces command](../aspire-otel-traces/) diff --git a/src/frontend/src/content/docs/reference/cli/commands/aspire-otel-spans.mdx b/src/frontend/src/content/docs/reference/cli/commands/aspire-otel-spans.mdx new file mode 100644 index 000000000..ddf2487c6 --- /dev/null +++ b/src/frontend/src/content/docs/reference/cli/commands/aspire-otel-spans.mdx @@ -0,0 +1,98 @@ +--- +title: aspire otel spans command +description: Learn about the aspire otel spans command and its usage. This command views spans from the Dashboard telemetry API. +--- + +import Include from '@components/Include.astro'; + +## Name + +`aspire otel spans` - View spans from the Dashboard telemetry API. + +## Synopsis + +```bash title="Aspire CLI" +aspire otel spans [resource] [options] +``` + +## Description + +The `aspire otel spans` command retrieves and displays distributed trace spans collected by the Aspire Dashboard. Spans represent individual units of work within a distributed trace, such as HTTP requests or database calls. You can filter spans by resource name, trace ID, or error status. Use `--follow` to stream spans in real-time as they arrive. + +## Arguments + +- **`[resource]`** + + Filter by resource name. When specified, only spans from the matching resource are shown. Supports both exact instance names and base resource names (which match all replicas). + +## Options + +The following options are available: + +- **`--apphost`** + + The path to the Aspire AppHost project file. + +- **`-f, --follow`** + + Stream telemetry in real-time as it arrives. + +- **`--format `** + + Output format (Table or Json). + +- **`-n, --limit `** + + Maximum number of items to return. + +- **`--trace-id `** + + Filter by trace ID. + +- **`--has-error `** + + Filter by error status (true to show only errors, false to exclude errors). + +- + +- + +- + +## Examples + +- View all spans: + + ```bash title="Aspire CLI" + aspire otel spans + ``` + +- View spans for a specific resource: + + ```bash title="Aspire CLI" + aspire otel spans apiservice + ``` + +- Stream spans in real-time: + + ```bash title="Aspire CLI" + aspire otel spans --follow + ``` + +- View only error spans: + + ```bash title="Aspire CLI" + aspire otel spans --has-error true + ``` + +- View spans for a specific trace in JSON format: + + ```bash title="Aspire CLI" + aspire otel spans --trace-id abc123 --format Json + ``` + +## See also + +- [aspire otel command](../aspire-otel/) +- [aspire otel logs command](../aspire-otel-logs/) +- [aspire otel traces command](../aspire-otel-traces/) diff --git a/src/frontend/src/content/docs/reference/cli/commands/aspire-otel-traces.mdx b/src/frontend/src/content/docs/reference/cli/commands/aspire-otel-traces.mdx new file mode 100644 index 000000000..8c0f53755 --- /dev/null +++ b/src/frontend/src/content/docs/reference/cli/commands/aspire-otel-traces.mdx @@ -0,0 +1,96 @@ +--- +title: aspire otel traces command +description: Learn about the aspire otel traces command and its usage. This command views traces from the Dashboard telemetry API. +--- + +import Include from '@components/Include.astro'; + +## Name + +`aspire otel traces` - View traces from the Dashboard telemetry API. + +## Synopsis + +```bash title="Aspire CLI" +aspire otel traces [resource] [options] +``` + +## Description + +The `aspire otel traces` command retrieves and displays distributed traces collected by the Aspire Dashboard. A trace represents a complete request as it flows through your distributed application. The command shows trace summaries including timestamp, name, span count, duration, and status. + +You can view a summary of all traces, or provide a specific trace ID with `--trace-id` to view a detailed span tree for that trace. + +## Arguments + +- **`[resource]`** + + Filter by resource name. When specified, only traces involving the matching resource are shown. Supports both exact instance names and base resource names (which match all replicas). + +## Options + +The following options are available: + +- **`--apphost`** + + The path to the Aspire AppHost project file. + +- **`--format `** + + Output format (Table or Json). + +- **`-n, --limit `** + + Maximum number of items to return. + +- **`-t, --trace-id `** + + Filter by trace ID. When specified, displays a detailed span tree for the given trace instead of a summary list. + +- **`--has-error `** + + Filter by error status (true to show only errors, false to exclude errors). + +- + +- + +- + +## Examples + +- View all traces: + + ```bash title="Aspire CLI" + aspire otel traces + ``` + +- View traces for a specific resource: + + ```bash title="Aspire CLI" + aspire otel traces apiservice + ``` + +- View a specific trace detail: + + ```bash title="Aspire CLI" + aspire otel traces --trace-id abc123 + ``` + +- View only traces with errors: + + ```bash title="Aspire CLI" + aspire otel traces --has-error true + ``` + +- View the last 20 traces in JSON format: + + ```bash title="Aspire CLI" + aspire otel traces --limit 20 --format Json + ``` + +## See also + +- [aspire otel command](../aspire-otel/) +- [aspire otel logs command](../aspire-otel-logs/) +- [aspire otel spans command](../aspire-otel-spans/) diff --git a/src/frontend/src/content/docs/reference/cli/commands/aspire-otel.mdx b/src/frontend/src/content/docs/reference/cli/commands/aspire-otel.mdx new file mode 100644 index 000000000..b6877a6a8 --- /dev/null +++ b/src/frontend/src/content/docs/reference/cli/commands/aspire-otel.mdx @@ -0,0 +1,48 @@ +--- +title: aspire otel command +description: Learn about the aspire otel command and its usage. This command is used to view OpenTelemetry data (logs, spans, traces) from a running apphost. +--- + +import Include from '@components/Include.astro'; + +## Name + +`aspire otel` - View OpenTelemetry data (logs, spans, traces) from a running apphost. + +## Synopsis + +```bash title="Aspire CLI" +aspire otel [command] [options] +``` + +## Description + +The `aspire otel` command provides subcommands for viewing OpenTelemetry data collected by the Aspire Dashboard from a running AppHost. You can view structured logs, distributed trace spans, and trace summaries directly from the terminal. + +The data is retrieved from the Dashboard's telemetry API, so an AppHost must be running with the Dashboard enabled. + +## Options + +The following options are available: + +- + +- + +- + +## Commands + +The following commands are available: + +| Command | Function | +| ------------------------------------------------ | ------------------------------------------------------- | +| [`aspire otel logs`](../aspire-otel-logs/) | View structured logs from the Dashboard telemetry API. | +| [`aspire otel spans`](../aspire-otel-spans/) | View spans from the Dashboard telemetry API. | +| [`aspire otel traces`](../aspire-otel-traces/) | View traces from the Dashboard telemetry API. | + +## See also + +- [aspire otel logs command](../aspire-otel-logs/) +- [aspire otel spans command](../aspire-otel-spans/) +- [aspire otel traces command](../aspire-otel-traces/) diff --git a/src/frontend/src/content/docs/reference/cli/commands/aspire.mdx b/src/frontend/src/content/docs/reference/cli/commands/aspire.mdx index cf6e84ded..27f1b61f2 100644 --- a/src/frontend/src/content/docs/reference/cli/commands/aspire.mdx +++ b/src/frontend/src/content/docs/reference/cli/commands/aspire.mdx @@ -52,6 +52,7 @@ The following commands are available: | [`aspire init`](../aspire-init/) | Stable | Initialize Aspire support in an existing solution or create a single-file AppHost. | | [`aspire agent`](../aspire-agent/) | Stable | Manage AI agent integrations. | | [`aspire new`](../aspire-new/) | Stable | Create an Aspire sample project from a template. | +| [`aspire otel`](../aspire-otel/) | Stable | View OpenTelemetry data (logs, spans, traces) from a running apphost. | | [`aspire ps`](../aspire-ps/) | Stable | List running Aspire AppHost processes. | | [`aspire publish`](../aspire-publish/) | Preview | Generates deployment artifacts for an Aspire apphost project. | | [`aspire run`](../aspire-run/) | Stable | Run an Aspire apphost for local development. |