checker: add RuleName field to CheckState instead of overloading Code
Rules can now set Code freely without the server clobbering it; the originating rule is reported separately via RuleName.
This commit is contained in:
parent
199c7dea3f
commit
c9ee6655ca
4 changed files with 57 additions and 13 deletions
|
|
@ -187,11 +187,12 @@ func (s Status) String() string {
|
|||
// (a hostname, a record key, a serial, …). Leave Subject empty for rules
|
||||
// that produce a single, global result.
|
||||
type CheckState struct {
|
||||
Status Status `json:"status"`
|
||||
Message string `json:"message"`
|
||||
Code string `json:"code,omitempty"`
|
||||
Subject string `json:"subject,omitempty"`
|
||||
Meta map[string]any `json:"meta,omitempty"`
|
||||
Status Status `json:"status"`
|
||||
Message string `json:"message"`
|
||||
RuleName string `json:"rule,omitempty"`
|
||||
Code string `json:"code,omitempty"`
|
||||
Subject string `json:"subject,omitempty"`
|
||||
Meta map[string]any `json:"meta,omitempty"`
|
||||
}
|
||||
|
||||
// CheckMetric represents a single metric produced by a check.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue