{"action":"created","comment":{"url":"https://api.github.com/repos/dcos/telegraf/pulls/comments/238003534","pull_request_review_id":180450874,"id":238003534,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzODAwMzUzNA==","diff_hunk":"@@ -136,6 +136,22 @@ func (dc *DCOSContainers) getContainers(ctx context.Context, cli calls.Sender) (\n \treturn gc, nil\n }\n \n+type roundTripper struct {\n+\tr         http.RoundTripper\n+\tuserAgent string\n+}\n+\n+var defaultUserAgent = \"telegraf-dcos-containers\"\n+\n+// RoundTrip is an implementation of the RoundTripper interface.\n+func (rt roundTripper) RoundTrip(req *http.Request) (*http.Response, error) {\n+\treq.Header.Set(\"User-Agent\", defaultUserAgent)\n+\tif rt.userAgent != \"\" {\n+\t\treq.Header.Set(\"User-Agent\", rt.userAgent)\n+\t}\n+\treturn rt.r.RoundTrip(req)\n+}","path":"plugins/inputs/dcos_containers/dcos_containers.go","position":null,"original_position":18,"commit_id":"391913bb31b397736102d7b777fed0b1f238a7bb","original_commit_id":"29939bb73246eb7a3d05698cbea11b51708cdd0b","user":{"login":"gracedo","id":5897740,"node_id":"MDQ6VXNlcjU4OTc3NDA=","avatar_url":"https://avatars3.githubusercontent.com/u/5897740?v=4","gravatar_id":"","url":"https://api.github.com/users/gracedo","html_url":"https://github.com/gracedo","followers_url":"https://api.github.com/users/gracedo/followers","following_url":"https://api.github.com/users/gracedo/following{/other_user}","gists_url":"https://api.github.com/users/gracedo/gists{/gist_id}","starred_url":"https://api.github.com/users/gracedo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gracedo/subscriptions","organizations_url":"https://api.github.com/users/gracedo/orgs","repos_url":"https://api.github.com/users/gracedo/repos","events_url":"https://api.github.com/users/gracedo/events{/privacy}","received_events_url":"https://api.github.com/users/gracedo/received_events","type":"User","site_admin":false},"body":"I've created `dcosutil`","created_at":"2018-11-30T21:11:59Z","updated_at":"2018-11-30T21:11:59Z","html_url":"https://github.com/dcos/telegraf/pull/31#discussion_r238003534","pull_request_url":"https://api.github.com/repos/dcos/telegraf/pulls/31","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/dcos/telegraf/pulls/comments/238003534"},"html":{"href":"https://github.com/dcos/telegraf/pull/31#discussion_r238003534"},"pull_request":{"href":"https://api.github.com/repos/dcos/telegraf/pulls/31"}},"in_reply_to_id":237729293},"pull_request":{"url":"https://api.github.com/repos/dcos/telegraf/pulls/31","id":234481163,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM0NDgxMTYz","html_url":"https://github.com/dcos/telegraf/pull/31","diff_url":"https://github.com/dcos/telegraf/pull/31.diff","patch_url":"https://github.com/dcos/telegraf/pull/31.patch","issue_url":"https://api.github.com/repos/dcos/telegraf/issues/31","number":31,"state":"open","locked":false,"title":"Set User-Agent header in all requests","user":{"login":"gracedo","id":5897740,"node_id":"MDQ6VXNlcjU4OTc3NDA=","avatar_url":"https://avatars3.githubusercontent.com/u/5897740?v=4","gravatar_id":"","url":"https://api.github.com/users/gracedo","html_url":"https://github.com/gracedo","followers_url":"https://api.github.com/users/gracedo/followers","following_url":"https://api.github.com/users/gracedo/following{/other_user}","gists_url":"https://api.github.com/users/gracedo/gists{/gist_id}","starred_url":"https://api.github.com/users/gracedo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gracedo/subscriptions","organizations_url":"https://api.github.com/users/gracedo/orgs","repos_url":"https://api.github.com/users/gracedo/repos","events_url":"https://api.github.com/users/gracedo/events{/privacy}","received_events_url":"https://api.github.com/users/gracedo/received_events","type":"User","site_admin":false},"body":"This sets the `User-Agent` header for _all_ requests, not just the ones going through `dcos-go`. Along with a configurable user-agent value, I've also defined a default (I've defaulted it to basically what we would configure it with). For the `httpcli` users (`dcos-containers` and `dcos-metadata`), it is actually unnecessary to pass in the user-agent option to `dcos-go` with this change, but I included them in for good practice, in case `dcos-go` decides to require that option in the future. I was unable to find logs for the `mesos` and `dcos-metadata` plugin requests, but did for `dcos-containers`, so I tested/verified the user-agent headers using those logs.","created_at":"2018-11-29T01:39:40Z","updated_at":"2018-11-30T21:11:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6d1e3c8c02af593019424f43b15dadd5d731f301","assignee":null,"assignees":[],"requested_reviewers":[{"login":"janisz","id":1616386,"node_id":"MDQ6VXNlcjE2MTYzODY=","avatar_url":"https://avatars0.githubusercontent.com/u/1616386?v=4","gravatar_id":"","url":"https://api.github.com/users/janisz","html_url":"https://github.com/janisz","followers_url":"https://api.github.com/users/janisz/followers","following_url":"https://api.github.com/users/janisz/following{/other_user}","gists_url":"https://api.github.com/users/janisz/gists{/gist_id}","starred_url":"https://api.github.com/users/janisz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/janisz/subscriptions","organizations_url":"https://api.github.com/users/janisz/orgs","repos_url":"https://api.github.com/users/janisz/repos","events_url":"https://api.github.com/users/janisz/events{/privacy}","received_events_url":"https://api.github.com/users/janisz/received_events","type":"User","site_admin":false},{"login":"philipnrmn","id":2989362,"node_id":"MDQ6VXNlcjI5ODkzNjI=","avatar_url":"https://avatars3.githubusercontent.com/u/2989362?v=4","gravatar_id":"","url":"https://api.github.com/users/philipnrmn","html_url":"https://github.com/philipnrmn","followers_url":"https://api.github.com/users/philipnrmn/followers","following_url":"https://api.github.com/users/philipnrmn/following{/other_user}","gists_url":"https://api.github.com/users/philipnrmn/gists{/gist_id}","starred_url":"https://api.github.com/users/philipnrmn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/philipnrmn/subscriptions","organizations_url":"https://api.github.com/users/philipnrmn/orgs","repos_url":"https://api.github.com/users/philipnrmn/repos","events_url":"https://api.github.com/users/philipnrmn/events{/privacy}","received_events_url":"https://api.github.com/users/philipnrmn/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/dcos/telegraf/pulls/31/commits","review_comments_url":"https://api.github.com/repos/dcos/telegraf/pulls/31/comments","review_comment_url":"https://api.github.com/repos/dcos/telegraf/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dcos/telegraf/issues/31/comments","statuses_url":"https://api.github.com/repos/dcos/telegraf/statuses/391913bb31b397736102d7b777fed0b1f238a7bb","head":{"label":"dcos:DCOS_OSS-4168_http_client_user_agent","ref":"DCOS_OSS-4168_http_client_user_agent","sha":"391913bb31b397736102d7b777fed0b1f238a7bb","user":{"login":"dcos","id":17648048,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE3NjQ4MDQ4","avatar_url":"https://avatars1.githubusercontent.com/u/17648048?v=4","gravatar_id":"","url":"https://api.github.com/users/dcos","html_url":"https://github.com/dcos","followers_url":"https://api.github.com/users/dcos/followers","following_url":"https://api.github.com/users/dcos/following{/other_user}","gists_url":"https://api.github.com/users/dcos/gists{/gist_id}","starred_url":"https://api.github.com/users/dcos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcos/subscriptions","organizations_url":"https://api.github.com/users/dcos/orgs","repos_url":"https://api.github.com/users/dcos/repos","events_url":"https://api.github.com/users/dcos/events{/privacy}","received_events_url":"https://api.github.com/users/dcos/received_events","type":"Organization","site_admin":false},"repo":{"id":141500268,"node_id":"MDEwOlJlcG9zaXRvcnkxNDE1MDAyNjg=","name":"telegraf","full_name":"dcos/telegraf","private":false,"owner":{"login":"dcos","id":17648048,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE3NjQ4MDQ4","avatar_url":"https://avatars1.githubusercontent.com/u/17648048?v=4","gravatar_id":"","url":"https://api.github.com/users/dcos","html_url":"https://github.com/dcos","followers_url":"https://api.github.com/users/dcos/followers","following_url":"https://api.github.com/users/dcos/following{/other_user}","gists_url":"https://api.github.com/users/dcos/gists{/gist_id}","starred_url":"https://api.github.com/users/dcos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcos/subscriptions","organizations_url":"https://api.github.com/users/dcos/orgs","repos_url":"https://api.github.com/users/dcos/repos","events_url":"https://api.github.com/users/dcos/events{/privacy}","received_events_url":"https://api.github.com/users/dcos/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/dcos/telegraf","description":"The plugin-driven server agent for collecting & reporting metrics.","fork":true,"url":"https://api.github.com/repos/dcos/telegraf","forks_url":"https://api.github.com/repos/dcos/telegraf/forks","keys_url":"https://api.github.com/repos/dcos/telegraf/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dcos/telegraf/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dcos/telegraf/teams","hooks_url":"https://api.github.com/repos/dcos/telegraf/hooks","issue_events_url":"https://api.github.com/repos/dcos/telegraf/issues/events{/number}","events_url":"https://api.github.com/repos/dcos/telegraf/events","assignees_url":"https://api.github.com/repos/dcos/telegraf/assignees{/user}","branches_url":"https://api.github.com/repos/dcos/telegraf/branches{/branch}","tags_url":"https://api.github.com/repos/dcos/telegraf/tags","blobs_url":"https://api.github.com/repos/dcos/telegraf/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dcos/telegraf/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dcos/telegraf/git/refs{/sha}","trees_url":"https://api.github.com/repos/dcos/telegraf/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dcos/telegraf/statuses/{sha}","languages_url":"https://api.github.com/repos/dcos/telegraf/languages","stargazers_url":"https://api.github.com/repos/dcos/telegraf/stargazers","contributors_url":"https://api.github.com/repos/dcos/telegraf/contributors","subscribers_url":"https://api.github.com/repos/dcos/telegraf/subscribers","subscription_url":"https://api.github.com/repos/dcos/telegraf/subscription","commits_url":"https://api.github.com/repos/dcos/telegraf/commits{/sha}","git_commits_url":"https://api.github.com/repos/dcos/telegraf/git/commits{/sha}","comments_url":"https://api.github.com/repos/dcos/telegraf/comments{/number}","issue_comment_url":"https://api.github.com/repos/dcos/telegraf/issues/comments{/number}","contents_url":"https://api.github.com/repos/dcos/telegraf/contents/{+path}","compare_url":"https://api.github.com/repos/dcos/telegraf/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dcos/telegraf/merges","archive_url":"https://api.github.com/repos/dcos/telegraf/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dcos/telegraf/downloads","issues_url":"https://api.github.com/repos/dcos/telegraf/issues{/number}","pulls_url":"https://api.github.com/repos/dcos/telegraf/pulls{/number}","milestones_url":"https://api.github.com/repos/dcos/telegraf/milestones{/number}","notifications_url":"https://api.github.com/repos/dcos/telegraf/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dcos/telegraf/labels{/name}","releases_url":"https://api.github.com/repos/dcos/telegraf/releases{/id}","deployments_url":"https://api.github.com/repos/dcos/telegraf/deployments","created_at":"2018-07-18T23:32:19Z","updated_at":"2018-11-28T20:59:55Z","pushed_at":"2018-11-30T21:10:20Z","git_url":"git://github.com/dcos/telegraf.git","ssh_url":"git@github.com:dcos/telegraf.git","clone_url":"https://github.com/dcos/telegraf.git","svn_url":"https://github.com/dcos/telegraf","homepage":"","size":19649,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":3,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":3,"open_issues":1,"watchers":0,"default_branch":"1.7.2-dcos"}},"base":{"label":"dcos:1.7.2-dcos","ref":"1.7.2-dcos","sha":"aa6a7e071591eeebfeeb55b2ff5e0407b4bee16d","user":{"login":"dcos","id":17648048,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE3NjQ4MDQ4","avatar_url":"https://avatars1.githubusercontent.com/u/17648048?v=4","gravatar_id":"","url":"https://api.github.com/users/dcos","html_url":"https://github.com/dcos","followers_url":"https://api.github.com/users/dcos/followers","following_url":"https://api.github.com/users/dcos/following{/other_user}","gists_url":"https://api.github.com/users/dcos/gists{/gist_id}","starred_url":"https://api.github.com/users/dcos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcos/subscriptions","organizations_url":"https://api.github.com/users/dcos/orgs","repos_url":"https://api.github.com/users/dcos/repos","events_url":"https://api.github.com/users/dcos/events{/privacy}","received_events_url":"https://api.github.com/users/dcos/received_events","type":"Organization","site_admin":false},"repo":{"id":141500268,"node_id":"MDEwOlJlcG9zaXRvcnkxNDE1MDAyNjg=","name":"telegraf","full_name":"dcos/telegraf","private":false,"owner":{"login":"dcos","id":17648048,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE3NjQ4MDQ4","avatar_url":"https://avatars1.githubusercontent.com/u/17648048?v=4","gravatar_id":"","url":"https://api.github.com/users/dcos","html_url":"https://github.com/dcos","followers_url":"https://api.github.com/users/dcos/followers","following_url":"https://api.github.com/users/dcos/following{/other_user}","gists_url":"https://api.github.com/users/dcos/gists{/gist_id}","starred_url":"https://api.github.com/users/dcos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcos/subscriptions","organizations_url":"https://api.github.com/users/dcos/orgs","repos_url":"https://api.github.com/users/dcos/repos","events_url":"https://api.github.com/users/dcos/events{/privacy}","received_events_url":"https://api.github.com/users/dcos/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/dcos/telegraf","description":"The plugin-driven server agent for collecting & reporting metrics.","fork":true,"url":"https://api.github.com/repos/dcos/telegraf","forks_url":"https://api.github.com/repos/dcos/telegraf/forks","keys_url":"https://api.github.com/repos/dcos/telegraf/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dcos/telegraf/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dcos/telegraf/teams","hooks_url":"https://api.github.com/repos/dcos/telegraf/hooks","issue_events_url":"https://api.github.com/repos/dcos/telegraf/issues/events{/number}","events_url":"https://api.github.com/repos/dcos/telegraf/events","assignees_url":"https://api.github.com/repos/dcos/telegraf/assignees{/user}","branches_url":"https://api.github.com/repos/dcos/telegraf/branches{/branch}","tags_url":"https://api.github.com/repos/dcos/telegraf/tags","blobs_url":"https://api.github.com/repos/dcos/telegraf/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dcos/telegraf/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dcos/telegraf/git/refs{/sha}","trees_url":"https://api.github.com/repos/dcos/telegraf/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dcos/telegraf/statuses/{sha}","languages_url":"https://api.github.com/repos/dcos/telegraf/languages","stargazers_url":"https://api.github.com/repos/dcos/telegraf/stargazers","contributors_url":"https://api.github.com/repos/dcos/telegraf/contributors","subscribers_url":"https://api.github.com/repos/dcos/telegraf/subscribers","subscription_url":"https://api.github.com/repos/dcos/telegraf/subscription","commits_url":"https://api.github.com/repos/dcos/telegraf/commits{/sha}","git_commits_url":"https://api.github.com/repos/dcos/telegraf/git/commits{/sha}","comments_url":"https://api.github.com/repos/dcos/telegraf/comments{/number}","issue_comment_url":"https://api.github.com/repos/dcos/telegraf/issues/comments{/number}","contents_url":"https://api.github.com/repos/dcos/telegraf/contents/{+path}","compare_url":"https://api.github.com/repos/dcos/telegraf/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dcos/telegraf/merges","archive_url":"https://api.github.com/repos/dcos/telegraf/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dcos/telegraf/downloads","issues_url":"https://api.github.com/repos/dcos/telegraf/issues{/number}","pulls_url":"https://api.github.com/repos/dcos/telegraf/pulls{/number}","milestones_url":"https://api.github.com/repos/dcos/telegraf/milestones{/number}","notifications_url":"https://api.github.com/repos/dcos/telegraf/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dcos/telegraf/labels{/name}","releases_url":"https://api.github.com/repos/dcos/telegraf/releases{/id}","deployments_url":"https://api.github.com/repos/dcos/telegraf/deployments","created_at":"2018-07-18T23:32:19Z","updated_at":"2018-11-28T20:59:55Z","pushed_at":"2018-11-30T21:10:20Z","git_url":"git://github.com/dcos/telegraf.git","ssh_url":"git@github.com:dcos/telegraf.git","clone_url":"https://github.com/dcos/telegraf.git","svn_url":"https://github.com/dcos/telegraf","homepage":"","size":19649,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":3,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":3,"open_issues":1,"watchers":0,"default_branch":"1.7.2-dcos"}},"_links":{"self":{"href":"https://api.github.com/repos/dcos/telegraf/pulls/31"},"html":{"href":"https://github.com/dcos/telegraf/pull/31"},"issue":{"href":"https://api.github.com/repos/dcos/telegraf/issues/31"},"comments":{"href":"https://api.github.com/repos/dcos/telegraf/issues/31/comments"},"review_comments":{"href":"https://api.github.com/repos/dcos/telegraf/pulls/31/comments"},"review_comment":{"href":"https://api.github.com/repos/dcos/telegraf/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dcos/telegraf/pulls/31/commits"},"statuses":{"href":"https://api.github.com/repos/dcos/telegraf/statuses/391913bb31b397736102d7b777fed0b1f238a7bb"}},"author_association":"NONE"}}
{"actor":{"display_login":"gracedo"}}