summaryrefslogtreecommitdiffstats
path: root/app/webhook.go
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2017-02-10 10:05:12 -0500
committerCorey Hulen <corey@hulen.com>2017-02-10 07:05:12 -0800
commit2a9c1afd444ef00693860b732c901466682e253c (patch)
treec243112a8688c2024cb078008d0454f5dcc5ed2e /app/webhook.go
parent58dcf6984be18d73968b3b96655ce57169a6c169 (diff)
downloadchat-2a9c1afd444ef00693860b732c901466682e253c.tar.gz
chat-2a9c1afd444ef00693860b732c901466682e253c.tar.bz2
chat-2a9c1afd444ef00693860b732c901466682e253c.zip
Adding webhook metrics (#5348)
Diffstat (limited to 'app/webhook.go')
-rw-r--r--app/webhook.go5
1 files changed, 5 insertions, 0 deletions
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)