From 5d0f83d73db83536ccb69725fe516753b96a2081 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 0818f842bb..e0303e6efc 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