consul: more telemetry on RPCs and queries

This commit is contained in:
Armon Dadgar 2015-05-07 17:25:12 -07:00
parent e59ef3a46f
commit 5d0f83d73d
1 changed files with 3 additions and 0 deletions

View File

@ -160,9 +160,11 @@ func (s *Server) handleConsulConn(conn net.Conn) {
if err := s.rpcServer.ServeRequest(rpcCodec); err != nil { if err := s.rpcServer.ServeRequest(rpcCodec); err != nil {
if err != io.EOF && !strings.Contains(err.Error(), "closed") { if err != io.EOF && !strings.Contains(err.Error(), "closed") {
s.logger.Printf("[ERR] consul.rpc: RPC error: %v (%v)", err, conn) s.logger.Printf("[ERR] consul.rpc: RPC error: %v (%v)", err, conn)
metrics.IncrCounter([]string{"consul", "rpc", "request_error"}, 1)
} }
return return
} }
metrics.IncrCounter([]string{"consul", "rpc", "request"}, 1)
} }
} }
@ -363,6 +365,7 @@ RUN_QUERY:
} }
// Run the query function // Run the query function
metrics.IncrCounter([]string{"consul", "rpc", "query"}, 1)
err := opts.run() err := opts.run()
// Check for minimum query time // Check for minimum query time