From 2a9c1afd444ef00693860b732c901466682e253c Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Fri, 10 Feb 2017 10:05:12 -0500 Subject: Adding webhook metrics (#5348) --- app/webhook.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'app/webhook.go') diff --git a/app/webhook.go b/app/webhook.go index 70ba1d07a..89e322180 100644 --- a/app/webhook.go +++ b/app/webhook.go @@ -12,6 +12,7 @@ import ( "strings" l4g "github.com/alecthomas/log4go" + "github.com/mattermost/platform/einterfaces" "github.com/mattermost/platform/model" "github.com/mattermost/platform/utils" ) @@ -126,6 +127,10 @@ func CreateWebhookPost(userId, teamId, channelId, text, overrideUsername, overri post := &model.Post{UserId: userId, ChannelId: channelId, Message: text, Type: postType} post.AddProp("from_webhook", "true") + if metrics := einterfaces.GetMetricsInterface(); metrics != nil { + metrics.IncrementWebhookPost() + } + if utils.Cfg.ServiceSettings.EnablePostUsernameOverride { if len(overrideUsername) != 0 { post.AddProp("override_username", overrideUsername) -- cgit v1.2.3-1-g7c22