- Notifications
You must be signed in to change notification settings - Fork928
chore(docs): document agent api debug endpoints#14454
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes fromall commits
Commits
Show all changes
7 commits Select commitHold shift + click to select a range
582f3bf
chore(docs): add agent api debug docs
DanielleMaywood4f9c0f9
chore(docs): add sections to agent api readme
DanielleMaywoodd8814a5
chore(docs): link debug manifest to agentsdk.Manifest schema
DanielleMaywood0264388
chore(docs): add high level overview of agent api debug docs
DanielleMaywooda0d0a95
chore(docs): link to agent api docs from reference
DanielleMaywood6ff88ef
chore(docs): fix invalid paths
DanielleMaywoodbc59d17
chore(docs): use env variable for coder agent debug address
DanielleMaywoodFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
2 changes: 1 addition & 1 deletionagent/agent.go
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
16 changes: 16 additions & 0 deletionsdocs/manifest.json
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
1 change: 1 addition & 0 deletionsdocs/reference/README.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 |
---|---|---|
@@ -4,3 +4,4 @@ Autogenerated documentation around Coder. | ||
- [REST API](./api) | ||
- [Command Line](./cli) | ||
- [Agent API](./agent-api) |
5 changes: 5 additions & 0 deletionsdocs/reference/agent-api/README.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,5 @@ | ||
## Sections | ||
<children> | ||
This page is rendered on https://coder.com/docs/reference/agent-api. Refer to the other documents in the `agent-api/` directory. | ||
</children> |
76 changes: 76 additions & 0 deletionsdocs/reference/agent-api/debug.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,76 @@ | ||
# Debug | ||
## Get debug logs | ||
### Code samples | ||
```shell | ||
curl $CODER_AGENT_DEBUG_ADDRESS/debug/logs | ||
``` | ||
`GET /debug/logs` | ||
Get the first 10MiB of data from `$CODER_AGENT_LOG_DIR/coder-agent.log`. | ||
### Responses | ||
| Status | Meaning | Description | Schema | | ||
| ------ | ------------------------------------------------------- | ----------- | ------ | | ||
| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | | | ||
## Get debug info for magicsock | ||
### Code samples | ||
```shell | ||
curl $CODER_AGENT_DEBUG_ADDRESS/debug/magicsock | ||
``` | ||
`GET /debug/magicsock` | ||
See | ||
[Tailscale's documentation](https://pkg.go.dev/tailscale.com/wgengine/magicsock#Conn.ServeHTTPDebug). | ||
## Toggle debug logging for magicsock | ||
### Code samples | ||
```shell | ||
curl $CODER_AGENT_DEBUG_ADDRESS/debug/magicsock/debug-logging/true | ||
``` | ||
`GET /debug/magicsock/debug-logging/{state}` | ||
Set whether debug logging is enabled. See | ||
[Tailscale's documentation](https://pkg.go.dev/tailscale.com/wgengine/magicsock#Conn.SetDebugLoggingEnabled) | ||
for more information. | ||
### Parameters | ||
| Name | In | Type | Required | Description | | ||
| ------- | ---- | ------- | -------- | ------------------- | | ||
| `state` | path | boolean | true | Debug logging state | | ||
### Responses | ||
| Status | Meaning | Description | Schema | | ||
| ------ | ------------------------------------------------------- | ----------- | ------ | | ||
| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | | | ||
## Get debug manifest | ||
### Code samples | ||
```shell | ||
curl $CODER_AGENT_DEBUG_ADDRESS/debug/manifest | ||
``` | ||
`GET /debug/manifest` | ||
Get the manifest the agent fetched from `coderd` upon startup. | ||
### Responses | ||
| Status | Meaning | Description | Schema | | ||
| ------ | ------------------------------------------------------- | ----------- | -------------------------------------------------- | | ||
| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [agentsdk.Manifest](./schemas.md#agentsdkmanifest) | |
124 changes: 124 additions & 0 deletionsdocs/reference/agent-api/schemas.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,124 @@ | ||
# Schemas | ||
## agentsdk.Manifest | ||
```json | ||
{ | ||
"agent_id": "151321db-0713-473c-ab42-2cc6ddeab1a4", | ||
"agent_name": "string", | ||
"owner_name": "string", | ||
"workspace_id": "8ef13a0d-a5c9-4fb4-abf2-f8f65c3830fb", | ||
"workspace_name": "string", | ||
"git_auth_configs": 1, | ||
"vscode_port_proxy_uri": "string", | ||
"apps": [ | ||
{ | ||
"id": "c488c933-688a-444e-a55d-f1e88ecc78f5", | ||
"url": "string", | ||
"external": false, | ||
"slug": "string", | ||
"display_name": "string", | ||
"icon": "string", | ||
"subdomain": false, | ||
"sharing_level": "owner", | ||
"healthcheck": { | ||
"url": "string", | ||
"interval": 5, | ||
"threshold": 6 | ||
}, | ||
"health": "initializing" | ||
} | ||
], | ||
"derpmap": { | ||
"HomeParams": {}, | ||
"Regions": { | ||
"1000": { | ||
"EmbeddedRelay": false, | ||
"RegionID": 1000, | ||
"RegionCode": "string", | ||
"RegionName": "string", | ||
"Nodes": [ | ||
{ | ||
"Name": "string", | ||
"RegionID": 1000, | ||
"HostName": "string", | ||
"STUNPort": 19302, | ||
"STUNOnly": true | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
"derp_force_websockets": false, | ||
"environment_variables": { | ||
"OIDC_TOKEN": "string" | ||
}, | ||
"directory": "string", | ||
"motd_file": "string", | ||
"disable_direct_connections": false, | ||
"metadata": [ | ||
{ | ||
"display_name": "string", | ||
"key": "string", | ||
"script": "string", | ||
"interval": 10, | ||
"timeout": 1 | ||
} | ||
], | ||
"scripts": [ | ||
{ | ||
"log_source_id": "3e79c8da-08ae-48f4-b73e-11e194cdea06", | ||
"log_path": "string", | ||
"script": "string", | ||
"cron": "string", | ||
"run_on_start": true, | ||
"run_on_stop": false, | ||
"start_blocks_login": true, | ||
"timeout": 0 | ||
} | ||
] | ||
} | ||
``` | ||
### Properties | ||
| Name | Type | Required | Restrictions | Description | | ||
| ---------------------------- | ------------------------------------------------------------------------------------------------- | -------- | ------------ | ----------- | | ||
| `agent_id` | string | true | | | | ||
| `agent_name` | string | true | | | | ||
| `owner_name` | string | true | | | | ||
| `workspace_id` | string | true | | | | ||
| `workspace_name` | string | true | | | | ||
| `git_auth_configs` | int | true | | | | ||
| `vscode_port_proxy_uri` | string | true | | | | ||
| `apps` | array of [codersdk.WorkspaceApp](../api/schemas.md#codersdkworkspaceapp) | true | | | | ||
| `derpmap` | [tailcfg.DERPMap](../api/schemas.md#tailcfgderpmap) | true | | | | ||
| `derp_force_websockets` | boolean | true | | | | ||
| `environment_variables` | object | true | | | | ||
| `directory` | string | true | | | | ||
| `motd_file` | string | true | | | | ||
| `disable_direct_connections` | boolean | true | | | | ||
| `metadata` | array of [codersdk.WorkspaceAgentMetadataDescription](#codersdkworkspaceagentmetadatadescription) | true | | | | ||
| `scripts` | array of [codersdk.WorkspaceAgentScript](../api/schemas.md#codersdkworkspaceagentscript) | true | | | | ||
## codersdk.WorkspaceAgentMetadataDescription | ||
```json | ||
{ | ||
"display_name": "string", | ||
"key": "string", | ||
"script": "string", | ||
"interval": 10, | ||
"timeout": 1 | ||
} | ||
``` | ||
### Properties | ||
| Name | Type | Required | Restrictions | Description | | ||
| -------------- | ------- | -------- | ------------ | ----------- | | ||
| `display_name` | string | true | | | | ||
| `key` | string | true | | | | ||
| `script` | string | true | | | | ||
| `interval` | integer | true | | | | ||
| `timeout` | integer | true | | | |
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
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.