-
Notifications
You must be signed in to change notification settings - Fork 41
docs: add guides for agctl installation and request tracing #492
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
Open
Roniscend
wants to merge
1
commit into
agentgateway:main
Choose a base branch
from
Roniscend:Fix-debugging-tools
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
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,89 @@ | ||
| `agctl` is the CLI tool for controlling and debugging agentgateway. Use it to inspect configuration, trace live requests, and interact with running gateway instances. | ||
|
|
||
| ## Install agctl | ||
|
|
||
| Download the `agctl` binary for your platform from the [agentgateway releases page](https://github.com/agentgateway/agentgateway/releases). | ||
|
|
||
| {{< tabs tabTotal="3" items="Linux,macOS,Windows" >}} | ||
| {{% tab tabName="Linux" %}} | ||
|
|
||
| ```sh | ||
| curl -sL https://github.com/agentgateway/agentgateway/releases/latest/download/agctl-linux-amd64 -o agctl | ||
| chmod +x agctl | ||
| sudo mv agctl /usr/local/bin/agctl | ||
| ``` | ||
|
|
||
| {{% /tab %}} | ||
| {{% tab tabName="macOS" %}} | ||
|
|
||
| ```sh | ||
| # Intel | ||
| curl -sL https://github.com/agentgateway/agentgateway/releases/latest/download/agctl-darwin-amd64 -o agctl | ||
|
|
||
| # Apple Silicon | ||
| curl -sL https://github.com/agentgateway/agentgateway/releases/latest/download/agctl-darwin-arm64 -o agctl | ||
|
|
||
| chmod +x agctl | ||
| sudo mv agctl /usr/local/bin/agctl | ||
| ``` | ||
|
|
||
| {{% /tab %}} | ||
| {{% tab tabName="Windows" %}} | ||
|
|
||
| Download `agctl-windows-amd64.exe` from the [releases page](https://github.com/agentgateway/agentgateway/releases) and add it to your `PATH`. | ||
|
|
||
| {{% /tab %}} | ||
| {{< /tabs >}} | ||
|
|
||
| ## Verify the installation | ||
|
|
||
| ```sh | ||
| agctl --help | ||
| ``` | ||
|
Roniscend marked this conversation as resolved.
|
||
|
|
||
| Example output: | ||
|
|
||
| ``` | ||
| agctl controls and inspects Agentgateway resources | ||
|
|
||
| Usage: | ||
| agctl [command] | ||
|
|
||
| Available Commands: | ||
| config Retrieve Agentgateway configuration for a resource | ||
| trace Trace the next request handled by an Agentgateway pod or local instance | ||
| help Help about any command | ||
|
|
||
| Flags: | ||
| -h, --help help for agctl | ||
| ``` | ||
|
|
||
| ## Upgrade agctl | ||
|
|
||
| To upgrade, download the new binary from the [releases page](https://github.com/agentgateway/agentgateway/releases) and replace the existing binary following the same steps as installation. | ||
|
|
||
| ## Commands | ||
|
|
||
| | Command | Description | | ||
| |---------|-------------| | ||
| | [`agctl config`](#agctl-config) | Retrieve agentgateway configuration for a resource. | | ||
| | [`agctl trace`]({{< link-hextra path="/operations/agctl-trace/" >}}) | Trace the next request handled by an agentgateway pod or local instance. | | ||
|
|
||
| ### agctl config | ||
|
|
||
| Retrieve the current configuration from a running agentgateway instance. | ||
|
|
||
| ```sh | ||
| # All configuration | ||
| agctl config all | ||
|
|
||
| # Backend configuration only | ||
| agctl config backends | ||
| ``` | ||
|
|
||
| | Flag | Default | Description | | ||
| |------|---------|-------------| | ||
| | `-n, --namespace` | | Namespace for resource resolution. | | ||
| | `-f, --file` | | Path to an agentgateway config dump JSON file. | | ||
| | `--proxy-admin-port` | `15000` | Admin port. | | ||
| | `-o, --output` | `short` | Output format: `short`, `json`, or `yaml`. | | ||
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,101 @@ | ||
| Use `agctl trace` to inspect the next request handled by agentgateway in real time. The command connects to the admin API and streams trace events — showing the route matched, policies applied, filters evaluated, and the final response — either in an interactive TUI or as raw JSONL. | ||
|
|
||
| ## Before you begin | ||
|
|
||
| - Install `agctl`. See [Install agctl]({{< link-hextra path="/operations/agctl/" >}}). | ||
| - Have a running agentgateway instance. | ||
|
|
||
| ## Trace a request | ||
|
|
||
| Run `agctl trace` to watch for the next incoming request. The command blocks until a request arrives, then renders the trace in an interactive TUI. | ||
|
|
||
| {{< tabs tabTotal="2" items="Kubernetes,Standalone" >}} | ||
| {{% tab tabName="Kubernetes" %}} | ||
|
|
||
| Watch for the next request on the auto-detected gateway pod: | ||
|
|
||
| ```sh | ||
| agctl trace | ||
| ``` | ||
|
|
||
| Target a specific gateway resource: | ||
|
|
||
| ```sh | ||
| agctl trace gateway/my-gateway | ||
| ``` | ||
|
|
||
| Watch in a specific namespace: | ||
|
|
||
| ```sh | ||
| agctl trace gateway/my-gateway -n my-namespace | ||
| ``` | ||
|
|
||
| {{% /tab %}} | ||
| {{% tab tabName="Standalone" %}} | ||
|
|
||
| Trace against a local agentgateway instance: | ||
|
|
||
| ```sh | ||
| agctl trace --local | ||
| ``` | ||
|
|
||
| If agentgateway is listening on a non-default admin port: | ||
|
|
||
| ```sh | ||
| agctl trace --local --proxy-admin-port 15001 | ||
| ``` | ||
|
|
||
| {{% /tab %}} | ||
| {{< /tabs >}} | ||
|
|
||
| ## Trigger a request as part of the trace | ||
|
|
||
| Pass a URL after `--` to have `agctl` both enable tracing and send the request. Use `--port` to specify the gateway listener port. | ||
|
|
||
| {{< tabs tabTotal="2" items="Kubernetes,Standalone" >}} | ||
| {{% tab tabName="Kubernetes" %}} | ||
|
|
||
| ```sh | ||
| agctl trace gateway/my-gateway --port 80 -- http://host/some/path | ||
| ``` | ||
|
|
||
| With additional curl arguments (for example, a bearer token): | ||
|
|
||
| ```sh | ||
| agctl trace gateway/my-gateway --port 80 -- http://host/some/path -H "Authorization: Bearer sk-123" | ||
| ``` | ||
|
|
||
| {{% /tab %}} | ||
| {{% tab tabName="Standalone" %}} | ||
|
|
||
| ```sh | ||
| agctl trace --local --port 8080 -- http://host/some/path | ||
| ``` | ||
|
|
||
| With additional curl arguments: | ||
|
|
||
| ```sh | ||
| agctl trace --local --port 8080 -- http://host/some/path -H "Authorization: Bearer sk-123" | ||
| ``` | ||
|
|
||
| {{% /tab %}} | ||
| {{< /tabs >}} | ||
|
|
||
| ## Output raw JSONL instead of the TUI | ||
|
|
||
| Use `--raw` to print trace events as newline-delimited JSON (JSONL) instead of opening the interactive TUI. This is useful for scripting or piping to tools like `jq`. | ||
|
|
||
| ```sh | ||
| agctl trace --raw | ||
| agctl trace gateway/my-gateway --raw --port 80 -- http://host/some/path | jq . | ||
| ``` | ||
|
|
||
| ## Reference | ||
|
|
||
| | Flag | Default | Description | | ||
| |------|---------|-------------| | ||
| | `-n, --namespace` | | Namespace to use when resolving resources. | | ||
| | `--proxy-admin-port` | `15000` | Agentgateway admin port. | | ||
| | `--raw` | `false` | Print trace events as JSONL instead of opening the TUI. | | ||
| | `--port` | | Gateway listener port to use when triggering a request. Required when a request URL is provided. | | ||
| | `--local` | `false` | Trace against a local agentgateway instance on `127.0.0.1`. Cannot be combined with a resource argument. | |
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
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
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,7 @@ | ||
| --- | ||
| title: Trace requests | ||
| weight: 30 | ||
| description: Use agctl trace to inspect live requests flowing through your agentgateway deployment. | ||
| --- | ||
|
|
||
| {{< reuse "agw-docs/pages/operations/agctl-trace.md" >}} |
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,7 @@ | ||
| --- | ||
| title: agctl CLI | ||
| weight: 25 | ||
| description: Install and use the agctl CLI to debug and inspect your agentgateway deployment. | ||
| --- | ||
|
|
||
| {{< reuse "agw-docs/pages/operations/agctl-install.md" >}} |
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,7 @@ | ||
| --- | ||
| title: Trace requests | ||
| weight: 30 | ||
| description: Use agctl trace to inspect live requests flowing through your agentgateway deployment. | ||
| --- | ||
|
|
||
| {{< reuse "agw-docs/pages/operations/agctl-trace.md" >}} |
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,7 @@ | ||
| --- | ||
| title: agctl CLI | ||
| weight: 25 | ||
| description: Install and use the agctl CLI to debug and inspect your agentgateway deployment. | ||
| --- | ||
|
|
||
| {{< reuse "agw-docs/pages/operations/agctl-install.md" >}} |
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,7 @@ | ||
| --- | ||
| title: Trace requests | ||
| weight: 25 | ||
| description: Use agctl trace to inspect live requests flowing through your standalone agentgateway. | ||
| --- | ||
|
|
||
| {{< reuse "agw-docs/pages/operations/agctl-trace.md" >}} |
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,7 @@ | ||
| --- | ||
| title: agctl CLI | ||
| weight: 20 | ||
| description: Install and use the agctl CLI to debug and inspect your standalone agentgateway. | ||
| --- | ||
|
|
||
| {{< reuse "agw-docs/pages/operations/agctl-install.md" >}} |
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,7 @@ | ||
| --- | ||
| title: Trace requests | ||
| weight: 25 | ||
| description: Use agctl trace to inspect live requests flowing through your standalone agentgateway. | ||
| --- | ||
|
|
||
| {{< reuse "agw-docs/pages/operations/agctl-trace.md" >}} |
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,7 @@ | ||
| --- | ||
| title: agctl CLI | ||
| weight: 20 | ||
| description: Install and use the agctl CLI to debug and inspect your standalone agentgateway. | ||
| --- | ||
|
|
||
| {{< reuse "agw-docs/pages/operations/agctl-install.md" >}} |
Oops, something went wrong.
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.