{"action":"created","comment":{"url":"https://api.github.com/repos/cockroachdb/cockroach/pulls/comments/35384212","id":35384212,"diff_hunk":"@@ -39,68 +38,73 @@ import (\n )\n \n const (\n-\t// stackTraceApproxSize is the approximate size of a goroutine stack trace.\n-\tstackTraceApproxSize = 1024\n-\n-\t// statusKeyPrefix is the root of the RESTful cluster statistics and metrics API.\n-\tstatusKeyPrefix = \"/_status/\"\n-\n-\t// statusGossipKeyPrefix exposes a view of the gossip network.\n-\tstatusGossipKeyPrefix = statusKeyPrefix + \"gossip\"\n-\n-\t// statusLocalKeyPrefix is the key prefix for all local status\n-\t// info. Unadorned, the URL exposes the status of the node serving\n-\t// the request.  This is equivalent to GETing\n-\t// statusNodesKeyPrefix/<current-node-id>.  Useful for debugging\n-\t// nodes that aren't communicating with the cluster properly.\n-\tstatusLocalKeyPrefix = statusKeyPrefix + \"local/\"\n-\n-\t// statusLocalLogKeyPrefix exposes a list of log files for the node.\n-\t// logfiles -> lists available log files\n-\t// logfiles/ -> lists available log files\n-\t// logfiles/{file} -> fetches contents of named log\n-\tstatusLocalLogFileKeyPrefix = statusLocalKeyPrefix + \"logfiles/\"\n-\t// statusLocalLogFileKeyPattern is the pattern to match\n-\t// logfiles/{file}\n-\tstatusLocalLogFileKeyPattern = statusLocalLogFileKeyPrefix + \":file\"\n-\n-\t// statusLocalStacksKey exposes stack traces of running goroutines.\n-\tstatusLocalStacksKey = statusLocalKeyPrefix + \"stacks\"\n-\n-\t// statusNodeKeyPrefix exposes status for each of the nodes the cluster.\n-\t// nodes -> lists all nodes\n-\t// nodes/ -> lists all nodes\n-\t// nodes/{NodeID} -> shows only the status for that specific node\n-\tstatusNodeKeyPrefix = statusKeyPrefix + \"nodes/\"\n-\t// statusNodeKeyPattern is the pattern to match nodes/{NodeID}\n-\tstatusNodeKeyPattern = statusNodeKeyPrefix + \":id\"\n-\n-\t// statusStoreKeyPrefix exposes status for each store.\n-\t// stores -> lists all nodes\n-\t// stores/ -> lists all nodes\n-\t// stores/{StoreID} -> shows only the status for that specific store\n-\tstatusStoreKeyPrefix = statusKeyPrefix + \"stores/\"\n-\t// statusStoreKeyPattern is the pattern to match stores/{StoreID}\n-\tstatusStoreKeyPattern = statusStoreKeyPrefix + \":id\"\n-\n-\t// statusLogKeyPrefix exposes the logs for each node\n-\t// logs -> list log entries for the local node\n-\t// logs/ -> list log entries for the local node\n-\t// logs/{NodeID} -> list logs entries for that specific node\n-\tstatusLogKeyPrefix = statusKeyPrefix + \"logs/\"\n-\t// statusLogKeyPattern is the pattern to match log/{NodeID}\n-\tstatusLogKeyPattern = statusLogKeyPrefix + \":node_id\"\n-\n-\t// statusTransactionsKeyPrefix exposes transaction statistics.\n-\tstatusTransactionsKeyPrefix = statusKeyPrefix + \"txns/\"\n-\n+\t/*\n+\t\tNote that :node_id can always be replaced by the value \"local\" to see\n+\t\tthe local nodes response.\n+\n+\t\t/_status/details/:node_id\t\t - specific node's details\n+\t\t/_status/gossip/:node_id         - specific node's gossip\n+\t\t/_status/logfiles/:node_id       - list log files\n+\t\t/_status/logfiles/:node_id/:file - returns the contents of the specific\n+\t\t\t\t\t\t\t\t\t\t   log files on specific node\n+\t\t/_status/logs/:node_id           - log entries from a specific node\n+\t\t/_status/stacks/:node_id\t\t - exposes stack traces of running\n+\t\t\t\t\t\t\t\t\t\t   goroutines\n+\t\t/_status/nodes\t\t\t\t     - all nodes' status\n+\t\t/_status/nodes/:node_id\t\t     - a specific node's status\n+\t\t/_status/stores                  - all stores' status\n+\t\t/_status/stores/:store_id        - a specific store's status\n+\t*/\n+\n+\t// statusPrefix is the root of the cluster statistics and metrics API.\n+\tstatusPrefix = \"/_status/\"\n+\n+\t// statusGossipPattern exposes a view of the gossip network.\n+\tstatusGossipPattern = \"/_status/gossip/:node_id\"\n+\tstatusGossipLocal   = \"/_status/gossip/local\"\n+\n+\t// statusDetailsPattern exposes a node's details.\n+\tstatusDetailsPattern = \"/_status/details/:node_id\"\n+\tstatusDetailsLocal   = \"/_status/details/local\"\n+\n+\t// statusLogFilesListPattern exposes a list of log files.\n+\tstatusLogFilesListPattern = \"/_status/logfiles/:node_id\"\n+\tstatusLogFilesListLocal   = \"/_status/logfiles/local\"\n+\t// statusLogFilePattern exposes a specific file on a node.\n+\tstatusLogFilePattern = \"/_status/logfiles/:node_id/:file\"\n+\n+\t// statusLogKeyPrefix exposes the logs for each node.\n+\tstatusLogsPattern = \"/_status/logs/:node_id\"\n+\tstatusLogsLocal   = \"/_status/logs/local\"\n \t// Default Maximum number of log entries returned.\n \tdefaultMaxLogEntries = 1000\n \n-\t// Timeout for used for looking up log entries in another node.\n-\tlogEntriesTimeout = time.Second\n+\t// statusStacksPattern exposes the stack traces of running goroutines.\n+\tstatusStacksPattern = \"/_status/stacks/:node_id\"\n+\tstatusStacksLocal   = \"/_status/stacks/local\"\n+\t// stackTraceApproxSize is the approximate size of a goroutine stack trace.\n+\tstackTraceApproxSize = 1024\n+\n+\t// statusNodesPattern exposes status for all nodes in the cluster.\n+\tstatusNodesPattern = \"/_status/nodes/\"\n+\t// statusNodePattern exposes status for a single node.\n+\tstatusNodePattern = \"/_status/nodes/:node_id\"\n+\tstatusNodeLocal   = \"/_status/nodes/local\"\n+\n+\t// statusStoresPattern exposes status for all stores in the cluster.\n+\tstatusStoresPattern = \"/_status/stores/\"\n+\t// statusStorePattern exposes status for a single store.\n+\tstatusStorePattern = \"/_status/stores/:store_id\"\n+\tstatusStoreLocal   = \"/_status/stores/local\"\n+\n+\t// statusProxyTimeout is the timeout used when proxying a request to another\n+\t// node.\n+\tstatusProxyTimeout = time.Second\n )\n \n+// Pattern for local used when determining the node ID.\n+var localRE = regexp.MustCompile(`(?i)local`)","path":"server/status.go","position":136,"original_position":136,"commit_id":"f092fdb6401672e9f6c7e699895fc49d6b0942f2","original_commit_id":"f092fdb6401672e9f6c7e699895fc49d6b0942f2","user":{"login":"BramGruneir","id":1614265,"avatar_url":"https://avatars.githubusercontent.com/u/1614265?v=3","gravatar_id":"","url":"https://api.github.com/users/BramGruneir","html_url":"https://github.com/BramGruneir","followers_url":"https://api.github.com/users/BramGruneir/followers","following_url":"https://api.github.com/users/BramGruneir/following{/other_user}","gists_url":"https://api.github.com/users/BramGruneir/gists{/gist_id}","starred_url":"https://api.github.com/users/BramGruneir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BramGruneir/subscriptions","organizations_url":"https://api.github.com/users/BramGruneir/orgs","repos_url":"https://api.github.com/users/BramGruneir/repos","events_url":"https://api.github.com/users/BramGruneir/events{/privacy}","received_events_url":"https://api.github.com/users/BramGruneir/received_events","type":"User","site_admin":false},"body":"case insensitive.\r\nhttps://stackoverflow.com/questions/15326421/how-do-i-do-a-case-insensitive-regular-expression-in-go","created_at":"2015-07-23T23:41:18Z","updated_at":"2015-07-23T23:41:18Z","html_url":"https://github.com/cockroachdb/cockroach/pull/1792#discussion_r35384212","pull_request_url":"https://api.github.com/repos/cockroachdb/cockroach/pulls/1792","_links":{"self":{"href":"https://api.github.com/repos/cockroachdb/cockroach/pulls/comments/35384212"},"html":{"href":"https://github.com/cockroachdb/cockroach/pull/1792#discussion_r35384212"},"pull_request":{"href":"https://api.github.com/repos/cockroachdb/cockroach/pulls/1792"}}},"pull_request":{"url":"https://api.github.com/repos/cockroachdb/cockroach/pulls/1792","id":40722075,"html_url":"https://github.com/cockroachdb/cockroach/pull/1792","diff_url":"https://github.com/cockroachdb/cockroach/pull/1792.diff","patch_url":"https://github.com/cockroachdb/cockroach/pull/1792.patch","issue_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/1792","number":1792,"state":"open","locked":false,"title":"Refactor and Update Status Server","user":{"login":"BramGruneir","id":1614265,"avatar_url":"https://avatars.githubusercontent.com/u/1614265?v=3","gravatar_id":"","url":"https://api.github.com/users/BramGruneir","html_url":"https://github.com/BramGruneir","followers_url":"https://api.github.com/users/BramGruneir/followers","following_url":"https://api.github.com/users/BramGruneir/following{/other_user}","gists_url":"https://api.github.com/users/BramGruneir/gists{/gist_id}","starred_url":"https://api.github.com/users/BramGruneir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BramGruneir/subscriptions","organizations_url":"https://api.github.com/users/BramGruneir/orgs","repos_url":"https://api.github.com/users/BramGruneir/repos","events_url":"https://api.github.com/users/BramGruneir/events{/privacy}","received_events_url":"https://api.github.com/users/BramGruneir/received_events","type":"User","site_admin":false},"body":"This is a cleanup of the status server.\r\nThe biggest change is the removal of the `/_status/local` and instead replacing anywhere that could be scoped to a node, to include the ability to specify any nodeID (or `local`).  So you can now send the request for `/_status/stacks/2` to any node and it will always forward that request to node 2.  Or you could  also request `/_status/stacks/local` and it will return the node's own details.\r\n\r\nThe next step after this is to write a proper acceptance test for it.","created_at":"2015-07-23T21:45:11Z","updated_at":"2015-07-23T23:41:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2f916b2bf954998fd9a1884fec4350897700e52c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/cockroachdb/cockroach/pulls/1792/commits","review_comments_url":"https://api.github.com/repos/cockroachdb/cockroach/pulls/1792/comments","review_comment_url":"https://api.github.com/repos/cockroachdb/cockroach/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/1792/comments","statuses_url":"https://api.github.com/repos/cockroachdb/cockroach/statuses/f092fdb6401672e9f6c7e699895fc49d6b0942f2","head":{"label":"cockroachdb:bram/clean-status-server","ref":"bram/clean-status-server","sha":"f092fdb6401672e9f6c7e699895fc49d6b0942f2","user":{"login":"cockroachdb","id":6748139,"avatar_url":"https://avatars.githubusercontent.com/u/6748139?v=3","gravatar_id":"","url":"https://api.github.com/users/cockroachdb","html_url":"https://github.com/cockroachdb","followers_url":"https://api.github.com/users/cockroachdb/followers","following_url":"https://api.github.com/users/cockroachdb/following{/other_user}","gists_url":"https://api.github.com/users/cockroachdb/gists{/gist_id}","starred_url":"https://api.github.com/users/cockroachdb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cockroachdb/subscriptions","organizations_url":"https://api.github.com/users/cockroachdb/orgs","repos_url":"https://api.github.com/users/cockroachdb/repos","events_url":"https://api.github.com/users/cockroachdb/events{/privacy}","received_events_url":"https://api.github.com/users/cockroachdb/received_events","type":"Organization","site_admin":false},"repo":{"id":16563587,"name":"cockroach","full_name":"cockroachdb/cockroach","owner":{"login":"cockroachdb","id":6748139,"avatar_url":"https://avatars.githubusercontent.com/u/6748139?v=3","gravatar_id":"","url":"https://api.github.com/users/cockroachdb","html_url":"https://github.com/cockroachdb","followers_url":"https://api.github.com/users/cockroachdb/followers","following_url":"https://api.github.com/users/cockroachdb/following{/other_user}","gists_url":"https://api.github.com/users/cockroachdb/gists{/gist_id}","starred_url":"https://api.github.com/users/cockroachdb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cockroachdb/subscriptions","organizations_url":"https://api.github.com/users/cockroachdb/orgs","repos_url":"https://api.github.com/users/cockroachdb/repos","events_url":"https://api.github.com/users/cockroachdb/events{/privacy}","received_events_url":"https://api.github.com/users/cockroachdb/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cockroachdb/cockroach","description":"A Scalable, Geo-Replicated, Transactional Datastore","fork":false,"url":"https://api.github.com/repos/cockroachdb/cockroach","forks_url":"https://api.github.com/repos/cockroachdb/cockroach/forks","keys_url":"https://api.github.com/repos/cockroachdb/cockroach/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cockroachdb/cockroach/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cockroachdb/cockroach/teams","hooks_url":"https://api.github.com/repos/cockroachdb/cockroach/hooks","issue_events_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/events{/number}","events_url":"https://api.github.com/repos/cockroachdb/cockroach/events","assignees_url":"https://api.github.com/repos/cockroachdb/cockroach/assignees{/user}","branches_url":"https://api.github.com/repos/cockroachdb/cockroach/branches{/branch}","tags_url":"https://api.github.com/repos/cockroachdb/cockroach/tags","blobs_url":"https://api.github.com/repos/cockroachdb/cockroach/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cockroachdb/cockroach/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cockroachdb/cockroach/git/refs{/sha}","trees_url":"https://api.github.com/repos/cockroachdb/cockroach/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cockroachdb/cockroach/statuses/{sha}","languages_url":"https://api.github.com/repos/cockroachdb/cockroach/languages","stargazers_url":"https://api.github.com/repos/cockroachdb/cockroach/stargazers","contributors_url":"https://api.github.com/repos/cockroachdb/cockroach/contributors","subscribers_url":"https://api.github.com/repos/cockroachdb/cockroach/subscribers","subscription_url":"https://api.github.com/repos/cockroachdb/cockroach/subscription","commits_url":"https://api.github.com/repos/cockroachdb/cockroach/commits{/sha}","git_commits_url":"https://api.github.com/repos/cockroachdb/cockroach/git/commits{/sha}","comments_url":"https://api.github.com/repos/cockroachdb/cockroach/comments{/number}","issue_comment_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/comments{/number}","contents_url":"https://api.github.com/repos/cockroachdb/cockroach/contents/{+path}","compare_url":"https://api.github.com/repos/cockroachdb/cockroach/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cockroachdb/cockroach/merges","archive_url":"https://api.github.com/repos/cockroachdb/cockroach/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cockroachdb/cockroach/downloads","issues_url":"https://api.github.com/repos/cockroachdb/cockroach/issues{/number}","pulls_url":"https://api.github.com/repos/cockroachdb/cockroach/pulls{/number}","milestones_url":"https://api.github.com/repos/cockroachdb/cockroach/milestones{/number}","notifications_url":"https://api.github.com/repos/cockroachdb/cockroach/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cockroachdb/cockroach/labels{/name}","releases_url":"https://api.github.com/repos/cockroachdb/cockroach/releases{/id}","created_at":"2014-02-06T00:18:47Z","updated_at":"2015-07-23T15:54:42Z","pushed_at":"2015-07-23T23:30:18Z","git_url":"git://github.com/cockroachdb/cockroach.git","ssh_url":"git@github.com:cockroachdb/cockroach.git","clone_url":"https://github.com/cockroachdb/cockroach.git","svn_url":"https://github.com/cockroachdb/cockroach","homepage":null,"size":42879,"stargazers_count":4920,"watchers_count":4920,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":379,"mirror_url":null,"open_issues_count":109,"forks":379,"open_issues":109,"watchers":4920,"default_branch":"master"}},"base":{"label":"cockroachdb:master","ref":"master","sha":"5f24a94aaf89d0326e4a6ddc274974ed5080a7bc","user":{"login":"cockroachdb","id":6748139,"avatar_url":"https://avatars.githubusercontent.com/u/6748139?v=3","gravatar_id":"","url":"https://api.github.com/users/cockroachdb","html_url":"https://github.com/cockroachdb","followers_url":"https://api.github.com/users/cockroachdb/followers","following_url":"https://api.github.com/users/cockroachdb/following{/other_user}","gists_url":"https://api.github.com/users/cockroachdb/gists{/gist_id}","starred_url":"https://api.github.com/users/cockroachdb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cockroachdb/subscriptions","organizations_url":"https://api.github.com/users/cockroachdb/orgs","repos_url":"https://api.github.com/users/cockroachdb/repos","events_url":"https://api.github.com/users/cockroachdb/events{/privacy}","received_events_url":"https://api.github.com/users/cockroachdb/received_events","type":"Organization","site_admin":false},"repo":{"id":16563587,"name":"cockroach","full_name":"cockroachdb/cockroach","owner":{"login":"cockroachdb","id":6748139,"avatar_url":"https://avatars.githubusercontent.com/u/6748139?v=3","gravatar_id":"","url":"https://api.github.com/users/cockroachdb","html_url":"https://github.com/cockroachdb","followers_url":"https://api.github.com/users/cockroachdb/followers","following_url":"https://api.github.com/users/cockroachdb/following{/other_user}","gists_url":"https://api.github.com/users/cockroachdb/gists{/gist_id}","starred_url":"https://api.github.com/users/cockroachdb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cockroachdb/subscriptions","organizations_url":"https://api.github.com/users/cockroachdb/orgs","repos_url":"https://api.github.com/users/cockroachdb/repos","events_url":"https://api.github.com/users/cockroachdb/events{/privacy}","received_events_url":"https://api.github.com/users/cockroachdb/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cockroachdb/cockroach","description":"A Scalable, Geo-Replicated, Transactional Datastore","fork":false,"url":"https://api.github.com/repos/cockroachdb/cockroach","forks_url":"https://api.github.com/repos/cockroachdb/cockroach/forks","keys_url":"https://api.github.com/repos/cockroachdb/cockroach/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cockroachdb/cockroach/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cockroachdb/cockroach/teams","hooks_url":"https://api.github.com/repos/cockroachdb/cockroach/hooks","issue_events_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/events{/number}","events_url":"https://api.github.com/repos/cockroachdb/cockroach/events","assignees_url":"https://api.github.com/repos/cockroachdb/cockroach/assignees{/user}","branches_url":"https://api.github.com/repos/cockroachdb/cockroach/branches{/branch}","tags_url":"https://api.github.com/repos/cockroachdb/cockroach/tags","blobs_url":"https://api.github.com/repos/cockroachdb/cockroach/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cockroachdb/cockroach/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cockroachdb/cockroach/git/refs{/sha}","trees_url":"https://api.github.com/repos/cockroachdb/cockroach/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cockroachdb/cockroach/statuses/{sha}","languages_url":"https://api.github.com/repos/cockroachdb/cockroach/languages","stargazers_url":"https://api.github.com/repos/cockroachdb/cockroach/stargazers","contributors_url":"https://api.github.com/repos/cockroachdb/cockroach/contributors","subscribers_url":"https://api.github.com/repos/cockroachdb/cockroach/subscribers","subscription_url":"https://api.github.com/repos/cockroachdb/cockroach/subscription","commits_url":"https://api.github.com/repos/cockroachdb/cockroach/commits{/sha}","git_commits_url":"https://api.github.com/repos/cockroachdb/cockroach/git/commits{/sha}","comments_url":"https://api.github.com/repos/cockroachdb/cockroach/comments{/number}","issue_comment_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/comments{/number}","contents_url":"https://api.github.com/repos/cockroachdb/cockroach/contents/{+path}","compare_url":"https://api.github.com/repos/cockroachdb/cockroach/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cockroachdb/cockroach/merges","archive_url":"https://api.github.com/repos/cockroachdb/cockroach/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cockroachdb/cockroach/downloads","issues_url":"https://api.github.com/repos/cockroachdb/cockroach/issues{/number}","pulls_url":"https://api.github.com/repos/cockroachdb/cockroach/pulls{/number}","milestones_url":"https://api.github.com/repos/cockroachdb/cockroach/milestones{/number}","notifications_url":"https://api.github.com/repos/cockroachdb/cockroach/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cockroachdb/cockroach/labels{/name}","releases_url":"https://api.github.com/repos/cockroachdb/cockroach/releases{/id}","created_at":"2014-02-06T00:18:47Z","updated_at":"2015-07-23T15:54:42Z","pushed_at":"2015-07-23T23:30:18Z","git_url":"git://github.com/cockroachdb/cockroach.git","ssh_url":"git@github.com:cockroachdb/cockroach.git","clone_url":"https://github.com/cockroachdb/cockroach.git","svn_url":"https://github.com/cockroachdb/cockroach","homepage":null,"size":42879,"stargazers_count":4920,"watchers_count":4920,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":379,"mirror_url":null,"open_issues_count":109,"forks":379,"open_issues":109,"watchers":4920,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cockroachdb/cockroach/pulls/1792"},"html":{"href":"https://github.com/cockroachdb/cockroach/pull/1792"},"issue":{"href":"https://api.github.com/repos/cockroachdb/cockroach/issues/1792"},"comments":{"href":"https://api.github.com/repos/cockroachdb/cockroach/issues/1792/comments"},"review_comments":{"href":"https://api.github.com/repos/cockroachdb/cockroach/pulls/1792/comments"},"review_comment":{"href":"https://api.github.com/repos/cockroachdb/cockroach/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cockroachdb/cockroach/pulls/1792/commits"},"statuses":{"href":"https://api.github.com/repos/cockroachdb/cockroach/statuses/f092fdb6401672e9f6c7e699895fc49d6b0942f2"}}}}