Alerting: Return merged extra configurations in the API (#109636)

This commit is contained in:
Alexander Akhmetov
2025-08-14 07:46:12 +02:00
committed by GitHub
parent 7d7721e30a
commit e165a490b4
9 changed files with 214 additions and 146 deletions
@@ -135,7 +135,7 @@ type ConvertPrometheusSrv struct {
type Alertmanager interface {
DeleteExtraConfiguration(ctx context.Context, org int64, identifier string) error
SaveAndApplyExtraConfiguration(ctx context.Context, org int64, extraConfig apimodels.ExtraConfiguration) error
GetAlertmanagerConfiguration(ctx context.Context, org int64, withAutogen bool) (apimodels.GettableUserConfig, error)
GetAlertmanagerConfiguration(ctx context.Context, org int64, withAutogen bool, withMergedExtraConfig bool) (apimodels.GettableUserConfig, error)
}
func NewConvertPrometheusSrv(
@@ -594,7 +594,7 @@ func (srv *ConvertPrometheusSrv) RouteConvertPrometheusGetAlertmanagerConfig(c *
identifier := parseConfigIdentifierHeader(c)
cfg, err := srv.am.GetAlertmanagerConfiguration(ctx, c.GetOrgID(), false)
cfg, err := srv.am.GetAlertmanagerConfiguration(ctx, c.GetOrgID(), false, false)
if err != nil {
logger.Error("failed to get alertmanager configuration", "err", err)
return errorToResponse(err)