{"action":"created","comment":{"url":"https://api.github.com/repos/gravitational/monitoring-app/pulls/comments/92673775","pull_request_review_id":13192189,"id":92673775,"diff_hunk":"@@ -0,0 +1,145 @@\n+package lib\n+\n+import (\n+\t\"bytes\"\n+\t\"fmt\"\n+\t\"html/template\"\n+\t\"strconv\"\n+\t\"strings\"\n+\n+\t\"github.com/gravitational/trace\"\n+)\n+\n+// Rollup is the rollup configuration\n+type Rollup struct {\n+\t// Retention is the retention policy for this rollup\n+\tRetention string `json:\"retention\"`\n+\t// Measurement is the name of the measurements to run rollup on\n+\tMeasurement string `json:\"measurement\"`\n+\t// Name is both the name of the rollup query and the name of the\n+\t// new measurement rollup data will be inserted into\n+\tName string `json:\"name\"`\n+\t// Functions is a list of functions for rollup calculation\n+\tFunctions []Function `json:\"functions\"`\n+}\n+\n+// Check verifies that rollup configuration is correct\n+func (r Rollup) Check() error {\n+\tif !OneOf(r.Retention, AllRetentions) {","path":"watcher/lib/rollups.go","position":28,"original_position":28,"commit_id":"7748261dd72fbd4570e08906d0f5fc1553d4dbf4","original_commit_id":"7748261dd72fbd4570e08906d0f5fc1553d4dbf4","user":{"login":"a-palchikov","id":965809,"avatar_url":"https://avatars.githubusercontent.com/u/965809?v=3","gravatar_id":"","url":"https://api.github.com/users/a-palchikov","html_url":"https://github.com/a-palchikov","followers_url":"https://api.github.com/users/a-palchikov/followers","following_url":"https://api.github.com/users/a-palchikov/following{/other_user}","gists_url":"https://api.github.com/users/a-palchikov/gists{/gist_id}","starred_url":"https://api.github.com/users/a-palchikov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/a-palchikov/subscriptions","organizations_url":"https://api.github.com/users/a-palchikov/orgs","repos_url":"https://api.github.com/users/a-palchikov/repos","events_url":"https://api.github.com/users/a-palchikov/events{/privacy}","received_events_url":"https://api.github.com/users/a-palchikov/received_events","type":"User","site_admin":false},"body":"you should also make sure to keep `retentionToInterval` in sync with `AllRetentions` or have it build from the same source","created_at":"2016-12-15T18:48:40Z","updated_at":"2016-12-15T18:49:12Z","html_url":"https://github.com/gravitational/monitoring-app/pull/17#discussion_r92673775","pull_request_url":"https://api.github.com/repos/gravitational/monitoring-app/pulls/17","_links":{"self":{"href":"https://api.github.com/repos/gravitational/monitoring-app/pulls/comments/92673775"},"html":{"href":"https://github.com/gravitational/monitoring-app/pull/17#discussion_r92673775"},"pull_request":{"href":"https://api.github.com/repos/gravitational/monitoring-app/pulls/17"}}},"pull_request":{"url":"https://api.github.com/repos/gravitational/monitoring-app/pulls/17","id":98062219,"html_url":"https://github.com/gravitational/monitoring-app/pull/17","diff_url":"https://github.com/gravitational/monitoring-app/pull/17.diff","patch_url":"https://github.com/gravitational/monitoring-app/pull/17.patch","issue_url":"https://api.github.com/repos/gravitational/monitoring-app/issues/17","number":17,"state":"open","locked":false,"title":"Rollups","user":{"login":"r0mant","id":339322,"avatar_url":"https://avatars.githubusercontent.com/u/339322?v=3","gravatar_id":"","url":"https://api.github.com/users/r0mant","html_url":"https://github.com/r0mant","followers_url":"https://api.github.com/users/r0mant/followers","following_url":"https://api.github.com/users/r0mant/following{/other_user}","gists_url":"https://api.github.com/users/r0mant/gists{/gist_id}","starred_url":"https://api.github.com/users/r0mant/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/r0mant/subscriptions","organizations_url":"https://api.github.com/users/r0mant/orgs","repos_url":"https://api.github.com/users/r0mant/repos","events_url":"https://api.github.com/users/r0mant/events{/privacy}","received_events_url":"https://api.github.com/users/r0mant/received_events","type":"User","site_admin":false},"body":"The same watcher that listens for Grafana dashboards has got a second mode in which it looks for ConfigMaps with metric rollup definitions and creates them in Influxdb. The watcher runs as a sidecar container in the Influxdb pod.\r\n\r\nRollups are performed by Influxdb's \"continuous queries\". When a ConfigMap with rollups is detected, the watcher creates a corresponding continuous query in the database.\r\n\r\nThere are 3 pre-configured retention policies: default (1d), medium (4w) and long (52w).\r\n\r\n* The default one is supposed to store high-resolution metrics, e.g. all heapster metrics with 10 second resolution go in there.\r\n* Medium-precision rollups (5 minute aggregation interval) go into \"medium\" policy.\r\n* Low-precision rollups (1 hour interval) go into \"long\" policy.\r\n\r\nRollup intervals are not configurable but retentions are. A customer will be able to adjust for how long metrics of a certain precision are stored on Gravity settings page (there's a separate Gravity PR).\r\n\r\nI've also configured rollups for those default metrics collected by heapster for which it makes sense (I think).","created_at":"2016-12-15T00:02:37Z","updated_at":"2016-12-15T18:58:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2034026acafcb2c3b8c1b9d8e251a5cd7cb05375","assignee":{"login":"klizhentas","id":13717,"avatar_url":"https://avatars.githubusercontent.com/u/13717?v=3","gravatar_id":"","url":"https://api.github.com/users/klizhentas","html_url":"https://github.com/klizhentas","followers_url":"https://api.github.com/users/klizhentas/followers","following_url":"https://api.github.com/users/klizhentas/following{/other_user}","gists_url":"https://api.github.com/users/klizhentas/gists{/gist_id}","starred_url":"https://api.github.com/users/klizhentas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/klizhentas/subscriptions","organizations_url":"https://api.github.com/users/klizhentas/orgs","repos_url":"https://api.github.com/users/klizhentas/repos","events_url":"https://api.github.com/users/klizhentas/events{/privacy}","received_events_url":"https://api.github.com/users/klizhentas/received_events","type":"User","site_admin":false},"assignees":[{"login":"klizhentas","id":13717,"avatar_url":"https://avatars.githubusercontent.com/u/13717?v=3","gravatar_id":"","url":"https://api.github.com/users/klizhentas","html_url":"https://github.com/klizhentas","followers_url":"https://api.github.com/users/klizhentas/followers","following_url":"https://api.github.com/users/klizhentas/following{/other_user}","gists_url":"https://api.github.com/users/klizhentas/gists{/gist_id}","starred_url":"https://api.github.com/users/klizhentas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/klizhentas/subscriptions","organizations_url":"https://api.github.com/users/klizhentas/orgs","repos_url":"https://api.github.com/users/klizhentas/repos","events_url":"https://api.github.com/users/klizhentas/events{/privacy}","received_events_url":"https://api.github.com/users/klizhentas/received_events","type":"User","site_admin":false},{"login":"sofuture","id":66669,"avatar_url":"https://avatars.githubusercontent.com/u/66669?v=3","gravatar_id":"","url":"https://api.github.com/users/sofuture","html_url":"https://github.com/sofuture","followers_url":"https://api.github.com/users/sofuture/followers","following_url":"https://api.github.com/users/sofuture/following{/other_user}","gists_url":"https://api.github.com/users/sofuture/gists{/gist_id}","starred_url":"https://api.github.com/users/sofuture/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sofuture/subscriptions","organizations_url":"https://api.github.com/users/sofuture/orgs","repos_url":"https://api.github.com/users/sofuture/repos","events_url":"https://api.github.com/users/sofuture/events{/privacy}","received_events_url":"https://api.github.com/users/sofuture/received_events","type":"User","site_admin":false},{"login":"a-palchikov","id":965809,"avatar_url":"https://avatars.githubusercontent.com/u/965809?v=3","gravatar_id":"","url":"https://api.github.com/users/a-palchikov","html_url":"https://github.com/a-palchikov","followers_url":"https://api.github.com/users/a-palchikov/followers","following_url":"https://api.github.com/users/a-palchikov/following{/other_user}","gists_url":"https://api.github.com/users/a-palchikov/gists{/gist_id}","starred_url":"https://api.github.com/users/a-palchikov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/a-palchikov/subscriptions","organizations_url":"https://api.github.com/users/a-palchikov/orgs","repos_url":"https://api.github.com/users/a-palchikov/repos","events_url":"https://api.github.com/users/a-palchikov/events{/privacy}","received_events_url":"https://api.github.com/users/a-palchikov/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/gravitational/monitoring-app/pulls/17/commits","review_comments_url":"https://api.github.com/repos/gravitational/monitoring-app/pulls/17/comments","review_comment_url":"https://api.github.com/repos/gravitational/monitoring-app/pulls/comments{/number}","comments_url":"https://api.github.com/repos/gravitational/monitoring-app/issues/17/comments","statuses_url":"https://api.github.com/repos/gravitational/monitoring-app/statuses/7748261dd72fbd4570e08906d0f5fc1553d4dbf4","head":{"label":"gravitational:roman/rollups","ref":"roman/rollups","sha":"7748261dd72fbd4570e08906d0f5fc1553d4dbf4","user":{"login":"gravitational","id":10781132,"avatar_url":"https://avatars.githubusercontent.com/u/10781132?v=3","gravatar_id":"","url":"https://api.github.com/users/gravitational","html_url":"https://github.com/gravitational","followers_url":"https://api.github.com/users/gravitational/followers","following_url":"https://api.github.com/users/gravitational/following{/other_user}","gists_url":"https://api.github.com/users/gravitational/gists{/gist_id}","starred_url":"https://api.github.com/users/gravitational/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gravitational/subscriptions","organizations_url":"https://api.github.com/users/gravitational/orgs","repos_url":"https://api.github.com/users/gravitational/repos","events_url":"https://api.github.com/users/gravitational/events{/privacy}","received_events_url":"https://api.github.com/users/gravitational/received_events","type":"Organization","site_admin":false},"repo":{"id":61946315,"name":"monitoring-app","full_name":"gravitational/monitoring-app","owner":{"login":"gravitational","id":10781132,"avatar_url":"https://avatars.githubusercontent.com/u/10781132?v=3","gravatar_id":"","url":"https://api.github.com/users/gravitational","html_url":"https://github.com/gravitational","followers_url":"https://api.github.com/users/gravitational/followers","following_url":"https://api.github.com/users/gravitational/following{/other_user}","gists_url":"https://api.github.com/users/gravitational/gists{/gist_id}","starred_url":"https://api.github.com/users/gravitational/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gravitational/subscriptions","organizations_url":"https://api.github.com/users/gravitational/orgs","repos_url":"https://api.github.com/users/gravitational/repos","events_url":"https://api.github.com/users/gravitational/events{/privacy}","received_events_url":"https://api.github.com/users/gravitational/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/gravitational/monitoring-app","description":"This gravity app provides an InfluxDB, Heapster + Grafana based monitoring system.","fork":false,"url":"https://api.github.com/repos/gravitational/monitoring-app","forks_url":"https://api.github.com/repos/gravitational/monitoring-app/forks","keys_url":"https://api.github.com/repos/gravitational/monitoring-app/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gravitational/monitoring-app/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gravitational/monitoring-app/teams","hooks_url":"https://api.github.com/repos/gravitational/monitoring-app/hooks","issue_events_url":"https://api.github.com/repos/gravitational/monitoring-app/issues/events{/number}","events_url":"https://api.github.com/repos/gravitational/monitoring-app/events","assignees_url":"https://api.github.com/repos/gravitational/monitoring-app/assignees{/user}","branches_url":"https://api.github.com/repos/gravitational/monitoring-app/branches{/branch}","tags_url":"https://api.github.com/repos/gravitational/monitoring-app/tags","blobs_url":"https://api.github.com/repos/gravitational/monitoring-app/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gravitational/monitoring-app/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gravitational/monitoring-app/git/refs{/sha}","trees_url":"https://api.github.com/repos/gravitational/monitoring-app/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gravitational/monitoring-app/statuses/{sha}","languages_url":"https://api.github.com/repos/gravitational/monitoring-app/languages","stargazers_url":"https://api.github.com/repos/gravitational/monitoring-app/stargazers","contributors_url":"https://api.github.com/repos/gravitational/monitoring-app/contributors","subscribers_url":"https://api.github.com/repos/gravitational/monitoring-app/subscribers","subscription_url":"https://api.github.com/repos/gravitational/monitoring-app/subscription","commits_url":"https://api.github.com/repos/gravitational/monitoring-app/commits{/sha}","git_commits_url":"https://api.github.com/repos/gravitational/monitoring-app/git/commits{/sha}","comments_url":"https://api.github.com/repos/gravitational/monitoring-app/comments{/number}","issue_comment_url":"https://api.github.com/repos/gravitational/monitoring-app/issues/comments{/number}","contents_url":"https://api.github.com/repos/gravitational/monitoring-app/contents/{+path}","compare_url":"https://api.github.com/repos/gravitational/monitoring-app/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gravitational/monitoring-app/merges","archive_url":"https://api.github.com/repos/gravitational/monitoring-app/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gravitational/monitoring-app/downloads","issues_url":"https://api.github.com/repos/gravitational/monitoring-app/issues{/number}","pulls_url":"https://api.github.com/repos/gravitational/monitoring-app/pulls{/number}","milestones_url":"https://api.github.com/repos/gravitational/monitoring-app/milestones{/number}","notifications_url":"https://api.github.com/repos/gravitational/monitoring-app/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gravitational/monitoring-app/labels{/name}","releases_url":"https://api.github.com/repos/gravitational/monitoring-app/releases{/id}","deployments_url":"https://api.github.com/repos/gravitational/monitoring-app/deployments","created_at":"2016-06-25T14:16:53Z","updated_at":"2016-12-10T01:05:30Z","pushed_at":"2016-12-15T00:02:37Z","git_url":"git://github.com/gravitational/monitoring-app.git","ssh_url":"git@github.com:gravitational/monitoring-app.git","clone_url":"https://github.com/gravitational/monitoring-app.git","svn_url":"https://github.com/gravitational/monitoring-app","homepage":null,"size":5641,"stargazers_count":1,"watchers_count":1,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":1,"default_branch":"master"}},"base":{"label":"gravitational:master","ref":"master","sha":"58aafcae908f2fd0d4eb6f4c2c61410380cfb847","user":{"login":"gravitational","id":10781132,"avatar_url":"https://avatars.githubusercontent.com/u/10781132?v=3","gravatar_id":"","url":"https://api.github.com/users/gravitational","html_url":"https://github.com/gravitational","followers_url":"https://api.github.com/users/gravitational/followers","following_url":"https://api.github.com/users/gravitational/following{/other_user}","gists_url":"https://api.github.com/users/gravitational/gists{/gist_id}","starred_url":"https://api.github.com/users/gravitational/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gravitational/subscriptions","organizations_url":"https://api.github.com/users/gravitational/orgs","repos_url":"https://api.github.com/users/gravitational/repos","events_url":"https://api.github.com/users/gravitational/events{/privacy}","received_events_url":"https://api.github.com/users/gravitational/received_events","type":"Organization","site_admin":false},"repo":{"id":61946315,"name":"monitoring-app","full_name":"gravitational/monitoring-app","owner":{"login":"gravitational","id":10781132,"avatar_url":"https://avatars.githubusercontent.com/u/10781132?v=3","gravatar_id":"","url":"https://api.github.com/users/gravitational","html_url":"https://github.com/gravitational","followers_url":"https://api.github.com/users/gravitational/followers","following_url":"https://api.github.com/users/gravitational/following{/other_user}","gists_url":"https://api.github.com/users/gravitational/gists{/gist_id}","starred_url":"https://api.github.com/users/gravitational/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gravitational/subscriptions","organizations_url":"https://api.github.com/users/gravitational/orgs","repos_url":"https://api.github.com/users/gravitational/repos","events_url":"https://api.github.com/users/gravitational/events{/privacy}","received_events_url":"https://api.github.com/users/gravitational/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/gravitational/monitoring-app","description":"This gravity app provides an InfluxDB, Heapster + Grafana based monitoring system.","fork":false,"url":"https://api.github.com/repos/gravitational/monitoring-app","forks_url":"https://api.github.com/repos/gravitational/monitoring-app/forks","keys_url":"https://api.github.com/repos/gravitational/monitoring-app/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gravitational/monitoring-app/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gravitational/monitoring-app/teams","hooks_url":"https://api.github.com/repos/gravitational/monitoring-app/hooks","issue_events_url":"https://api.github.com/repos/gravitational/monitoring-app/issues/events{/number}","events_url":"https://api.github.com/repos/gravitational/monitoring-app/events","assignees_url":"https://api.github.com/repos/gravitational/monitoring-app/assignees{/user}","branches_url":"https://api.github.com/repos/gravitational/monitoring-app/branches{/branch}","tags_url":"https://api.github.com/repos/gravitational/monitoring-app/tags","blobs_url":"https://api.github.com/repos/gravitational/monitoring-app/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gravitational/monitoring-app/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gravitational/monitoring-app/git/refs{/sha}","trees_url":"https://api.github.com/repos/gravitational/monitoring-app/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gravitational/monitoring-app/statuses/{sha}","languages_url":"https://api.github.com/repos/gravitational/monitoring-app/languages","stargazers_url":"https://api.github.com/repos/gravitational/monitoring-app/stargazers","contributors_url":"https://api.github.com/repos/gravitational/monitoring-app/contributors","subscribers_url":"https://api.github.com/repos/gravitational/monitoring-app/subscribers","subscription_url":"https://api.github.com/repos/gravitational/monitoring-app/subscription","commits_url":"https://api.github.com/repos/gravitational/monitoring-app/commits{/sha}","git_commits_url":"https://api.github.com/repos/gravitational/monitoring-app/git/commits{/sha}","comments_url":"https://api.github.com/repos/gravitational/monitoring-app/comments{/number}","issue_comment_url":"https://api.github.com/repos/gravitational/monitoring-app/issues/comments{/number}","contents_url":"https://api.github.com/repos/gravitational/monitoring-app/contents/{+path}","compare_url":"https://api.github.com/repos/gravitational/monitoring-app/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gravitational/monitoring-app/merges","archive_url":"https://api.github.com/repos/gravitational/monitoring-app/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gravitational/monitoring-app/downloads","issues_url":"https://api.github.com/repos/gravitational/monitoring-app/issues{/number}","pulls_url":"https://api.github.com/repos/gravitational/monitoring-app/pulls{/number}","milestones_url":"https://api.github.com/repos/gravitational/monitoring-app/milestones{/number}","notifications_url":"https://api.github.com/repos/gravitational/monitoring-app/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gravitational/monitoring-app/labels{/name}","releases_url":"https://api.github.com/repos/gravitational/monitoring-app/releases{/id}","deployments_url":"https://api.github.com/repos/gravitational/monitoring-app/deployments","created_at":"2016-06-25T14:16:53Z","updated_at":"2016-12-10T01:05:30Z","pushed_at":"2016-12-15T00:02:37Z","git_url":"git://github.com/gravitational/monitoring-app.git","ssh_url":"git@github.com:gravitational/monitoring-app.git","clone_url":"https://github.com/gravitational/monitoring-app.git","svn_url":"https://github.com/gravitational/monitoring-app","homepage":null,"size":5641,"stargazers_count":1,"watchers_count":1,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/gravitational/monitoring-app/pulls/17"},"html":{"href":"https://github.com/gravitational/monitoring-app/pull/17"},"issue":{"href":"https://api.github.com/repos/gravitational/monitoring-app/issues/17"},"comments":{"href":"https://api.github.com/repos/gravitational/monitoring-app/issues/17/comments"},"review_comments":{"href":"https://api.github.com/repos/gravitational/monitoring-app/pulls/17/comments"},"review_comment":{"href":"https://api.github.com/repos/gravitational/monitoring-app/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/gravitational/monitoring-app/pulls/17/commits"},"statuses":{"href":"https://api.github.com/repos/gravitational/monitoring-app/statuses/7748261dd72fbd4570e08906d0f5fc1553d4dbf4"}}}}
{"actor":{"display_login":"a-palchikov"}}