Documentation
¶
Index ¶
- Variables
- type AccessURLReport
- type AgentNetcheckReport
- type BaseReport
- type ClientNetcheckReport
- type DERPHealthReport
- type DERPNodeReport
- type DERPRegionReport
- type DatabaseReport
- type HealthClient
- type HealthSection
- type HealthSettings
- type HealthcheckReport
- type Interface
- type InterfacesReport
- type ProvisionerDaemonsReport
- type ProvisionerDaemonsReportItem
- type STUNReport
- type UpdateHealthSettings
- type WebsocketReport
- type WorkspaceProxyReport
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type AccessURLReport ¶
type AccessURLReport struct { BaseReport // Healthy is deprecated and left for backward compatibility purposes, use `Severity` instead. Healthy bool `json:"healthy"` AccessURL string `json:"access_url"` Reachable bool `json:"reachable"` StatusCode int `json:"status_code"` HealthzResponse string `json:"healthz_response"` }
AccessURLReport shows the results of performing a HTTP_GET to the /healthz endpoint through the configured access URL.
type AgentNetcheckReport ¶ added in v2.15.0
type AgentNetcheckReport struct { BaseReport NetInfo *tailcfg.NetInfo `json:"net_info"` Interfaces InterfacesReport `json:"interfaces"` }
@typescript-ignore AgentNetcheckReport
type BaseReport ¶ added in v2.11.0
type BaseReport struct { Error *string `json:"error,omitempty"` Severity health.Severity `json:"severity" enums:"ok,warning,error"` Warnings []health.Message `json:"warnings"` Dismissed bool `json:"dismissed"` }
BaseReport holds fields common to various health reports.
func (*BaseReport) Summarize ¶ added in v2.11.0
func (b *BaseReport) Summarize(prefix, docsURL string) []string
Summarize returns a list of strings containing the errors and warnings of BaseReport, if present. All strings are prefixed with prefix.
type ClientNetcheckReport ¶ added in v2.13.0
type ClientNetcheckReport struct { DERP DERPHealthReport `json:"derp"` Interfaces InterfacesReport `json:"interfaces"` }
@typescript-ignore ClientNetcheckReport
type DERPHealthReport ¶
type DERPHealthReport struct { BaseReport // Healthy is deprecated and left for backward compatibility purposes, use `Severity` instead. Healthy bool `json:"healthy"` Regions map[int]*DERPRegionReport `json:"regions"` Netcheck *netcheck.Report `json:"netcheck,omitempty"` NetcheckErr *string `json:"netcheck_err,omitempty"` NetcheckLogs []string `json:"netcheck_logs"` }
DERPHealthReport includes health details of each configured DERP/STUN region.
type DERPNodeReport ¶
type DERPNodeReport struct { // Healthy is deprecated and left for backward compatibility purposes, use `Severity` instead. Healthy bool `json:"healthy"` Severity health.Severity `json:"severity" enums:"ok,warning,error"` Warnings []health.Message `json:"warnings"` Error *string `json:"error,omitempty"` Node *tailcfg.DERPNode `json:"node"` ServerInfo derp.ServerInfoMessage `json:"node_info"` CanExchangeMessages bool `json:"can_exchange_messages"` RoundTripPing string `json:"round_trip_ping"` RoundTripPingMs int `json:"round_trip_ping_ms"` UsesWebsocket bool `json:"uses_websocket"` ClientLogs [][]string `json:"client_logs"` ClientErrs [][]string `json:"client_errs"` STUN STUNReport `json:"stun"` }
DERPHealthReport includes health details of a single node in a single region.
type DERPRegionReport ¶
type DERPRegionReport struct { // Healthy is deprecated and left for backward compatibility purposes, use `Severity` instead. Healthy bool `json:"healthy"` Severity health.Severity `json:"severity" enums:"ok,warning,error"` Warnings []health.Message `json:"warnings"` Error *string `json:"error,omitempty"` Region *tailcfg.DERPRegion `json:"region"` NodeReports []*DERPNodeReport `json:"node_reports"` }
DERPHealthReport includes health details of each node in a single region.
type DatabaseReport ¶
type DatabaseReport struct { BaseReport // Healthy is deprecated and left for backward compatibility purposes, use `Severity` instead. Healthy bool `json:"healthy"` Reachable bool `json:"reachable"` Latency string `json:"latency"` LatencyMS int64 `json:"latency_ms"` ThresholdMS int64 `json:"threshold_ms"` }
DatabaseReport shows the results of pinging the configured database.Conn.
type HealthClient ¶
type HealthClient struct {
// contains filtered or unexported fields
}
@typescript-ignore HealthClient
func New ¶
func New(c *codersdk.Client) *HealthClient
func (*HealthClient) DebugHealth ¶
func (c *HealthClient) DebugHealth(ctx context.Context) (HealthcheckReport, error)
func (*HealthClient) HealthSettings ¶
func (c *HealthClient) HealthSettings(ctx context.Context) (HealthSettings, error)
func (*HealthClient) PutHealthSettings ¶
func (c *HealthClient) PutHealthSettings(ctx context.Context, settings HealthSettings) error
type HealthSection ¶
type HealthSection string
const ( HealthSectionDERP HealthSection = "DERP" HealthSectionAccessURL HealthSection = "AccessURL" HealthSectionWebsocket HealthSection = "Websocket" HealthSectionDatabase HealthSection = "Database" HealthSectionWorkspaceProxy HealthSection = "WorkspaceProxy" HealthSectionProvisionerDaemons HealthSection = "ProvisionerDaemons" )
If you add another const below, make sure to add it to HealthSections!
type HealthSettings ¶
type HealthSettings struct {
DismissedHealthchecks []HealthSection `json:"dismissed_healthchecks"`
}
type HealthcheckReport ¶
type HealthcheckReport struct { // Time is the time the report was generated at. Time time.Time `json:"time" format:"date-time"` // Healthy is true if the report returns no errors. // Deprecated: use `Severity` instead Healthy bool `json:"healthy"` // Severity indicates the status of Coder health. Severity health.Severity `json:"severity" enums:"ok,warning,error"` DERP DERPHealthReport `json:"derp"` AccessURL AccessURLReport `json:"access_url"` Websocket WebsocketReport `json:"websocket"` Database DatabaseReport `json:"database"` WorkspaceProxy WorkspaceProxyReport `json:"workspace_proxy"` ProvisionerDaemons ProvisionerDaemonsReport `json:"provisioner_daemons"` // The Coder version of the server that the report was generated on. CoderVersion string `json:"coder_version"` }
HealthcheckReport contains information about the health status of a Coder deployment.
func (*HealthcheckReport) Summarize ¶ added in v2.11.0
func (r *HealthcheckReport) Summarize(docsURL string) []string
Summarize returns a summary of all errors and warnings of components of HealthcheckReport.
type Interface ¶ added in v2.13.0
type Interface struct { Name string `json:"name"` MTU int `json:"mtu"` Addresses []string `json:"addresses"` }
@typescript-ignore Interface
type InterfacesReport ¶ added in v2.13.0
type InterfacesReport struct { BaseReport Interfaces []Interface `json:"interfaces"` }
@typescript-ignore InterfacesReport
func RunInterfacesReport ¶ added in v2.13.0
func RunInterfacesReport() (InterfacesReport, error)
type ProvisionerDaemonsReport ¶
type ProvisionerDaemonsReport struct { BaseReport Items []ProvisionerDaemonsReportItem `json:"items"` }
ProvisionerDaemonsReport includes health details of each connected provisioner daemon.
type ProvisionerDaemonsReportItem ¶
type ProvisionerDaemonsReportItem struct { codersdk.ProvisionerDaemon `json:"provisioner_daemon"` Warnings []health.Message `json:"warnings"` }
type STUNReport ¶
STUNReport contains information about a given node's STUN capabilities.
type UpdateHealthSettings ¶
type UpdateHealthSettings struct {
DismissedHealthchecks []HealthSection `json:"dismissed_healthchecks"`
}
type WebsocketReport ¶
type WebsocketReport struct { // Healthy is deprecated and left for backward compatibility purposes, use `Severity` instead. Healthy bool `json:"healthy"` BaseReport Body string `json:"body"` Code int `json:"code"` }
WebsocketReport shows if the configured access URL allows establishing WebSocket connections.
type WorkspaceProxyReport ¶
type WorkspaceProxyReport struct { // Healthy is deprecated and left for backward compatibility purposes, use `Severity` instead. Healthy bool `json:"healthy"` BaseReport WorkspaceProxies codersdk.RegionsResponse[codersdk.WorkspaceProxy] `json:"workspace_proxies"` }
WorkspaceProxyReport includes health details of each connected workspace proxy.