From 2d2fc71e0d0fbbba0ad1c2e6cb81d23ab2329b77 Mon Sep 17 00:00:00 2001 From: Armon Dadgar Date: Thu, 7 May 2015 17:25:12 -0700 Subject: [PATCH] consul: more telemetry on RPCs and queries --- consul/rpc.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/consul/rpc.go b/consul/rpc.go index 0818f842b..e0303e6ef 100644 --- a/consul/rpc.go +++ b/consul/rpc.go @@ -160,9 +160,11 @@ func (s *Server) handleConsulConn(conn net.Conn) { if err := s.rpcServer.ServeRequest(rpcCodec); err != nil { if err != io.EOF && !strings.Contains(err.Error(), "closed") { s.logger.Printf("[ERR] consul.rpc: RPC error: %v (%v)", err, conn) + metrics.IncrCounter([]string{"consul", "rpc", "request_error"}, 1) } return } + metrics.IncrCounter([]string{"consul", "rpc", "request"}, 1) } } @@ -363,6 +365,7 @@ RUN_QUERY: } // Run the query function + metrics.IncrCounter([]string{"consul", "rpc", "query"}, 1) err := opts.run() // Check for minimum query time