{"action":"created","comment":{"url":"https://api.github.com/repos/DataDog/datadog-trace-agent/pulls/comments/193404519","pull_request_review_id":126366105,"id":193404519,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5MzQwNDUxOQ==","diff_hunk":"@@ -14,151 +14,294 @@ import (\n \twriterconfig \"github.com/DataDog/datadog-trace-agent/writer/config\"\n )\n \n-// StatsWriter ingests stats buckets and flushes their aggregation to the API.\n+// StatsWriter ingests stats buckets and flushes them to the API.\n type StatsWriter struct {\n-\tstats    info.StatsWriterInfo\n+\tBaseWriter\n+\n+\t// InStats is the stream of stat buckets to send out.\n+\tInStats <-chan []model.StatsBucket","path":"writer/stats_writer.go","position":11,"original_position":11,"commit_id":"df80a8cab62fdb1eba8e62b0dcc92f12e58fd086","original_commit_id":"df80a8cab62fdb1eba8e62b0dcc92f12e58fd086","user":{"login":"gbbr","id":6686356,"node_id":"MDQ6VXNlcjY2ODYzNTY=","avatar_url":"https://avatars2.githubusercontent.com/u/6686356?v=4","gravatar_id":"","url":"https://api.github.com/users/gbbr","html_url":"https://github.com/gbbr","followers_url":"https://api.github.com/users/gbbr/followers","following_url":"https://api.github.com/users/gbbr/following{/other_user}","gists_url":"https://api.github.com/users/gbbr/gists{/gist_id}","starred_url":"https://api.github.com/users/gbbr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gbbr/subscriptions","organizations_url":"https://api.github.com/users/gbbr/orgs","repos_url":"https://api.github.com/users/gbbr/repos","events_url":"https://api.github.com/users/gbbr/events{/privacy}","received_events_url":"https://api.github.com/users/gbbr/received_events","type":"User","site_admin":false},"body":"Since this is the _only_ input channel, let's call it the usual `in`. It will pair nicely with the same naming of the trace writer's \"in\" channel, like we have now ([link here](https://github.com/DataDog/datadog-trace-agent/blob/416acd39e81c5d6a1c8b79fe30abee295d4325b0/writer/trace_writer.go#L37)). It needs not be an exported field as it is not used anywhere. A lot of the identifiers in the agent are exported but aren't used in foreign packages.","created_at":"2018-06-06T13:15:08Z","updated_at":"2018-06-06T13:46:35Z","html_url":"https://github.com/DataDog/datadog-trace-agent/pull/432#discussion_r193404519","pull_request_url":"https://api.github.com/repos/DataDog/datadog-trace-agent/pulls/432","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/DataDog/datadog-trace-agent/pulls/comments/193404519"},"html":{"href":"https://github.com/DataDog/datadog-trace-agent/pull/432#discussion_r193404519"},"pull_request":{"href":"https://api.github.com/repos/DataDog/datadog-trace-agent/pulls/432"}}},"pull_request":{"url":"https://api.github.com/repos/DataDog/datadog-trace-agent/pulls/432","id":192693673,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkyNjkzNjcz","html_url":"https://github.com/DataDog/datadog-trace-agent/pull/432","diff_url":"https://github.com/DataDog/datadog-trace-agent/pull/432.diff","patch_url":"https://github.com/DataDog/datadog-trace-agent/pull/432.patch","issue_url":"https://api.github.com/repos/DataDog/datadog-trace-agent/issues/432","number":432,"state":"open","locked":false,"title":"writer: split stats writer payloads based on number of entries.","user":{"login":"vlad-mh","id":1613036,"node_id":"MDQ6VXNlcjE2MTMwMzY=","avatar_url":"https://avatars2.githubusercontent.com/u/1613036?v=4","gravatar_id":"","url":"https://api.github.com/users/vlad-mh","html_url":"https://github.com/vlad-mh","followers_url":"https://api.github.com/users/vlad-mh/followers","following_url":"https://api.github.com/users/vlad-mh/following{/other_user}","gists_url":"https://api.github.com/users/vlad-mh/gists{/gist_id}","starred_url":"https://api.github.com/users/vlad-mh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vlad-mh/subscriptions","organizations_url":"https://api.github.com/users/vlad-mh/orgs","repos_url":"https://api.github.com/users/vlad-mh/repos","events_url":"https://api.github.com/users/vlad-mh/events{/privacy}","received_events_url":"https://api.github.com/users/vlad-mh/received_events","type":"User","site_admin":false},"body":"Adds a splitting logic in the stats writer in order never to exceed a pre-configured maximum number of \"entries\" in a stats payload.\r\n\r\nDoing so ensures we don't hit the maximum payload size of the Datadog trace intake API.\r\n\r\nThe first commit is just a cleanup of the stats writer code, and some added comments.\r\n\r\nThe second commit adds the configuration value `max_entries_per_payload`. This value should be tweaked very cautiously. Setting it too low will have the agent send much more payloads than it should when flushing, which will impact performances and will hit the backend significantly more. Setting the value too high, and the payloads might end up being rejected due to their size.\r\n\r\nThe third commit is the actual splitting logic + unit tests.","created_at":"2018-06-05T12:43:20Z","updated_at":"2018-06-06T13:46:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5db905347e5bed9fb2a696f66c1182a42e59b848","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":{"url":"https://api.github.com/repos/DataDog/datadog-trace-agent/milestones/15","html_url":"https://github.com/DataDog/datadog-trace-agent/milestone/15","labels_url":"https://api.github.com/repos/DataDog/datadog-trace-agent/milestones/15/labels","id":3357380,"node_id":"MDk6TWlsZXN0b25lMzM1NzM4MA==","number":15,"title":"6.3.0","description":"","creator":{"login":"palazzem","id":1560405,"node_id":"MDQ6VXNlcjE1NjA0MDU=","avatar_url":"https://avatars2.githubusercontent.com/u/1560405?v=4","gravatar_id":"","url":"https://api.github.com/users/palazzem","html_url":"https://github.com/palazzem","followers_url":"https://api.github.com/users/palazzem/followers","following_url":"https://api.github.com/users/palazzem/following{/other_user}","gists_url":"https://api.github.com/users/palazzem/gists{/gist_id}","starred_url":"https://api.github.com/users/palazzem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/palazzem/subscriptions","organizations_url":"https://api.github.com/users/palazzem/orgs","repos_url":"https://api.github.com/users/palazzem/repos","events_url":"https://api.github.com/users/palazzem/events{/privacy}","received_events_url":"https://api.github.com/users/palazzem/received_events","type":"User","site_admin":false},"open_issues":3,"closed_issues":2,"state":"open","created_at":"2018-05-18T14:17:29Z","updated_at":"2018-06-06T12:47:56Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/DataDog/datadog-trace-agent/pulls/432/commits","review_comments_url":"https://api.github.com/repos/DataDog/datadog-trace-agent/pulls/432/comments","review_comment_url":"https://api.github.com/repos/DataDog/datadog-trace-agent/pulls/comments{/number}","comments_url":"https://api.github.com/repos/DataDog/datadog-trace-agent/issues/432/comments","statuses_url":"https://api.github.com/repos/DataDog/datadog-trace-agent/statuses/df80a8cab62fdb1eba8e62b0dcc92f12e58fd086","head":{"label":"DataDog:vlad/stats-writer-split-payload","ref":"vlad/stats-writer-split-payload","sha":"df80a8cab62fdb1eba8e62b0dcc92f12e58fd086","user":{"login":"DataDog","id":365230,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM2NTIzMA==","avatar_url":"https://avatars1.githubusercontent.com/u/365230?v=4","gravatar_id":"","url":"https://api.github.com/users/DataDog","html_url":"https://github.com/DataDog","followers_url":"https://api.github.com/users/DataDog/followers","following_url":"https://api.github.com/users/DataDog/following{/other_user}","gists_url":"https://api.github.com/users/DataDog/gists{/gist_id}","starred_url":"https://api.github.com/users/DataDog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DataDog/subscriptions","organizations_url":"https://api.github.com/users/DataDog/orgs","repos_url":"https://api.github.com/users/DataDog/repos","events_url":"https://api.github.com/users/DataDog/events{/privacy}","received_events_url":"https://api.github.com/users/DataDog/received_events","type":"Organization","site_admin":false},"repo":{"id":38379832,"node_id":"MDEwOlJlcG9zaXRvcnkzODM3OTgzMg==","name":"datadog-trace-agent","full_name":"DataDog/datadog-trace-agent","owner":{"login":"DataDog","id":365230,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM2NTIzMA==","avatar_url":"https://avatars1.githubusercontent.com/u/365230?v=4","gravatar_id":"","url":"https://api.github.com/users/DataDog","html_url":"https://github.com/DataDog","followers_url":"https://api.github.com/users/DataDog/followers","following_url":"https://api.github.com/users/DataDog/following{/other_user}","gists_url":"https://api.github.com/users/DataDog/gists{/gist_id}","starred_url":"https://api.github.com/users/DataDog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DataDog/subscriptions","organizations_url":"https://api.github.com/users/DataDog/orgs","repos_url":"https://api.github.com/users/DataDog/repos","events_url":"https://api.github.com/users/DataDog/events{/privacy}","received_events_url":"https://api.github.com/users/DataDog/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/DataDog/datadog-trace-agent","description":"Datadog APM agent.","fork":false,"url":"https://api.github.com/repos/DataDog/datadog-trace-agent","forks_url":"https://api.github.com/repos/DataDog/datadog-trace-agent/forks","keys_url":"https://api.github.com/repos/DataDog/datadog-trace-agent/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DataDog/datadog-trace-agent/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DataDog/datadog-trace-agent/teams","hooks_url":"https://api.github.com/repos/DataDog/datadog-trace-agent/hooks","issue_events_url":"https://api.github.com/repos/DataDog/datadog-trace-agent/issues/events{/number}","events_url":"https://api.github.com/repos/DataDog/datadog-trace-agent/events","assignees_url":"https://api.github.com/repos/DataDog/datadog-trace-agent/assignees{/user}","branches_url":"https://api.github.com/repos/DataDog/datadog-trace-agent/branches{/branch}","tags_url":"https://api.github.com/repos/DataDog/datadog-trace-agent/tags","blobs_url":"https://api.github.com/repos/DataDog/datadog-trace-agent/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DataDog/datadog-trace-agent/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DataDog/datadog-trace-agent/git/refs{/sha}","trees_url":"https://api.github.com/repos/DataDog/datadog-trace-agent/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DataDog/datadog-trace-agent/statuses/{sha}","languages_url":"https://api.github.com/repos/DataDog/datadog-trace-agent/languages","stargazers_url":"https://api.github.com/repos/DataDog/datadog-trace-agent/stargazers","contributors_url":"https://api.github.com/repos/DataDog/datadog-trace-agent/contributors","subscribers_url":"https://api.github.com/repos/DataDog/datadog-trace-agent/subscribers","subscription_url":"https://api.github.com/repos/DataDog/datadog-trace-agent/subscription","commits_url":"https://api.github.com/repos/DataDog/datadog-trace-agent/commits{/sha}","git_commits_url":"https://api.github.com/repos/DataDog/datadog-trace-agent/git/commits{/sha}","comments_url":"https://api.github.com/repos/DataDog/datadog-trace-agent/comments{/number}","issue_comment_url":"https://api.github.com/repos/DataDog/datadog-trace-agent/issues/comments{/number}","contents_url":"https://api.github.com/repos/DataDog/datadog-trace-agent/contents/{+path}","compare_url":"https://api.github.com/repos/DataDog/datadog-trace-agent/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DataDog/datadog-trace-agent/merges","archive_url":"https://api.github.com/repos/DataDog/datadog-trace-agent/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DataDog/datadog-trace-agent/downloads","issues_url":"https://api.github.com/repos/DataDog/datadog-trace-agent/issues{/number}","pulls_url":"https://api.github.com/repos/DataDog/datadog-trace-agent/pulls{/number}","milestones_url":"https://api.github.com/repos/DataDog/datadog-trace-agent/milestones{/number}","notifications_url":"https://api.github.com/repos/DataDog/datadog-trace-agent/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DataDog/datadog-trace-agent/labels{/name}","releases_url":"https://api.github.com/repos/DataDog/datadog-trace-agent/releases{/id}","deployments_url":"https://api.github.com/repos/DataDog/datadog-trace-agent/deployments","created_at":"2015-07-01T15:45:17Z","updated_at":"2018-06-05T13:42:04Z","pushed_at":"2018-06-06T13:01:22Z","git_url":"git://github.com/DataDog/datadog-trace-agent.git","ssh_url":"git@github.com:DataDog/datadog-trace-agent.git","clone_url":"https://github.com/DataDog/datadog-trace-agent.git","svn_url":"https://github.com/DataDog/datadog-trace-agent","homepage":"http://www.datadog.com","size":5472,"stargazers_count":46,"watchers_count":46,"language":"Go","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":21,"mirror_url":null,"archived":false,"open_issues_count":24,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":21,"open_issues":24,"watchers":46,"default_branch":"master"}},"base":{"label":"DataDog:master","ref":"master","sha":"416acd39e81c5d6a1c8b79fe30abee295d4325b0","user":{"login":"DataDog","id":365230,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM2NTIzMA==","avatar_url":"https://avatars1.githubusercontent.com/u/365230?v=4","gravatar_id":"","url":"https://api.github.com/users/DataDog","html_url":"https://github.com/DataDog","followers_url":"https://api.github.com/users/DataDog/followers","following_url":"https://api.github.com/users/DataDog/following{/other_user}","gists_url":"https://api.github.com/users/DataDog/gists{/gist_id}","starred_url":"https://api.github.com/users/DataDog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DataDog/subscriptions","organizations_url":"https://api.github.com/users/DataDog/orgs","repos_url":"https://api.github.com/users/DataDog/repos","events_url":"https://api.github.com/users/DataDog/events{/privacy}","received_events_url":"https://api.github.com/users/DataDog/received_events","type":"Organization","site_admin":false},"repo":{"id":38379832,"node_id":"MDEwOlJlcG9zaXRvcnkzODM3OTgzMg==","name":"datadog-trace-agent","full_name":"DataDog/datadog-trace-agent","owner":{"login":"DataDog","id":365230,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM2NTIzMA==","avatar_url":"https://avatars1.githubusercontent.com/u/365230?v=4","gravatar_id":"","url":"https://api.github.com/users/DataDog","html_url":"https://github.com/DataDog","followers_url":"https://api.github.com/users/DataDog/followers","following_url":"https://api.github.com/users/DataDog/following{/other_user}","gists_url":"https://api.github.com/users/DataDog/gists{/gist_id}","starred_url":"https://api.github.com/users/DataDog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DataDog/subscriptions","organizations_url":"https://api.github.com/users/DataDog/orgs","repos_url":"https://api.github.com/users/DataDog/repos","events_url":"https://api.github.com/users/DataDog/events{/privacy}","received_events_url":"https://api.github.com/users/DataDog/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/DataDog/datadog-trace-agent","description":"Datadog APM agent.","fork":false,"url":"https://api.github.com/repos/DataDog/datadog-trace-agent","forks_url":"https://api.github.com/repos/DataDog/datadog-trace-agent/forks","keys_url":"https://api.github.com/repos/DataDog/datadog-trace-agent/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DataDog/datadog-trace-agent/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DataDog/datadog-trace-agent/teams","hooks_url":"https://api.github.com/repos/DataDog/datadog-trace-agent/hooks","issue_events_url":"https://api.github.com/repos/DataDog/datadog-trace-agent/issues/events{/number}","events_url":"https://api.github.com/repos/DataDog/datadog-trace-agent/events","assignees_url":"https://api.github.com/repos/DataDog/datadog-trace-agent/assignees{/user}","branches_url":"https://api.github.com/repos/DataDog/datadog-trace-agent/branches{/branch}","tags_url":"https://api.github.com/repos/DataDog/datadog-trace-agent/tags","blobs_url":"https://api.github.com/repos/DataDog/datadog-trace-agent/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DataDog/datadog-trace-agent/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DataDog/datadog-trace-agent/git/refs{/sha}","trees_url":"https://api.github.com/repos/DataDog/datadog-trace-agent/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DataDog/datadog-trace-agent/statuses/{sha}","languages_url":"https://api.github.com/repos/DataDog/datadog-trace-agent/languages","stargazers_url":"https://api.github.com/repos/DataDog/datadog-trace-agent/stargazers","contributors_url":"https://api.github.com/repos/DataDog/datadog-trace-agent/contributors","subscribers_url":"https://api.github.com/repos/DataDog/datadog-trace-agent/subscribers","subscription_url":"https://api.github.com/repos/DataDog/datadog-trace-agent/subscription","commits_url":"https://api.github.com/repos/DataDog/datadog-trace-agent/commits{/sha}","git_commits_url":"https://api.github.com/repos/DataDog/datadog-trace-agent/git/commits{/sha}","comments_url":"https://api.github.com/repos/DataDog/datadog-trace-agent/comments{/number}","issue_comment_url":"https://api.github.com/repos/DataDog/datadog-trace-agent/issues/comments{/number}","contents_url":"https://api.github.com/repos/DataDog/datadog-trace-agent/contents/{+path}","compare_url":"https://api.github.com/repos/DataDog/datadog-trace-agent/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DataDog/datadog-trace-agent/merges","archive_url":"https://api.github.com/repos/DataDog/datadog-trace-agent/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DataDog/datadog-trace-agent/downloads","issues_url":"https://api.github.com/repos/DataDog/datadog-trace-agent/issues{/number}","pulls_url":"https://api.github.com/repos/DataDog/datadog-trace-agent/pulls{/number}","milestones_url":"https://api.github.com/repos/DataDog/datadog-trace-agent/milestones{/number}","notifications_url":"https://api.github.com/repos/DataDog/datadog-trace-agent/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DataDog/datadog-trace-agent/labels{/name}","releases_url":"https://api.github.com/repos/DataDog/datadog-trace-agent/releases{/id}","deployments_url":"https://api.github.com/repos/DataDog/datadog-trace-agent/deployments","created_at":"2015-07-01T15:45:17Z","updated_at":"2018-06-05T13:42:04Z","pushed_at":"2018-06-06T13:01:22Z","git_url":"git://github.com/DataDog/datadog-trace-agent.git","ssh_url":"git@github.com:DataDog/datadog-trace-agent.git","clone_url":"https://github.com/DataDog/datadog-trace-agent.git","svn_url":"https://github.com/DataDog/datadog-trace-agent","homepage":"http://www.datadog.com","size":5472,"stargazers_count":46,"watchers_count":46,"language":"Go","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":21,"mirror_url":null,"archived":false,"open_issues_count":24,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":21,"open_issues":24,"watchers":46,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/DataDog/datadog-trace-agent/pulls/432"},"html":{"href":"https://github.com/DataDog/datadog-trace-agent/pull/432"},"issue":{"href":"https://api.github.com/repos/DataDog/datadog-trace-agent/issues/432"},"comments":{"href":"https://api.github.com/repos/DataDog/datadog-trace-agent/issues/432/comments"},"review_comments":{"href":"https://api.github.com/repos/DataDog/datadog-trace-agent/pulls/432/comments"},"review_comment":{"href":"https://api.github.com/repos/DataDog/datadog-trace-agent/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/DataDog/datadog-trace-agent/pulls/432/commits"},"statuses":{"href":"https://api.github.com/repos/DataDog/datadog-trace-agent/statuses/df80a8cab62fdb1eba8e62b0dcc92f12e58fd086"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"gbbr"}}