mirror of
https://github.com/hanzoai/metrics.git
synced 2026-10-30 20:03:39 +00:00
fix https://github.com/VictoriaMetrics/VictoriaMetrics/issues/9551. To avoid the group update blocking API calls for irrelevant resources for too long, we don't lock the `m.groupsMu` during the [group updates](https://github.com/VictoriaMetrics/VictoriaMetrics/blob/71d7b27d75ac71e145266df788a3641803e5bf2c/app/vmalert/manager.go#L100). And to avoid group changes during related API calls, a [DeepCopy](https://github.com/VictoriaMetrics/VictoriaMetrics/blob/61c5e8185c5b09941b6e92fbc66b2bce6d2a2fb5/app/vmalert/web_types.go#L341) was used to copy needed group info, but it was not implemented correctly and can't be implemented efficiently. This pull request splits rule-related web types into sub-packages, which should be clearer and easier to maintain. --------- Signed-off-by: hagen1778 <[email protected]> Co-authored-by: hagen1778 <[email protected]>
20 lines
630 B
Go
20 lines
630 B
Go
package notifier
|
|
|
|
// ApiNotifier represents a Notifier configuration for WEB view
|
|
type ApiNotifier struct {
|
|
// Kind is a Notifier type
|
|
Kind TargetType `json:"kind"`
|
|
// Targets is a list of Notifier targets
|
|
Targets []*ApiTarget `json:"targets"`
|
|
}
|
|
|
|
// ApiTarget represents a specific Notifier target for WEB view
|
|
type ApiTarget struct {
|
|
// Address is a URL for sending notifications
|
|
Address string `json:"address"`
|
|
// Labels is a list of labels to add to each sent notification
|
|
Labels map[string]string `json:"labels"`
|
|
// LastError contains the error faced while sending to notifier.
|
|
LastError string `json:"lastError"`
|
|
}
|