Alerting: Support for active time intervals in notification policies (#104252)

* add active_time_intervals to route model

* update k8s compat layer

* update notification policies service to validate active time intervals

* update integration tests

* update openapi

* add active time interval to model

* update route generator to include active time interval

* Update storage list and rename methods to handle active intervals

* update api model

* update provisioning and export models

* update ui to allow active timing config

* update i18n

* fix snapshots for ui tests

* run prettier

* Alerting: Active time intervals UI naming (#104402)

* update naming in UI

* update naming in the edit page title

* update translations

* update alerting module

---------

Signed-off-by: Yuri Tseretyan <yuriy.tseretyan@grafana.com>
Co-authored-by: Sonia Aguilar <33540275+soniaAguilarPeiron@users.noreply.github.com>
Co-authored-by: Sonia Aguilar <soniaaguilarpeiron@gmail.com>
This commit is contained in:
Yuri Tseretyan
2025-05-07 19:19:33 -04:00
committed by GitHub
co-authored by Sonia Aguilar Sonia Aguilar
parent a8dee54aa4
commit 3e2296acd3
61 changed files with 631 additions and 338 deletions
@@ -51,13 +51,14 @@ func ConvertToK8sResource(orgID int64, r definitions.Route, version string, name
func convertRouteToK8sSubRoute(r *definitions.Route) model.Route {
result := model.Route{
GroupBy: r.GroupByStr,
MuteTimeIntervals: r.MuteTimeIntervals,
Continue: r.Continue,
GroupWait: optionalPrometheusDurationToString(r.GroupWait),
GroupInterval: optionalPrometheusDurationToString(r.GroupInterval),
RepeatInterval: optionalPrometheusDurationToString(r.RepeatInterval),
Routes: make([]model.Route, 0, len(r.Routes)),
GroupBy: r.GroupByStr,
MuteTimeIntervals: r.MuteTimeIntervals,
ActiveTimeIntervals: r.ActiveTimeIntervals,
Continue: r.Continue,
GroupWait: optionalPrometheusDurationToString(r.GroupWait),
GroupInterval: optionalPrometheusDurationToString(r.GroupInterval),
RepeatInterval: optionalPrometheusDurationToString(r.RepeatInterval),
Routes: make([]model.Route, 0, len(r.Routes)),
}
if r.Receiver != "" {
result.Receiver = util.Pointer(r.Receiver)
@@ -152,11 +153,12 @@ func convertToDomainModel(obj *model.RoutingTree) (definitions.Route, string, er
func convertK8sSubRouteToRoute(r model.Route, path string) (definitions.Route, []error) {
result := definitions.Route{
GroupByStr: r.GroupBy,
MuteTimeIntervals: r.MuteTimeIntervals,
Routes: make([]*definitions.Route, 0, len(r.Routes)),
Matchers: make(config.Matchers, 0, len(r.Matchers)),
Continue: r.Continue,
GroupByStr: r.GroupBy,
MuteTimeIntervals: r.MuteTimeIntervals,
ActiveTimeIntervals: r.ActiveTimeIntervals,
Routes: make([]*definitions.Route, 0, len(r.Routes)),
Matchers: make(config.Matchers, 0, len(r.Matchers)),
Continue: r.Continue,
}
if r.Receiver != nil {
result.Receiver = *r.Receiver