{"action":"created","comment":{"url":"https://api.github.com/repos/Yelp/fullerite/pulls/comments/57757543","id":57757543,"diff_hunk":"@@ -216,11 +224,27 @@ func (n *nerveUWSGICollector) parseNerveConfig(raw *[]byte, ips []string) (map[i\n \treturn results, nil\n }\n \n-// parseUWSGIMetrics takes the json returned from the endpoint and converts\n+// parseDefault is the fallback parser if no 'Metrics-Schema' is provided in the\n+// response header from a service query\n+func parseDefault(raw *[]byte) ([]metric.Metric, error) {\n+\tresults, err := parseUWSGIMetrics_1_0(raw)\n+\tif err != nil {\n+\t\treturn results, err\n+\t}\n+\n+\tif len(results) == 0 {\n+\t\t// If parsing using UWSGI format did not work, the output is probably\n+\t\t// in Dropwizard format and should be handled as such.\n+\t\treturn parseDropwizardMetric(raw)\n+\t}\n+\treturn results, nil\n+}\n+\n+// parseUWSGIMetrics_1_0 takes the json returned from the endpoint and converts\n // it into raw metrics. We first check that the metrics returned have a float value\n // otherwise we skip the metric.\n-func parseUWSGIMetrics(raw *[]byte) ([]metric.Metric, error) {\n-\tparsed := new(uwsgiJSONFormat)\n+func parseUWSGIMetrics_1_0(raw *[]byte) ([]metric.Metric, error) {","path":"src/fullerite/collector/nerve_uwsgi.go","position":79,"original_position":79,"commit_id":"23c5d8648d225c5123bf06f2e42cc7e5768cbca1","original_commit_id":"23c5d8648d225c5123bf06f2e42cc7e5768cbca1","user":{"login":"tiras-j","id":6816898,"avatar_url":"https://avatars.githubusercontent.com/u/6816898?v=3","gravatar_id":"","url":"https://api.github.com/users/tiras-j","html_url":"https://github.com/tiras-j","followers_url":"https://api.github.com/users/tiras-j/followers","following_url":"https://api.github.com/users/tiras-j/following{/other_user}","gists_url":"https://api.github.com/users/tiras-j/gists{/gist_id}","starred_url":"https://api.github.com/users/tiras-j/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tiras-j/subscriptions","organizations_url":"https://api.github.com/users/tiras-j/orgs","repos_url":"https://api.github.com/users/tiras-j/repos","events_url":"https://api.github.com/users/tiras-j/events{/privacy}","received_events_url":"https://api.github.com/users/tiras-j/received_events","type":"User","site_admin":false},"body":"Agreed. I forgot about Go's feelings about underscores, I'll update it. ","created_at":"2016-03-29T16:48:45Z","updated_at":"2016-03-29T16:48:45Z","html_url":"https://github.com/Yelp/fullerite/pull/215#discussion_r57757543","pull_request_url":"https://api.github.com/repos/Yelp/fullerite/pulls/215","_links":{"self":{"href":"https://api.github.com/repos/Yelp/fullerite/pulls/comments/57757543"},"html":{"href":"https://github.com/Yelp/fullerite/pull/215#discussion_r57757543"},"pull_request":{"href":"https://api.github.com/repos/Yelp/fullerite/pulls/215"}}},"pull_request":{"url":"https://api.github.com/repos/Yelp/fullerite/pulls/215","id":64397719,"html_url":"https://github.com/Yelp/fullerite/pull/215","diff_url":"https://github.com/Yelp/fullerite/pull/215.diff","patch_url":"https://github.com/Yelp/fullerite/pull/215.patch","issue_url":"https://api.github.com/repos/Yelp/fullerite/issues/215","number":215,"state":"open","locked":false,"title":"Add schema based parsing of UWSGI metrics","user":{"login":"tiras-j","id":6816898,"avatar_url":"https://avatars.githubusercontent.com/u/6816898?v=3","gravatar_id":"","url":"https://api.github.com/users/tiras-j","html_url":"https://github.com/tiras-j","followers_url":"https://api.github.com/users/tiras-j/followers","following_url":"https://api.github.com/users/tiras-j/following{/other_user}","gists_url":"https://api.github.com/users/tiras-j/gists{/gist_id}","starred_url":"https://api.github.com/users/tiras-j/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tiras-j/subscriptions","organizations_url":"https://api.github.com/users/tiras-j/orgs","repos_url":"https://api.github.com/users/tiras-j/repos","events_url":"https://api.github.com/users/tiras-j/events{/privacy}","received_events_url":"https://api.github.com/users/tiras-j/received_events","type":"User","site_admin":false},"body":"First stab at schema based parsing of UWSGI metrics now that we're adding service level dimensions. Ideally this would be driven more by configuration files or some other pluggable schema parser, but for now I think it's a suitable simple alternative. \r\n\r\n@gnufied let me know what you think.","created_at":"2016-03-29T00:35:30Z","updated_at":"2016-03-29T16:48:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d6c6109ae2cd9f3d529ce960435d253a2b8cf837","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Yelp/fullerite/pulls/215/commits","review_comments_url":"https://api.github.com/repos/Yelp/fullerite/pulls/215/comments","review_comment_url":"https://api.github.com/repos/Yelp/fullerite/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Yelp/fullerite/issues/215/comments","statuses_url":"https://api.github.com/repos/Yelp/fullerite/statuses/23c5d8648d225c5123bf06f2e42cc7e5768cbca1","head":{"label":"tiras-j:master","ref":"master","sha":"23c5d8648d225c5123bf06f2e42cc7e5768cbca1","user":{"login":"tiras-j","id":6816898,"avatar_url":"https://avatars.githubusercontent.com/u/6816898?v=3","gravatar_id":"","url":"https://api.github.com/users/tiras-j","html_url":"https://github.com/tiras-j","followers_url":"https://api.github.com/users/tiras-j/followers","following_url":"https://api.github.com/users/tiras-j/following{/other_user}","gists_url":"https://api.github.com/users/tiras-j/gists{/gist_id}","starred_url":"https://api.github.com/users/tiras-j/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tiras-j/subscriptions","organizations_url":"https://api.github.com/users/tiras-j/orgs","repos_url":"https://api.github.com/users/tiras-j/repos","events_url":"https://api.github.com/users/tiras-j/events{/privacy}","received_events_url":"https://api.github.com/users/tiras-j/received_events","type":"User","site_admin":false},"repo":{"id":48260580,"name":"fullerite","full_name":"tiras-j/fullerite","owner":{"login":"tiras-j","id":6816898,"avatar_url":"https://avatars.githubusercontent.com/u/6816898?v=3","gravatar_id":"","url":"https://api.github.com/users/tiras-j","html_url":"https://github.com/tiras-j","followers_url":"https://api.github.com/users/tiras-j/followers","following_url":"https://api.github.com/users/tiras-j/following{/other_user}","gists_url":"https://api.github.com/users/tiras-j/gists{/gist_id}","starred_url":"https://api.github.com/users/tiras-j/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tiras-j/subscriptions","organizations_url":"https://api.github.com/users/tiras-j/orgs","repos_url":"https://api.github.com/users/tiras-j/repos","events_url":"https://api.github.com/users/tiras-j/events{/privacy}","received_events_url":"https://api.github.com/users/tiras-j/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tiras-j/fullerite","description":"Fullerite is a daemon which collect metrics periodically from various sources and sends them to different metric stores","fork":true,"url":"https://api.github.com/repos/tiras-j/fullerite","forks_url":"https://api.github.com/repos/tiras-j/fullerite/forks","keys_url":"https://api.github.com/repos/tiras-j/fullerite/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tiras-j/fullerite/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tiras-j/fullerite/teams","hooks_url":"https://api.github.com/repos/tiras-j/fullerite/hooks","issue_events_url":"https://api.github.com/repos/tiras-j/fullerite/issues/events{/number}","events_url":"https://api.github.com/repos/tiras-j/fullerite/events","assignees_url":"https://api.github.com/repos/tiras-j/fullerite/assignees{/user}","branches_url":"https://api.github.com/repos/tiras-j/fullerite/branches{/branch}","tags_url":"https://api.github.com/repos/tiras-j/fullerite/tags","blobs_url":"https://api.github.com/repos/tiras-j/fullerite/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tiras-j/fullerite/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tiras-j/fullerite/git/refs{/sha}","trees_url":"https://api.github.com/repos/tiras-j/fullerite/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tiras-j/fullerite/statuses/{sha}","languages_url":"https://api.github.com/repos/tiras-j/fullerite/languages","stargazers_url":"https://api.github.com/repos/tiras-j/fullerite/stargazers","contributors_url":"https://api.github.com/repos/tiras-j/fullerite/contributors","subscribers_url":"https://api.github.com/repos/tiras-j/fullerite/subscribers","subscription_url":"https://api.github.com/repos/tiras-j/fullerite/subscription","commits_url":"https://api.github.com/repos/tiras-j/fullerite/commits{/sha}","git_commits_url":"https://api.github.com/repos/tiras-j/fullerite/git/commits{/sha}","comments_url":"https://api.github.com/repos/tiras-j/fullerite/comments{/number}","issue_comment_url":"https://api.github.com/repos/tiras-j/fullerite/issues/comments{/number}","contents_url":"https://api.github.com/repos/tiras-j/fullerite/contents/{+path}","compare_url":"https://api.github.com/repos/tiras-j/fullerite/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tiras-j/fullerite/merges","archive_url":"https://api.github.com/repos/tiras-j/fullerite/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tiras-j/fullerite/downloads","issues_url":"https://api.github.com/repos/tiras-j/fullerite/issues{/number}","pulls_url":"https://api.github.com/repos/tiras-j/fullerite/pulls{/number}","milestones_url":"https://api.github.com/repos/tiras-j/fullerite/milestones{/number}","notifications_url":"https://api.github.com/repos/tiras-j/fullerite/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tiras-j/fullerite/labels{/name}","releases_url":"https://api.github.com/repos/tiras-j/fullerite/releases{/id}","deployments_url":"https://api.github.com/repos/tiras-j/fullerite/deployments","created_at":"2015-12-18T23:10:59Z","updated_at":"2016-02-11T17:52:45Z","pushed_at":"2016-03-29T00:28:43Z","git_url":"git://github.com/tiras-j/fullerite.git","ssh_url":"git@github.com:tiras-j/fullerite.git","clone_url":"https://github.com/tiras-j/fullerite.git","svn_url":"https://github.com/tiras-j/fullerite","homepage":"","size":7540,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Yelp:master","ref":"master","sha":"7bf7cd8da66fb187a5a67692ab7add3909dc1a2c","user":{"login":"Yelp","id":49071,"avatar_url":"https://avatars.githubusercontent.com/u/49071?v=3","gravatar_id":"","url":"https://api.github.com/users/Yelp","html_url":"https://github.com/Yelp","followers_url":"https://api.github.com/users/Yelp/followers","following_url":"https://api.github.com/users/Yelp/following{/other_user}","gists_url":"https://api.github.com/users/Yelp/gists{/gist_id}","starred_url":"https://api.github.com/users/Yelp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yelp/subscriptions","organizations_url":"https://api.github.com/users/Yelp/orgs","repos_url":"https://api.github.com/users/Yelp/repos","events_url":"https://api.github.com/users/Yelp/events{/privacy}","received_events_url":"https://api.github.com/users/Yelp/received_events","type":"Organization","site_admin":false},"repo":{"id":39368384,"name":"fullerite","full_name":"Yelp/fullerite","owner":{"login":"Yelp","id":49071,"avatar_url":"https://avatars.githubusercontent.com/u/49071?v=3","gravatar_id":"","url":"https://api.github.com/users/Yelp","html_url":"https://github.com/Yelp","followers_url":"https://api.github.com/users/Yelp/followers","following_url":"https://api.github.com/users/Yelp/following{/other_user}","gists_url":"https://api.github.com/users/Yelp/gists{/gist_id}","starred_url":"https://api.github.com/users/Yelp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yelp/subscriptions","organizations_url":"https://api.github.com/users/Yelp/orgs","repos_url":"https://api.github.com/users/Yelp/repos","events_url":"https://api.github.com/users/Yelp/events{/privacy}","received_events_url":"https://api.github.com/users/Yelp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Yelp/fullerite","description":"Fullerite is a daemon which collect metrics periodically from various sources and sends them to different metric stores","fork":false,"url":"https://api.github.com/repos/Yelp/fullerite","forks_url":"https://api.github.com/repos/Yelp/fullerite/forks","keys_url":"https://api.github.com/repos/Yelp/fullerite/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Yelp/fullerite/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Yelp/fullerite/teams","hooks_url":"https://api.github.com/repos/Yelp/fullerite/hooks","issue_events_url":"https://api.github.com/repos/Yelp/fullerite/issues/events{/number}","events_url":"https://api.github.com/repos/Yelp/fullerite/events","assignees_url":"https://api.github.com/repos/Yelp/fullerite/assignees{/user}","branches_url":"https://api.github.com/repos/Yelp/fullerite/branches{/branch}","tags_url":"https://api.github.com/repos/Yelp/fullerite/tags","blobs_url":"https://api.github.com/repos/Yelp/fullerite/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Yelp/fullerite/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Yelp/fullerite/git/refs{/sha}","trees_url":"https://api.github.com/repos/Yelp/fullerite/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Yelp/fullerite/statuses/{sha}","languages_url":"https://api.github.com/repos/Yelp/fullerite/languages","stargazers_url":"https://api.github.com/repos/Yelp/fullerite/stargazers","contributors_url":"https://api.github.com/repos/Yelp/fullerite/contributors","subscribers_url":"https://api.github.com/repos/Yelp/fullerite/subscribers","subscription_url":"https://api.github.com/repos/Yelp/fullerite/subscription","commits_url":"https://api.github.com/repos/Yelp/fullerite/commits{/sha}","git_commits_url":"https://api.github.com/repos/Yelp/fullerite/git/commits{/sha}","comments_url":"https://api.github.com/repos/Yelp/fullerite/comments{/number}","issue_comment_url":"https://api.github.com/repos/Yelp/fullerite/issues/comments{/number}","contents_url":"https://api.github.com/repos/Yelp/fullerite/contents/{+path}","compare_url":"https://api.github.com/repos/Yelp/fullerite/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Yelp/fullerite/merges","archive_url":"https://api.github.com/repos/Yelp/fullerite/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Yelp/fullerite/downloads","issues_url":"https://api.github.com/repos/Yelp/fullerite/issues{/number}","pulls_url":"https://api.github.com/repos/Yelp/fullerite/pulls{/number}","milestones_url":"https://api.github.com/repos/Yelp/fullerite/milestones{/number}","notifications_url":"https://api.github.com/repos/Yelp/fullerite/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Yelp/fullerite/labels{/name}","releases_url":"https://api.github.com/repos/Yelp/fullerite/releases{/id}","deployments_url":"https://api.github.com/repos/Yelp/fullerite/deployments","created_at":"2015-07-20T07:01:49Z","updated_at":"2016-03-10T17:37:02Z","pushed_at":"2016-03-29T16:27:29Z","git_url":"git://github.com/Yelp/fullerite.git","ssh_url":"git@github.com:Yelp/fullerite.git","clone_url":"https://github.com/Yelp/fullerite.git","svn_url":"https://github.com/Yelp/fullerite","homepage":"","size":7614,"stargazers_count":118,"watchers_count":118,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":25,"mirror_url":null,"open_issues_count":19,"forks":25,"open_issues":19,"watchers":118,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Yelp/fullerite/pulls/215"},"html":{"href":"https://github.com/Yelp/fullerite/pull/215"},"issue":{"href":"https://api.github.com/repos/Yelp/fullerite/issues/215"},"comments":{"href":"https://api.github.com/repos/Yelp/fullerite/issues/215/comments"},"review_comments":{"href":"https://api.github.com/repos/Yelp/fullerite/pulls/215/comments"},"review_comment":{"href":"https://api.github.com/repos/Yelp/fullerite/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Yelp/fullerite/pulls/215/commits"},"statuses":{"href":"https://api.github.com/repos/Yelp/fullerite/statuses/23c5d8648d225c5123bf06f2e42cc7e5768cbca1"}}}}