diff --git a/pkg/services/alerting/notifiers/pagerduty.go b/pkg/services/alerting/notifiers/pagerduty.go index c3bcf475c46..9fe27f67b4c 100644 --- a/pkg/services/alerting/notifiers/pagerduty.go +++ b/pkg/services/alerting/notifiers/pagerduty.go @@ -5,8 +5,6 @@ import ( "strconv" "time" - "fmt" - "github.com/grafana/grafana/pkg/bus" "github.com/grafana/grafana/pkg/components/simplejson" "github.com/grafana/grafana/pkg/infra/log" @@ -80,9 +78,9 @@ func (pn *PagerdutyNotifier) Notify(evalContext *alerting.EvalContext) error { if evalContext.Rule.State == models.AlertStateOK { eventType = "resolve" } - customData := triggMetrString + customData := simplejson.New() for _, evt := range evalContext.EvalMatches { - customData = customData + fmt.Sprintf("%s: %v\n", evt.Metric, evt.Value) + customData.Set(evt.Metric, evt.Value) } pn.log.Info("Notifying Pagerduty", "event_type", eventType)