{"action":"created","comment":{"url":"https://api.github.com/repos/Stackdriver/stackdriver-prometheus-sidecar/pulls/comments/284446412","pull_request_review_id":238065238,"id":284446412,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI4NDQ0NjQxMg==","diff_hunk":"@@ -598,12 +609,24 @@ func (s *stackdriverClientFactory) Name() string {\n \treturn s.url.String()\n }\n \n+// fileClientFactory allows creating a StorageClient which writes to\n+// a newly created file under dir.\n type fileClientFactory struct {\n+\tdir    string\n \tlogger log.Logger\n }\n \n-func (f *fileClientFactory) New() stackdriver.StorageClient {\n-\treturn file.NewFileClient(f.logger)\n+// New Creates a new file for each StorageClient, so when Multiple\n+// StorageClients execute Store(), these clients write to their own\n+// files without race condition.","path":"cmd/stackdriver-prometheus-sidecar/main.go","position":null,"original_position":101,"commit_id":"2b62d47670c3181c38195af2e09d3361affeae16","original_commit_id":"2c7d62243a2b429e5ab4f621ea7a7b22ee4a602c","user":{"login":"jkohen","id":7148392,"node_id":"MDQ6VXNlcjcxNDgzOTI=","avatar_url":"https://avatars2.githubusercontent.com/u/7148392?v=4","gravatar_id":"","url":"https://api.github.com/users/jkohen","html_url":"https://github.com/jkohen","followers_url":"https://api.github.com/users/jkohen/followers","following_url":"https://api.github.com/users/jkohen/following{/other_user}","gists_url":"https://api.github.com/users/jkohen/gists{/gist_id}","starred_url":"https://api.github.com/users/jkohen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jkohen/subscriptions","organizations_url":"https://api.github.com/users/jkohen/orgs","repos_url":"https://api.github.com/users/jkohen/repos","events_url":"https://api.github.com/users/jkohen/events{/privacy}","received_events_url":"https://api.github.com/users/jkohen/received_events","type":"User","site_admin":false},"body":"Oh, I see what you meant. I still don't think the factory should document how the clients will use the created class. I think you should document the class API, such as \"each instance will write to a different file\" and \"the returned class isn't thread-safe\".","created_at":"2019-05-15T20:53:33Z","updated_at":"2019-05-15T20:53:33Z","html_url":"https://github.com/Stackdriver/stackdriver-prometheus-sidecar/pull/124#discussion_r284446412","pull_request_url":"https://api.github.com/repos/Stackdriver/stackdriver-prometheus-sidecar/pulls/124","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/Stackdriver/stackdriver-prometheus-sidecar/pulls/comments/284446412"},"html":{"href":"https://github.com/Stackdriver/stackdriver-prometheus-sidecar/pull/124#discussion_r284446412"},"pull_request":{"href":"https://api.github.com/repos/Stackdriver/stackdriver-prometheus-sidecar/pulls/124"}},"in_reply_to_id":284002595},"pull_request":{"url":"https://api.github.com/repos/Stackdriver/stackdriver-prometheus-sidecar/pulls/124","id":278467075,"node_id":"MDExOlB1bGxSZXF1ZXN0Mjc4NDY3MDc1","html_url":"https://github.com/Stackdriver/stackdriver-prometheus-sidecar/pull/124","diff_url":"https://github.com/Stackdriver/stackdriver-prometheus-sidecar/pull/124.diff","patch_url":"https://github.com/Stackdriver/stackdriver-prometheus-sidecar/pull/124.patch","issue_url":"https://api.github.com/repos/Stackdriver/stackdriver-prometheus-sidecar/issues/124","number":124,"state":"open","locked":false,"title":"Add option to store payload to local files.","user":{"login":"StevenYCChou","id":3055688,"node_id":"MDQ6VXNlcjMwNTU2ODg=","avatar_url":"https://avatars3.githubusercontent.com/u/3055688?v=4","gravatar_id":"","url":"https://api.github.com/users/StevenYCChou","html_url":"https://github.com/StevenYCChou","followers_url":"https://api.github.com/users/StevenYCChou/followers","following_url":"https://api.github.com/users/StevenYCChou/following{/other_user}","gists_url":"https://api.github.com/users/StevenYCChou/gists{/gist_id}","starred_url":"https://api.github.com/users/StevenYCChou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StevenYCChou/subscriptions","organizations_url":"https://api.github.com/users/StevenYCChou/orgs","repos_url":"https://api.github.com/users/StevenYCChou/repos","events_url":"https://api.github.com/users/StevenYCChou/events{/privacy}","received_events_url":"https://api.github.com/users/StevenYCChou/received_events","type":"User","site_admin":false},"body":"This PR introduces an option to send the payload to local files\r\ninside temporary directories. It is useful for troubleshooting if the\r\ndata cannot be sent to Monitoring API.\r\n\r\nThis PR also introduces a new type of client: file client. It will\r\ncreate a temporary file, and write CreateTimeSeriesRequest to the file.","created_at":"2019-05-13T23:15:40Z","updated_at":"2019-05-15T20:53:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"dacb6c1d4a7488cf5be909b487895a64f93c8be6","assignee":null,"assignees":[],"requested_reviewers":[{"login":"jkohen","id":7148392,"node_id":"MDQ6VXNlcjcxNDgzOTI=","avatar_url":"https://avatars2.githubusercontent.com/u/7148392?v=4","gravatar_id":"","url":"https://api.github.com/users/jkohen","html_url":"https://github.com/jkohen","followers_url":"https://api.github.com/users/jkohen/followers","following_url":"https://api.github.com/users/jkohen/following{/other_user}","gists_url":"https://api.github.com/users/jkohen/gists{/gist_id}","starred_url":"https://api.github.com/users/jkohen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jkohen/subscriptions","organizations_url":"https://api.github.com/users/jkohen/orgs","repos_url":"https://api.github.com/users/jkohen/repos","events_url":"https://api.github.com/users/jkohen/events{/privacy}","received_events_url":"https://api.github.com/users/jkohen/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":1325530623,"node_id":"MDU6TGFiZWwxMzI1NTMwNjIz","url":"https://api.github.com/repos/Stackdriver/stackdriver-prometheus-sidecar/labels/cla:%20yes","name":"cla: yes","color":"009800","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/Stackdriver/stackdriver-prometheus-sidecar/pulls/124/commits","review_comments_url":"https://api.github.com/repos/Stackdriver/stackdriver-prometheus-sidecar/pulls/124/comments","review_comment_url":"https://api.github.com/repos/Stackdriver/stackdriver-prometheus-sidecar/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Stackdriver/stackdriver-prometheus-sidecar/issues/124/comments","statuses_url":"https://api.github.com/repos/Stackdriver/stackdriver-prometheus-sidecar/statuses/2b62d47670c3181c38195af2e09d3361affeae16","head":{"label":"StevenYCChou:ycchou-output-to-file","ref":"ycchou-output-to-file","sha":"2b62d47670c3181c38195af2e09d3361affeae16","user":{"login":"StevenYCChou","id":3055688,"node_id":"MDQ6VXNlcjMwNTU2ODg=","avatar_url":"https://avatars3.githubusercontent.com/u/3055688?v=4","gravatar_id":"","url":"https://api.github.com/users/StevenYCChou","html_url":"https://github.com/StevenYCChou","followers_url":"https://api.github.com/users/StevenYCChou/followers","following_url":"https://api.github.com/users/StevenYCChou/following{/other_user}","gists_url":"https://api.github.com/users/StevenYCChou/gists{/gist_id}","starred_url":"https://api.github.com/users/StevenYCChou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StevenYCChou/subscriptions","organizations_url":"https://api.github.com/users/StevenYCChou/orgs","repos_url":"https://api.github.com/users/StevenYCChou/repos","events_url":"https://api.github.com/users/StevenYCChou/events{/privacy}","received_events_url":"https://api.github.com/users/StevenYCChou/received_events","type":"User","site_admin":false},"repo":{"id":169797059,"node_id":"MDEwOlJlcG9zaXRvcnkxNjk3OTcwNTk=","name":"stackdriver-prometheus-sidecar","full_name":"StevenYCChou/stackdriver-prometheus-sidecar","private":false,"owner":{"login":"StevenYCChou","id":3055688,"node_id":"MDQ6VXNlcjMwNTU2ODg=","avatar_url":"https://avatars3.githubusercontent.com/u/3055688?v=4","gravatar_id":"","url":"https://api.github.com/users/StevenYCChou","html_url":"https://github.com/StevenYCChou","followers_url":"https://api.github.com/users/StevenYCChou/followers","following_url":"https://api.github.com/users/StevenYCChou/following{/other_user}","gists_url":"https://api.github.com/users/StevenYCChou/gists{/gist_id}","starred_url":"https://api.github.com/users/StevenYCChou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StevenYCChou/subscriptions","organizations_url":"https://api.github.com/users/StevenYCChou/orgs","repos_url":"https://api.github.com/users/StevenYCChou/repos","events_url":"https://api.github.com/users/StevenYCChou/events{/privacy}","received_events_url":"https://api.github.com/users/StevenYCChou/received_events","type":"User","site_admin":false},"html_url":"https://github.com/StevenYCChou/stackdriver-prometheus-sidecar","description":"A sidecar for the Prometheus server that can send metrics to Stackdriver.","fork":true,"url":"https://api.github.com/repos/StevenYCChou/stackdriver-prometheus-sidecar","forks_url":"https://api.github.com/repos/StevenYCChou/stackdriver-prometheus-sidecar/forks","keys_url":"https://api.github.com/repos/StevenYCChou/stackdriver-prometheus-sidecar/keys{/key_id}","collaborators_url":"https://api.github.com/repos/StevenYCChou/stackdriver-prometheus-sidecar/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/StevenYCChou/stackdriver-prometheus-sidecar/teams","hooks_url":"https://api.github.com/repos/StevenYCChou/stackdriver-prometheus-sidecar/hooks","issue_events_url":"https://api.github.com/repos/StevenYCChou/stackdriver-prometheus-sidecar/issues/events{/number}","events_url":"https://api.github.com/repos/StevenYCChou/stackdriver-prometheus-sidecar/events","assignees_url":"https://api.github.com/repos/StevenYCChou/stackdriver-prometheus-sidecar/assignees{/user}","branches_url":"https://api.github.com/repos/StevenYCChou/stackdriver-prometheus-sidecar/branches{/branch}","tags_url":"https://api.github.com/repos/StevenYCChou/stackdriver-prometheus-sidecar/tags","blobs_url":"https://api.github.com/repos/StevenYCChou/stackdriver-prometheus-sidecar/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/StevenYCChou/stackdriver-prometheus-sidecar/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/StevenYCChou/stackdriver-prometheus-sidecar/git/refs{/sha}","trees_url":"https://api.github.com/repos/StevenYCChou/stackdriver-prometheus-sidecar/git/trees{/sha}","statuses_url":"https://api.github.com/repos/StevenYCChou/stackdriver-prometheus-sidecar/statuses/{sha}","languages_url":"https://api.github.com/repos/StevenYCChou/stackdriver-prometheus-sidecar/languages","stargazers_url":"https://api.github.com/repos/StevenYCChou/stackdriver-prometheus-sidecar/stargazers","contributors_url":"https://api.github.com/repos/StevenYCChou/stackdriver-prometheus-sidecar/contributors","subscribers_url":"https://api.github.com/repos/StevenYCChou/stackdriver-prometheus-sidecar/subscribers","subscription_url":"https://api.github.com/repos/StevenYCChou/stackdriver-prometheus-sidecar/subscription","commits_url":"https://api.github.com/repos/StevenYCChou/stackdriver-prometheus-sidecar/commits{/sha}","git_commits_url":"https://api.github.com/repos/StevenYCChou/stackdriver-prometheus-sidecar/git/commits{/sha}","comments_url":"https://api.github.com/repos/StevenYCChou/stackdriver-prometheus-sidecar/comments{/number}","issue_comment_url":"https://api.github.com/repos/StevenYCChou/stackdriver-prometheus-sidecar/issues/comments{/number}","contents_url":"https://api.github.com/repos/StevenYCChou/stackdriver-prometheus-sidecar/contents/{+path}","compare_url":"https://api.github.com/repos/StevenYCChou/stackdriver-prometheus-sidecar/compare/{base}...{head}","merges_url":"https://api.github.com/repos/StevenYCChou/stackdriver-prometheus-sidecar/merges","archive_url":"https://api.github.com/repos/StevenYCChou/stackdriver-prometheus-sidecar/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/StevenYCChou/stackdriver-prometheus-sidecar/downloads","issues_url":"https://api.github.com/repos/StevenYCChou/stackdriver-prometheus-sidecar/issues{/number}","pulls_url":"https://api.github.com/repos/StevenYCChou/stackdriver-prometheus-sidecar/pulls{/number}","milestones_url":"https://api.github.com/repos/StevenYCChou/stackdriver-prometheus-sidecar/milestones{/number}","notifications_url":"https://api.github.com/repos/StevenYCChou/stackdriver-prometheus-sidecar/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/StevenYCChou/stackdriver-prometheus-sidecar/labels{/name}","releases_url":"https://api.github.com/repos/StevenYCChou/stackdriver-prometheus-sidecar/releases{/id}","deployments_url":"https://api.github.com/repos/StevenYCChou/stackdriver-prometheus-sidecar/deployments","created_at":"2019-02-08T20:49:07Z","updated_at":"2019-05-13T23:09:13Z","pushed_at":"2019-05-15T19:11:48Z","git_url":"git://github.com/StevenYCChou/stackdriver-prometheus-sidecar.git","ssh_url":"git@github.com:StevenYCChou/stackdriver-prometheus-sidecar.git","clone_url":"https://github.com/StevenYCChou/stackdriver-prometheus-sidecar.git","svn_url":"https://github.com/StevenYCChou/stackdriver-prometheus-sidecar","homepage":"https://cloud.google.com/monitoring/kubernetes-engine/prometheus","size":35795,"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,"disabled":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":"Stackdriver:master","ref":"master","sha":"fc1c9e25897105f7f4f28db48b9440eb886ff87e","user":{"login":"Stackdriver","id":2104369,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIxMDQzNjk=","avatar_url":"https://avatars3.githubusercontent.com/u/2104369?v=4","gravatar_id":"","url":"https://api.github.com/users/Stackdriver","html_url":"https://github.com/Stackdriver","followers_url":"https://api.github.com/users/Stackdriver/followers","following_url":"https://api.github.com/users/Stackdriver/following{/other_user}","gists_url":"https://api.github.com/users/Stackdriver/gists{/gist_id}","starred_url":"https://api.github.com/users/Stackdriver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Stackdriver/subscriptions","organizations_url":"https://api.github.com/users/Stackdriver/orgs","repos_url":"https://api.github.com/users/Stackdriver/repos","events_url":"https://api.github.com/users/Stackdriver/events{/privacy}","received_events_url":"https://api.github.com/users/Stackdriver/received_events","type":"Organization","site_admin":false},"repo":{"id":134886870,"node_id":"MDEwOlJlcG9zaXRvcnkxMzQ4ODY4NzA=","name":"stackdriver-prometheus-sidecar","full_name":"Stackdriver/stackdriver-prometheus-sidecar","private":false,"owner":{"login":"Stackdriver","id":2104369,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIxMDQzNjk=","avatar_url":"https://avatars3.githubusercontent.com/u/2104369?v=4","gravatar_id":"","url":"https://api.github.com/users/Stackdriver","html_url":"https://github.com/Stackdriver","followers_url":"https://api.github.com/users/Stackdriver/followers","following_url":"https://api.github.com/users/Stackdriver/following{/other_user}","gists_url":"https://api.github.com/users/Stackdriver/gists{/gist_id}","starred_url":"https://api.github.com/users/Stackdriver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Stackdriver/subscriptions","organizations_url":"https://api.github.com/users/Stackdriver/orgs","repos_url":"https://api.github.com/users/Stackdriver/repos","events_url":"https://api.github.com/users/Stackdriver/events{/privacy}","received_events_url":"https://api.github.com/users/Stackdriver/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/Stackdriver/stackdriver-prometheus-sidecar","description":"A sidecar for the Prometheus server that can send metrics to Stackdriver.","fork":false,"url":"https://api.github.com/repos/Stackdriver/stackdriver-prometheus-sidecar","forks_url":"https://api.github.com/repos/Stackdriver/stackdriver-prometheus-sidecar/forks","keys_url":"https://api.github.com/repos/Stackdriver/stackdriver-prometheus-sidecar/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Stackdriver/stackdriver-prometheus-sidecar/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Stackdriver/stackdriver-prometheus-sidecar/teams","hooks_url":"https://api.github.com/repos/Stackdriver/stackdriver-prometheus-sidecar/hooks","issue_events_url":"https://api.github.com/repos/Stackdriver/stackdriver-prometheus-sidecar/issues/events{/number}","events_url":"https://api.github.com/repos/Stackdriver/stackdriver-prometheus-sidecar/events","assignees_url":"https://api.github.com/repos/Stackdriver/stackdriver-prometheus-sidecar/assignees{/user}","branches_url":"https://api.github.com/repos/Stackdriver/stackdriver-prometheus-sidecar/branches{/branch}","tags_url":"https://api.github.com/repos/Stackdriver/stackdriver-prometheus-sidecar/tags","blobs_url":"https://api.github.com/repos/Stackdriver/stackdriver-prometheus-sidecar/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Stackdriver/stackdriver-prometheus-sidecar/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Stackdriver/stackdriver-prometheus-sidecar/git/refs{/sha}","trees_url":"https://api.github.com/repos/Stackdriver/stackdriver-prometheus-sidecar/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Stackdriver/stackdriver-prometheus-sidecar/statuses/{sha}","languages_url":"https://api.github.com/repos/Stackdriver/stackdriver-prometheus-sidecar/languages","stargazers_url":"https://api.github.com/repos/Stackdriver/stackdriver-prometheus-sidecar/stargazers","contributors_url":"https://api.github.com/repos/Stackdriver/stackdriver-prometheus-sidecar/contributors","subscribers_url":"https://api.github.com/repos/Stackdriver/stackdriver-prometheus-sidecar/subscribers","subscription_url":"https://api.github.com/repos/Stackdriver/stackdriver-prometheus-sidecar/subscription","commits_url":"https://api.github.com/repos/Stackdriver/stackdriver-prometheus-sidecar/commits{/sha}","git_commits_url":"https://api.github.com/repos/Stackdriver/stackdriver-prometheus-sidecar/git/commits{/sha}","comments_url":"https://api.github.com/repos/Stackdriver/stackdriver-prometheus-sidecar/comments{/number}","issue_comment_url":"https://api.github.com/repos/Stackdriver/stackdriver-prometheus-sidecar/issues/comments{/number}","contents_url":"https://api.github.com/repos/Stackdriver/stackdriver-prometheus-sidecar/contents/{+path}","compare_url":"https://api.github.com/repos/Stackdriver/stackdriver-prometheus-sidecar/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Stackdriver/stackdriver-prometheus-sidecar/merges","archive_url":"https://api.github.com/repos/Stackdriver/stackdriver-prometheus-sidecar/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Stackdriver/stackdriver-prometheus-sidecar/downloads","issues_url":"https://api.github.com/repos/Stackdriver/stackdriver-prometheus-sidecar/issues{/number}","pulls_url":"https://api.github.com/repos/Stackdriver/stackdriver-prometheus-sidecar/pulls{/number}","milestones_url":"https://api.github.com/repos/Stackdriver/stackdriver-prometheus-sidecar/milestones{/number}","notifications_url":"https://api.github.com/repos/Stackdriver/stackdriver-prometheus-sidecar/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Stackdriver/stackdriver-prometheus-sidecar/labels{/name}","releases_url":"https://api.github.com/repos/Stackdriver/stackdriver-prometheus-sidecar/releases{/id}","deployments_url":"https://api.github.com/repos/Stackdriver/stackdriver-prometheus-sidecar/deployments","created_at":"2018-05-25T17:38:38Z","updated_at":"2019-05-14T16:50:06Z","pushed_at":"2019-05-15T19:11:49Z","git_url":"git://github.com/Stackdriver/stackdriver-prometheus-sidecar.git","ssh_url":"git@github.com:Stackdriver/stackdriver-prometheus-sidecar.git","clone_url":"https://github.com/Stackdriver/stackdriver-prometheus-sidecar.git","svn_url":"https://github.com/Stackdriver/stackdriver-prometheus-sidecar","homepage":"https://cloud.google.com/monitoring/kubernetes-engine/prometheus","size":74357,"stargazers_count":15,"watchers_count":15,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":10,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":15,"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":10,"open_issues":15,"watchers":15,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Stackdriver/stackdriver-prometheus-sidecar/pulls/124"},"html":{"href":"https://github.com/Stackdriver/stackdriver-prometheus-sidecar/pull/124"},"issue":{"href":"https://api.github.com/repos/Stackdriver/stackdriver-prometheus-sidecar/issues/124"},"comments":{"href":"https://api.github.com/repos/Stackdriver/stackdriver-prometheus-sidecar/issues/124/comments"},"review_comments":{"href":"https://api.github.com/repos/Stackdriver/stackdriver-prometheus-sidecar/pulls/124/comments"},"review_comment":{"href":"https://api.github.com/repos/Stackdriver/stackdriver-prometheus-sidecar/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Stackdriver/stackdriver-prometheus-sidecar/pulls/124/commits"},"statuses":{"href":"https://api.github.com/repos/Stackdriver/stackdriver-prometheus-sidecar/statuses/2b62d47670c3181c38195af2e09d3361affeae16"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"jkohen"}}