Skip to content

Commit

Permalink
consul: more telemetry on RPCs and queries
Browse files Browse the repository at this point in the history
  • Loading branch information
armon committed May 8, 2015
1 parent e59ef3a commit 5d0f83d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions consul/rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 5d0f83d

Please sign in to comment.