func (a *Alert) GetLabel(key string) (value string, ok bool) {
	if v, ok := a.Labels[key]; ok {
		return v, ok
	}
	if a.Parent == nil {
		return "", false
	}
	if v, ok := a.Parent.CommonLabels[key]; ok {
		return v, ok
	}
	if v, ok := a.Parent.GroupLabels[key]; ok {
		return v, ok
	}
	return "", false
}
GetLabel gets a label from an alert. It will fetch labels in Alert.Label
with fallback to Parent.CommonLabels and Parent.GroupLabels for you.
package alertmanager
import "time"
type Message struct {
	Version           string            `json:"version"`
	GroupKey          string            `json:"groupKey"`
	Status            string            `json:"status"`
	Receiver          string            `json:"receiver"`
	GroupLabels       map[string]string `json:"groupLabels"`
	CommonLabels      map[string]string `json:"commonLabels"`
	CommonAnnotations map[string]string `json:"commonAnnotations"`
	ExternalURL       string            `json:"externalURL"`
	Alerts            []*Alert          `json:"alerts"`
}
type Alert struct {
	Parent       *Message          `json:"-"`
	Status       string            `json:"status"`
	Labels       map[string]string `json:"labels"`
	Annotations  map[string]string `json:"annotations"`
	StartsAt     time.Time         `json:"startsAt"`
	EndsAt       time.Time         `json:"endsAt"`
	GeneratorURL string            `json:"generatorURL"`
}
func NewAlert() Alert {
	return Alert{
		Status:      "firing",
		Labels:      make(map[string]string),
		Annotations: make(map[string]string),
	}
}