{"action":"created","comment":{"url":"https://api.github.com/repos/istio/istio/pulls/comments/201418406","pull_request_review_id":135915917,"id":201418406,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwMTQxODQwNg==","diff_hunk":"@@ -15,15 +15,76 @@\n package signalfx\n \n import (\n-\t\"errors\"\n+\t\"context\"\n \t\"time\"\n \n+\tme \"github.com/hashicorp/go-multierror\"\n+\t\"github.com/signalfx/golib/errors\"\n+\t\"github.com/signalfx/golib/sfxclient\"\n+\n \t\"istio.io/istio/mixer/adapter/signalfx/config\"\n \t\"istio.io/istio/mixer/pkg/adapter\"\n \t\"istio.io/istio/mixer/template/metric\"\n )\n \n-func (h *handler) processMetric(conf *config.Params_MetricConfig, inst *metric.Instance) error {\n+// How long time series continue reporting from the registry since their last\n+// update.\n+const registryExpiry = 5 * time.Minute\n+\n+type metricshandler struct {\n+\tenv                adapter.Env\n+\tctx                context.Context\n+\tscheduler          *sfxclient.Scheduler\n+\tsink               *sfxclient.HTTPSink\n+\tregistry           *registry\n+\tmetricTypes        map[string]*metric.Type\n+\tintervalSeconds    uint32\n+\tmetricConfigByName map[string]*config.Params_MetricConfig\n+}\n+\n+func (mh *metricshandler) InitMetrics() error {\n+\tmh.scheduler = sfxclient.NewScheduler()\n+\tmh.scheduler.Sink = mh.sink\n+\tmh.scheduler.ReportingDelay(time.Duration(mh.intervalSeconds) * time.Second)\n+\n+\tmh.scheduler.ErrorHandler = func(err error) error {\n+\t\treturn mh.env.Logger().Errorf(\"Error sending datapoints: %s\", err.Error())","path":"mixer/adapter/signalfx/metrics.go","position":39,"original_position":39,"commit_id":"801edb24ea555fa02d276acde647dc08cb864b0a","original_commit_id":"801edb24ea555fa02d276acde647dc08cb864b0a","user":{"login":"geeknoid","id":22780957,"node_id":"MDQ6VXNlcjIyNzgwOTU3","avatar_url":"https://avatars3.githubusercontent.com/u/22780957?v=4","gravatar_id":"","url":"https://api.github.com/users/geeknoid","html_url":"https://github.com/geeknoid","followers_url":"https://api.github.com/users/geeknoid/followers","following_url":"https://api.github.com/users/geeknoid/following{/other_user}","gists_url":"https://api.github.com/users/geeknoid/gists{/gist_id}","starred_url":"https://api.github.com/users/geeknoid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geeknoid/subscriptions","organizations_url":"https://api.github.com/users/geeknoid/orgs","repos_url":"https://api.github.com/users/geeknoid/repos","events_url":"https://api.github.com/users/geeknoid/events{/privacy}","received_events_url":"https://api.github.com/users/geeknoid/received_events","type":"User","site_admin":false},"body":"Use %v instead of %s, and just pass \"err\" instead of \"err.Error()\"","created_at":"2018-07-10T16:55:09Z","updated_at":"2018-07-10T16:59:29Z","html_url":"https://github.com/istio/istio/pull/6669#discussion_r201418406","pull_request_url":"https://api.github.com/repos/istio/istio/pulls/6669","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/istio/istio/pulls/comments/201418406"},"html":{"href":"https://github.com/istio/istio/pull/6669#discussion_r201418406"},"pull_request":{"href":"https://api.github.com/repos/istio/istio/pulls/6669"}}},"pull_request":{"url":"https://api.github.com/repos/istio/istio/pulls/6669","id":197797280,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk3Nzk3Mjgw","html_url":"https://github.com/istio/istio/pull/6669","diff_url":"https://github.com/istio/istio/pull/6669.diff","patch_url":"https://github.com/istio/istio/pull/6669.patch","issue_url":"https://api.github.com/repos/istio/istio/issues/6669","number":6669,"state":"open","locked":false,"title":"SignalFx TraceSpan Support","user":{"login":"keitwb","id":614344,"node_id":"MDQ6VXNlcjYxNDM0NA==","avatar_url":"https://avatars2.githubusercontent.com/u/614344?v=4","gravatar_id":"","url":"https://api.github.com/users/keitwb","html_url":"https://github.com/keitwb","followers_url":"https://api.github.com/users/keitwb/followers","following_url":"https://api.github.com/users/keitwb/following{/other_user}","gists_url":"https://api.github.com/users/keitwb/gists{/gist_id}","starred_url":"https://api.github.com/users/keitwb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keitwb/subscriptions","organizations_url":"https://api.github.com/users/keitwb/orgs","repos_url":"https://api.github.com/users/keitwb/repos","events_url":"https://api.github.com/users/keitwb/events{/privacy}","received_events_url":"https://api.github.com/users/keitwb/received_events","type":"User","site_admin":false},"body":"This involved rearranging the existing metric code to accommodate tracing.","created_at":"2018-06-27T17:09:06Z","updated_at":"2018-07-10T16:59:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7a01ee9c07730f1bc09068de640ad34eaeba4017","assignee":{"login":"geeknoid","id":22780957,"node_id":"MDQ6VXNlcjIyNzgwOTU3","avatar_url":"https://avatars3.githubusercontent.com/u/22780957?v=4","gravatar_id":"","url":"https://api.github.com/users/geeknoid","html_url":"https://github.com/geeknoid","followers_url":"https://api.github.com/users/geeknoid/followers","following_url":"https://api.github.com/users/geeknoid/following{/other_user}","gists_url":"https://api.github.com/users/geeknoid/gists{/gist_id}","starred_url":"https://api.github.com/users/geeknoid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geeknoid/subscriptions","organizations_url":"https://api.github.com/users/geeknoid/orgs","repos_url":"https://api.github.com/users/geeknoid/repos","events_url":"https://api.github.com/users/geeknoid/events{/privacy}","received_events_url":"https://api.github.com/users/geeknoid/received_events","type":"User","site_admin":false},"assignees":[{"login":"geeknoid","id":22780957,"node_id":"MDQ6VXNlcjIyNzgwOTU3","avatar_url":"https://avatars3.githubusercontent.com/u/22780957?v=4","gravatar_id":"","url":"https://api.github.com/users/geeknoid","html_url":"https://github.com/geeknoid","followers_url":"https://api.github.com/users/geeknoid/followers","following_url":"https://api.github.com/users/geeknoid/following{/other_user}","gists_url":"https://api.github.com/users/geeknoid/gists{/gist_id}","starred_url":"https://api.github.com/users/geeknoid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geeknoid/subscriptions","organizations_url":"https://api.github.com/users/geeknoid/orgs","repos_url":"https://api.github.com/users/geeknoid/repos","events_url":"https://api.github.com/users/geeknoid/events{/privacy}","received_events_url":"https://api.github.com/users/geeknoid/received_events","type":"User","site_admin":false}],"requested_reviewers":[{"login":"guptasu","id":11448595,"node_id":"MDQ6VXNlcjExNDQ4NTk1","avatar_url":"https://avatars3.githubusercontent.com/u/11448595?v=4","gravatar_id":"","url":"https://api.github.com/users/guptasu","html_url":"https://github.com/guptasu","followers_url":"https://api.github.com/users/guptasu/followers","following_url":"https://api.github.com/users/guptasu/following{/other_user}","gists_url":"https://api.github.com/users/guptasu/gists{/gist_id}","starred_url":"https://api.github.com/users/guptasu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guptasu/subscriptions","organizations_url":"https://api.github.com/users/guptasu/orgs","repos_url":"https://api.github.com/users/guptasu/repos","events_url":"https://api.github.com/users/guptasu/events{/privacy}","received_events_url":"https://api.github.com/users/guptasu/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":491318011,"node_id":"MDU6TGFiZWw0OTEzMTgwMTE=","url":"https://api.github.com/repos/istio/istio/labels/cla:%20yes","name":"cla: yes","color":"bfdadc","default":false},{"id":644159920,"node_id":"MDU6TGFiZWw2NDQxNTk5MjA=","url":"https://api.github.com/repos/istio/istio/labels/needs-ok-to-test","name":"needs-ok-to-test","color":"bfdadc","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/istio/istio/pulls/6669/commits","review_comments_url":"https://api.github.com/repos/istio/istio/pulls/6669/comments","review_comment_url":"https://api.github.com/repos/istio/istio/pulls/comments{/number}","comments_url":"https://api.github.com/repos/istio/istio/issues/6669/comments","statuses_url":"https://api.github.com/repos/istio/istio/statuses/801edb24ea555fa02d276acde647dc08cb864b0a","head":{"label":"signalfx:signalfx-tracing","ref":"signalfx-tracing","sha":"801edb24ea555fa02d276acde647dc08cb864b0a","user":{"login":"signalfx","id":8184587,"node_id":"MDEyOk9yZ2FuaXphdGlvbjgxODQ1ODc=","avatar_url":"https://avatars0.githubusercontent.com/u/8184587?v=4","gravatar_id":"","url":"https://api.github.com/users/signalfx","html_url":"https://github.com/signalfx","followers_url":"https://api.github.com/users/signalfx/followers","following_url":"https://api.github.com/users/signalfx/following{/other_user}","gists_url":"https://api.github.com/users/signalfx/gists{/gist_id}","starred_url":"https://api.github.com/users/signalfx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/signalfx/subscriptions","organizations_url":"https://api.github.com/users/signalfx/orgs","repos_url":"https://api.github.com/users/signalfx/repos","events_url":"https://api.github.com/users/signalfx/events{/privacy}","received_events_url":"https://api.github.com/users/signalfx/received_events","type":"Organization","site_admin":false},"repo":{"id":137084474,"node_id":"MDEwOlJlcG9zaXRvcnkxMzcwODQ0NzQ=","name":"istio","full_name":"signalfx/istio","owner":{"login":"signalfx","id":8184587,"node_id":"MDEyOk9yZ2FuaXphdGlvbjgxODQ1ODc=","avatar_url":"https://avatars0.githubusercontent.com/u/8184587?v=4","gravatar_id":"","url":"https://api.github.com/users/signalfx","html_url":"https://github.com/signalfx","followers_url":"https://api.github.com/users/signalfx/followers","following_url":"https://api.github.com/users/signalfx/following{/other_user}","gists_url":"https://api.github.com/users/signalfx/gists{/gist_id}","starred_url":"https://api.github.com/users/signalfx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/signalfx/subscriptions","organizations_url":"https://api.github.com/users/signalfx/orgs","repos_url":"https://api.github.com/users/signalfx/repos","events_url":"https://api.github.com/users/signalfx/events{/privacy}","received_events_url":"https://api.github.com/users/signalfx/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/signalfx/istio","description":"An open platform to connect, manage, and secure microservices.","fork":true,"url":"https://api.github.com/repos/signalfx/istio","forks_url":"https://api.github.com/repos/signalfx/istio/forks","keys_url":"https://api.github.com/repos/signalfx/istio/keys{/key_id}","collaborators_url":"https://api.github.com/repos/signalfx/istio/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/signalfx/istio/teams","hooks_url":"https://api.github.com/repos/signalfx/istio/hooks","issue_events_url":"https://api.github.com/repos/signalfx/istio/issues/events{/number}","events_url":"https://api.github.com/repos/signalfx/istio/events","assignees_url":"https://api.github.com/repos/signalfx/istio/assignees{/user}","branches_url":"https://api.github.com/repos/signalfx/istio/branches{/branch}","tags_url":"https://api.github.com/repos/signalfx/istio/tags","blobs_url":"https://api.github.com/repos/signalfx/istio/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/signalfx/istio/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/signalfx/istio/git/refs{/sha}","trees_url":"https://api.github.com/repos/signalfx/istio/git/trees{/sha}","statuses_url":"https://api.github.com/repos/signalfx/istio/statuses/{sha}","languages_url":"https://api.github.com/repos/signalfx/istio/languages","stargazers_url":"https://api.github.com/repos/signalfx/istio/stargazers","contributors_url":"https://api.github.com/repos/signalfx/istio/contributors","subscribers_url":"https://api.github.com/repos/signalfx/istio/subscribers","subscription_url":"https://api.github.com/repos/signalfx/istio/subscription","commits_url":"https://api.github.com/repos/signalfx/istio/commits{/sha}","git_commits_url":"https://api.github.com/repos/signalfx/istio/git/commits{/sha}","comments_url":"https://api.github.com/repos/signalfx/istio/comments{/number}","issue_comment_url":"https://api.github.com/repos/signalfx/istio/issues/comments{/number}","contents_url":"https://api.github.com/repos/signalfx/istio/contents/{+path}","compare_url":"https://api.github.com/repos/signalfx/istio/compare/{base}...{head}","merges_url":"https://api.github.com/repos/signalfx/istio/merges","archive_url":"https://api.github.com/repos/signalfx/istio/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/signalfx/istio/downloads","issues_url":"https://api.github.com/repos/signalfx/istio/issues{/number}","pulls_url":"https://api.github.com/repos/signalfx/istio/pulls{/number}","milestones_url":"https://api.github.com/repos/signalfx/istio/milestones{/number}","notifications_url":"https://api.github.com/repos/signalfx/istio/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/signalfx/istio/labels{/name}","releases_url":"https://api.github.com/repos/signalfx/istio/releases{/id}","deployments_url":"https://api.github.com/repos/signalfx/istio/deployments","created_at":"2018-06-12T14:33:49Z","updated_at":"2018-06-12T14:33:56Z","pushed_at":"2018-07-06T15:29:13Z","git_url":"git://github.com/signalfx/istio.git","ssh_url":"git@github.com:signalfx/istio.git","clone_url":"https://github.com/signalfx/istio.git","svn_url":"https://github.com/signalfx/istio","homepage":"https://istio.io","size":40779,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"istio:master","ref":"master","sha":"865e90e3f95066054a2e2cfe9f247e53eeaf6184","user":{"login":"istio","id":23534644,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIzNTM0NjQ0","avatar_url":"https://avatars1.githubusercontent.com/u/23534644?v=4","gravatar_id":"","url":"https://api.github.com/users/istio","html_url":"https://github.com/istio","followers_url":"https://api.github.com/users/istio/followers","following_url":"https://api.github.com/users/istio/following{/other_user}","gists_url":"https://api.github.com/users/istio/gists{/gist_id}","starred_url":"https://api.github.com/users/istio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/istio/subscriptions","organizations_url":"https://api.github.com/users/istio/orgs","repos_url":"https://api.github.com/users/istio/repos","events_url":"https://api.github.com/users/istio/events{/privacy}","received_events_url":"https://api.github.com/users/istio/received_events","type":"Organization","site_admin":false},"repo":{"id":74175805,"node_id":"MDEwOlJlcG9zaXRvcnk3NDE3NTgwNQ==","name":"istio","full_name":"istio/istio","owner":{"login":"istio","id":23534644,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIzNTM0NjQ0","avatar_url":"https://avatars1.githubusercontent.com/u/23534644?v=4","gravatar_id":"","url":"https://api.github.com/users/istio","html_url":"https://github.com/istio","followers_url":"https://api.github.com/users/istio/followers","following_url":"https://api.github.com/users/istio/following{/other_user}","gists_url":"https://api.github.com/users/istio/gists{/gist_id}","starred_url":"https://api.github.com/users/istio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/istio/subscriptions","organizations_url":"https://api.github.com/users/istio/orgs","repos_url":"https://api.github.com/users/istio/repos","events_url":"https://api.github.com/users/istio/events{/privacy}","received_events_url":"https://api.github.com/users/istio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/istio/istio","description":"An open platform to connect, manage, and secure microservices.","fork":false,"url":"https://api.github.com/repos/istio/istio","forks_url":"https://api.github.com/repos/istio/istio/forks","keys_url":"https://api.github.com/repos/istio/istio/keys{/key_id}","collaborators_url":"https://api.github.com/repos/istio/istio/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/istio/istio/teams","hooks_url":"https://api.github.com/repos/istio/istio/hooks","issue_events_url":"https://api.github.com/repos/istio/istio/issues/events{/number}","events_url":"https://api.github.com/repos/istio/istio/events","assignees_url":"https://api.github.com/repos/istio/istio/assignees{/user}","branches_url":"https://api.github.com/repos/istio/istio/branches{/branch}","tags_url":"https://api.github.com/repos/istio/istio/tags","blobs_url":"https://api.github.com/repos/istio/istio/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/istio/istio/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/istio/istio/git/refs{/sha}","trees_url":"https://api.github.com/repos/istio/istio/git/trees{/sha}","statuses_url":"https://api.github.com/repos/istio/istio/statuses/{sha}","languages_url":"https://api.github.com/repos/istio/istio/languages","stargazers_url":"https://api.github.com/repos/istio/istio/stargazers","contributors_url":"https://api.github.com/repos/istio/istio/contributors","subscribers_url":"https://api.github.com/repos/istio/istio/subscribers","subscription_url":"https://api.github.com/repos/istio/istio/subscription","commits_url":"https://api.github.com/repos/istio/istio/commits{/sha}","git_commits_url":"https://api.github.com/repos/istio/istio/git/commits{/sha}","comments_url":"https://api.github.com/repos/istio/istio/comments{/number}","issue_comment_url":"https://api.github.com/repos/istio/istio/issues/comments{/number}","contents_url":"https://api.github.com/repos/istio/istio/contents/{+path}","compare_url":"https://api.github.com/repos/istio/istio/compare/{base}...{head}","merges_url":"https://api.github.com/repos/istio/istio/merges","archive_url":"https://api.github.com/repos/istio/istio/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/istio/istio/downloads","issues_url":"https://api.github.com/repos/istio/istio/issues{/number}","pulls_url":"https://api.github.com/repos/istio/istio/pulls{/number}","milestones_url":"https://api.github.com/repos/istio/istio/milestones{/number}","notifications_url":"https://api.github.com/repos/istio/istio/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/istio/istio/labels{/name}","releases_url":"https://api.github.com/repos/istio/istio/releases{/id}","deployments_url":"https://api.github.com/repos/istio/istio/deployments","created_at":"2016-11-18T23:57:21Z","updated_at":"2018-07-10T16:47:01Z","pushed_at":"2018-07-10T16:52:45Z","git_url":"git://github.com/istio/istio.git","ssh_url":"git@github.com:istio/istio.git","clone_url":"https://github.com/istio/istio.git","svn_url":"https://github.com/istio/istio","homepage":"https://istio.io","size":41099,"stargazers_count":9211,"watchers_count":9211,"language":"Go","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1287,"mirror_url":null,"archived":false,"open_issues_count":803,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":1287,"open_issues":803,"watchers":9211,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/istio/istio/pulls/6669"},"html":{"href":"https://github.com/istio/istio/pull/6669"},"issue":{"href":"https://api.github.com/repos/istio/istio/issues/6669"},"comments":{"href":"https://api.github.com/repos/istio/istio/issues/6669/comments"},"review_comments":{"href":"https://api.github.com/repos/istio/istio/pulls/6669/comments"},"review_comment":{"href":"https://api.github.com/repos/istio/istio/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/istio/istio/pulls/6669/commits"},"statuses":{"href":"https://api.github.com/repos/istio/istio/statuses/801edb24ea555fa02d276acde647dc08cb864b0a"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"geeknoid"}}