Files
Yuri Tseretyan 7dc13d63b9 Alerting: Refactor Grafana Alertmanager (#105568)
* update alerting module

* use NotificationsConfiguration
* update to use opts and configure new fields
* use TenantID instead of orgId
2025-05-20 04:40:51 +03:00

19 lines
391 B
Go

package notifier
import (
"encoding/json"
"fmt"
api "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions"
)
func Load(rawConfig []byte) (*api.PostableUserConfig, error) {
cfg := &api.PostableUserConfig{}
if err := json.Unmarshal(rawConfig, cfg); err != nil {
return nil, fmt.Errorf("unable to parse Alertmanager configuration: %w", err)
}
return cfg, nil
}