feat(alerting): add global usage metrics for alerting

closes #5786
This commit is contained in:
bergquist
2016-08-11 21:12:39 +02:00
parent ae15de119f
commit 937726499f
8 changed files with 66 additions and 24 deletions

View File

@@ -4,6 +4,7 @@ import (
"github.com/grafana/grafana/pkg/bus"
"github.com/grafana/grafana/pkg/components/simplejson"
"github.com/grafana/grafana/pkg/log"
"github.com/grafana/grafana/pkg/metrics"
m "github.com/grafana/grafana/pkg/models"
"github.com/grafana/grafana/pkg/services/alerting"
)
@@ -40,6 +41,7 @@ type WebhookNotifier struct {
func (this *WebhookNotifier) Notify(context *alerting.EvalContext) {
this.log.Info("Sending webhook")
metrics.M_Alerting_Notification_Sent_Webhook.Inc(1)
bodyJSON := simplejson.New()
bodyJSON.Set("title", context.GetNotificationTitle())