File tree 5 files changed +17
-1
lines changed 5 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ import (
15
15
// @typescript-generate AccessURLReport
16
16
type AccessURLReport struct {
17
17
Healthy bool `json:"healthy"`
18
+ Severity Severity `json:"severity" enums:"ok,warning,error"`
18
19
Warnings []string `json:"warnings"`
19
20
20
21
AccessURL string `json:"access_url"`
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ const (
17
17
// @typescript-generate DatabaseReport
18
18
type DatabaseReport struct {
19
19
Healthy bool `json:"healthy"`
20
+ Severity Severity `json:"severity" enums:"ok,warning,error"`
20
21
Warnings []string `json:"warnings"`
21
22
22
23
Reachable bool `json:"reachable"`
Original file line number Diff line number Diff line change @@ -55,8 +55,10 @@ type Report struct {
55
55
56
56
// @typescript-generate RegionReport
57
57
type RegionReport struct {
58
- mu sync.Mutex
58
+ mu sync.Mutex
59
+
59
60
Healthy bool `json:"healthy"`
61
+ Severity Severity `json:"severity" enums:"ok,warning,error"`
60
62
Warnings []string `json:"warnings"`
61
63
62
64
Region * tailcfg.DERPRegion `json:"region"`
@@ -70,6 +72,7 @@ type NodeReport struct {
70
72
clientCounter int
71
73
72
74
Healthy bool `json:"healthy"`
75
+ Severity Severity `json:"severity" enums:"ok,warning,error"`
73
76
Warnings []string `json:"warnings"`
74
77
75
78
Node * tailcfg.DERPNode `json:"node"`
Original file line number Diff line number Diff line change @@ -18,6 +18,14 @@ const (
18
18
SectionDatabase string = "Database"
19
19
)
20
20
21
+ const (
22
+ SeverityOK Severity = "ok"
23
+ SeverityWarning Severity = "warning"
24
+ SeverityError Severity = "error"
25
+ )
26
+
27
+ type Severity string
28
+
21
29
type Checker interface {
22
30
DERP (ctx context.Context , opts * derphealth.ReportOptions ) derphealth.Report
23
31
AccessURL (ctx context.Context , opts * AccessURLReportOptions ) AccessURLReport
@@ -31,6 +39,8 @@ type Report struct {
31
39
Time time.Time `json:"time"`
32
40
// Healthy is true if the report returns no errors.
33
41
Healthy bool `json:"healthy"`
42
+ // Severity indicates the status of Coder health.
43
+ Severity Severity `json:"severity" enums:"ok,warning,error"`
34
44
// FailingSections is a list of sections that have failed their healthcheck.
35
45
FailingSections []string `json:"failing_sections"`
36
46
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ type WebsocketReportOptions struct {
22
22
// @typescript-generate WebsocketReport
23
23
type WebsocketReport struct {
24
24
Healthy bool `json:"healthy"`
25
+ Severity Severity `json:"severity" enums:"ok,warning,error"`
25
26
Warnings []string `json:"warnings"`
26
27
27
28
Body string `json:"body"`
You can’t perform that action at this time.
0 commit comments