Merge pull request #1945 from kfdm/webhook-fingerprint

Add Fingerprint to template data
This commit is contained in:
stuart nelson 2019-07-22 17:02:29 +02:00 committed by GitHub
commit e7275537ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -245,6 +245,7 @@ type Alert struct {
StartsAt time.Time `json:"startsAt"`
EndsAt time.Time `json:"endsAt"`
GeneratorURL string `json:"generatorURL"`
Fingerprint string `json:"fingerprint"`
}
// Alerts is a list of Alert objects.
@ -294,6 +295,7 @@ func (t *Template) Data(recv string, groupLabels model.LabelSet, alerts ...*type
StartsAt: a.StartsAt,
EndsAt: a.EndsAt,
GeneratorURL: a.GeneratorURL,
Fingerprint: a.Fingerprint().String(),
}
for k, v := range a.Labels {
alert.Labels[string(k)] = string(v)