{"action":"opened","issue":{"url":"https://api.github.com/repos/hashicorp/consul/issues/1428","labels_url":"https://api.github.com/repos/hashicorp/consul/issues/1428/labels{/name}","comments_url":"https://api.github.com/repos/hashicorp/consul/issues/1428/comments","events_url":"https://api.github.com/repos/hashicorp/consul/issues/1428/events","html_url":"https://github.com/hashicorp/consul/issues/1428","id":117739053,"number":1428,"title":"Provide HTTP API that gives count of # of keys","user":{"login":"msabramo","id":305268,"avatar_url":"https://avatars.githubusercontent.com/u/305268?v=3","gravatar_id":"","url":"https://api.github.com/users/msabramo","html_url":"https://github.com/msabramo","followers_url":"https://api.github.com/users/msabramo/followers","following_url":"https://api.github.com/users/msabramo/following{/other_user}","gists_url":"https://api.github.com/users/msabramo/gists{/gist_id}","starred_url":"https://api.github.com/users/msabramo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/msabramo/subscriptions","organizations_url":"https://api.github.com/users/msabramo/orgs","repos_url":"https://api.github.com/users/msabramo/repos","events_url":"https://api.github.com/users/msabramo/events{/privacy}","received_events_url":"https://api.github.com/users/msabramo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-11-19T04:32:12Z","updated_at":"2015-11-19T04:32:12Z","closed_at":null,"body":"I have a Consul cluster with 2.8 million garbage `/vault/core/leader` entries (resulting from a bug in some older versions of Vault - https://github.com/hashicorp/vault/issues/679) that hurts Consul KV and UI performance (operations apparently take too long and timeout because of the number of keys that have to be crawled - https://github.com/hashicorp/consul/issues/1407). \r\n\r\nI had no idea that I had accumulated this huge number of keys until things got slow and started timing out and then @slackpad recognized the symptoms and suggested running `strings state.bin | grep vault/core/leader | wc -l` to count the number of keys.\r\n\r\nTo prevent this in the future I'd like to set up monitoring (e.g.: Nagios, Zabbix, etc.) that can watch the number of keys. It would be best if the Consul HTTP API had a method that exposed the # of keys.  \r\n\r\nCc: @sudarkoff"}}