The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
grafana/pkg/services/ngalert/notifier/status.go

22 lines
622 B

package notifier
import (
"encoding/json"
apimodels "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions"
)
func (am *Alertmanager) GetStatus() apimodels.GettableStatus {
am.reloadConfigMtx.RLock()
defer am.reloadConfigMtx.RUnlock()
var amConfig apimodels.PostableApiAlertingConfig
if am.config != nil {
err := json.Unmarshal(am.config, &amConfig)
if err != nil {
// this should never error here, if the configuration is running it should be valid.
am.logger.Error("unable to marshal alertmanager configuration", "err", err)
}
}
return *apimodels.NewGettableStatus(&amConfig)
}