mirror of
https://github.com/coder/coder.git
synced 2026-06-02 20:48:20 +00:00
feat(coderd/healthcheck): add access URL error codes and healthcheck doc (#10915)
Relates to #8965 - Added error codes for separate code paths in health checks - Prefixed errors and warnings with error code prefixes - Added a docs page with details on each code, cause and solution Co-authored-by: Muhammad Atif Ali <atif@coder.com>
This commit is contained in:
@@ -136,9 +136,7 @@ func (r *Report) Run(ctx context.Context, opts *ReportOptions) {
|
||||
r.Healthy = false
|
||||
}
|
||||
|
||||
for _, w := range regionReport.Warnings {
|
||||
r.Warnings = append(r.Warnings, fmt.Sprintf("[%s] %s", regionReport.Region.RegionName, w))
|
||||
}
|
||||
r.Warnings = append(r.Warnings, regionReport.Warnings...)
|
||||
mu.Unlock()
|
||||
}()
|
||||
}
|
||||
@@ -202,9 +200,7 @@ func (r *RegionReport) Run(ctx context.Context) {
|
||||
unhealthyNodes++
|
||||
}
|
||||
|
||||
for _, w := range nodeReport.Warnings {
|
||||
r.Warnings = append(r.Warnings, fmt.Sprintf("[%s] %s", nodeReport.Node.Name, w))
|
||||
}
|
||||
r.Warnings = append(r.Warnings, nodeReport.Warnings...)
|
||||
r.mu.Unlock()
|
||||
}()
|
||||
}
|
||||
@@ -228,7 +224,7 @@ func (r *RegionReport) Run(ctx context.Context) {
|
||||
} else if unhealthyNodes == 1 {
|
||||
// r.Healthy = true (by default)
|
||||
r.Severity = health.SeverityWarning
|
||||
r.Warnings = append(r.Warnings, oneNodeUnhealthy)
|
||||
r.Warnings = append(r.Warnings, health.Messagef(health.CodeDERPOneNodeUnhealthy, oneNodeUnhealthy))
|
||||
} else if unhealthyNodes > 1 {
|
||||
r.Healthy = false
|
||||
|
||||
@@ -292,7 +288,7 @@ func (r *NodeReport) Run(ctx context.Context) {
|
||||
}
|
||||
|
||||
if r.UsesWebsocket {
|
||||
r.Warnings = append(r.Warnings, warningNodeUsesWebsocket)
|
||||
r.Warnings = append(r.Warnings, health.Messagef(health.CodeDERPNodeUsesWebsocket, warningNodeUsesWebsocket))
|
||||
r.Severity = health.SeverityWarning
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user