1
0
mirror of https://github.com/prometheus/alertmanager.git synced 2026-02-05 15:45:34 +01:00

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

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)