chore: Proxy health status checks + endpoint (#7233)

* chore: Implement workspace proxy health check cron

At a given interval will check the reachability of workspace proxies.

* Proxyhealth is an enterprise feature
* Start proxyhealth go routine on enterprise coder
This commit is contained in:
Steven Masley
2023-04-24 10:25:35 -05:00
committed by GitHub
parent 63e68c11d1
commit 3129741e08
13 changed files with 912 additions and 60 deletions

62
coderd/apidoc/docs.go generated
View File

@ -8208,6 +8208,40 @@ const docTemplate = `{
"ProvisionerStorageMethodFile"
]
},
"codersdk.ProxyHealthReport": {
"type": "object",
"properties": {
"errors": {
"description": "Errors are problems that prevent the workspace proxy from being healthy",
"type": "array",
"items": {
"type": "string"
}
},
"warnings": {
"description": "Warnings do not prevent the workspace proxy from being healthy, but\nshould be addressed.",
"type": "array",
"items": {
"type": "string"
}
}
}
},
"codersdk.ProxyHealthStatus": {
"type": "string",
"enum": [
"reachable",
"unreachable",
"unhealthy",
"unregistered"
],
"x-enum-varnames": [
"ProxyReachable",
"ProxyUnreachable",
"ProxyUnhealthy",
"ProxyUnregistered"
]
},
"codersdk.PutExtendWorkspaceRequest": {
"type": "object",
"required": [
@ -9701,6 +9735,14 @@ const docTemplate = `{
"name": {
"type": "string"
},
"status": {
"description": "Status is the latest status check of the proxy. This will be empty for deleted\nproxies. This value can be used to determine if a workspace proxy is healthy\nand ready to use.",
"allOf": [
{
"$ref": "#/definitions/codersdk.WorkspaceProxyStatus"
}
]
},
"updated_at": {
"type": "string",
"format": "date-time"
@ -9715,6 +9757,26 @@ const docTemplate = `{
}
}
},
"codersdk.WorkspaceProxyStatus": {
"type": "object",
"properties": {
"checked_at": {
"type": "string",
"format": "date-time"
},
"report": {
"description": "Report provides more information about the health of the workspace proxy.",
"allOf": [
{
"$ref": "#/definitions/codersdk.ProxyHealthReport"
}
]
},
"status": {
"$ref": "#/definitions/codersdk.ProxyHealthStatus"
}
}
},
"codersdk.WorkspaceQuota": {
"type": "object",
"properties": {