Add Fingerprint to template data

Signed-off-by: Paul Traylor <paul.traylor@linecorp.com>
This commit is contained in:
Paul Traylor 2019-06-28 17:32:03 +09:00
parent c29b987ec6
commit 6fbbda75ed
1 changed files with 2 additions and 0 deletions

View File

@ -246,6 +246,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.
@ -295,6 +296,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)