diff --git a/rules/alerting.go b/rules/alerting.go index 1a1f4b796..235e11d47 100644 --- a/rules/alerting.go +++ b/rules/alerting.go @@ -205,8 +205,8 @@ func (r *AlertingRule) Query() promql.Expr { return r.vector } -// Duration returns the hold duration of the alerting rule. -func (r *AlertingRule) Duration() time.Duration { +// HoldDuration returns the hold duration of the alerting rule. +func (r *AlertingRule) HoldDuration() time.Duration { return r.holdDuration } @@ -547,8 +547,3 @@ func (r *AlertingRule) HTMLSnippet(pathPrefix string) html_template.HTML { } return html_template.HTML(byt) } - -// HoldDuration returns the holdDuration of the alerting rule. -func (r *AlertingRule) HoldDuration() time.Duration { - return r.holdDuration -} diff --git a/web/api/v1/api.go b/web/api/v1/api.go index 9918fefc2..54eb2d570 100644 --- a/web/api/v1/api.go +++ b/web/api/v1/api.go @@ -972,7 +972,7 @@ func (api *API) rules(r *http.Request) apiFuncResult { State: rule.State().String(), Name: rule.Name(), Query: rule.Query().String(), - Duration: rule.Duration().Seconds(), + Duration: rule.HoldDuration().Seconds(), Labels: rule.Labels(), Annotations: rule.Annotations(), Alerts: rulesAlertsToAPIAlerts(rule.ActiveAlerts()),