diff --git a/probe/appclient/app_client.go b/probe/appclient/app_client.go index 2f77bfd20..1912019b4 100644 --- a/probe/appclient/app_client.go +++ b/probe/appclient/app_client.go @@ -11,6 +11,7 @@ import ( "sync" "time" + "github.com/armon/go-metrics" "github.com/gorilla/websocket" "github.com/hashicorp/go-cleanhttp" log "github.com/sirupsen/logrus" @@ -299,6 +300,10 @@ func (c *appClient) publish(r io.Reader) error { } defer resp.Body.Close() + metrics.IncrCounterWithLabels([]string{"publishes"}, 1, []metrics.Label{ + {Name: "destination", Value: req.Host}, + {Name: "status", Value: fmt.Sprint(resp.StatusCode)}, + }) if resp.StatusCode != http.StatusOK { text, _ := ioutil.ReadAll(resp.Body) return fmt.Errorf(resp.Status + ": " + string(text))