{"action":"created","issue":{"url":"https://api.github.com/repos/cockroachdb/cockroach/issues/9810","repository_url":"https://api.github.com/repos/cockroachdb/cockroach","labels_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/9810/labels{/name}","comments_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/9810/comments","events_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/9810/events","html_url":"https://github.com/cockroachdb/cockroach/pull/9810","id":181751828,"number":9810,"title":"metrics: idiomatic histograms","user":{"login":"tschottdorf","id":5076964,"avatar_url":"https://avatars.githubusercontent.com/u/5076964?v=3","gravatar_id":"","url":"https://api.github.com/users/tschottdorf","html_url":"https://github.com/tschottdorf","followers_url":"https://api.github.com/users/tschottdorf/followers","following_url":"https://api.github.com/users/tschottdorf/following{/other_user}","gists_url":"https://api.github.com/users/tschottdorf/gists{/gist_id}","starred_url":"https://api.github.com/users/tschottdorf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tschottdorf/subscriptions","organizations_url":"https://api.github.com/users/tschottdorf/orgs","repos_url":"https://api.github.com/users/tschottdorf/repos","events_url":"https://api.github.com/users/tschottdorf/events{/privacy}","received_events_url":"https://api.github.com/users/tschottdorf/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2016-10-07T19:40:41Z","updated_at":"2016-10-08T03:35:38Z","closed_at":"2016-10-08T03:34:45Z","pull_request":{"url":"https://api.github.com/repos/cockroachdb/cockroach/pulls/9810","html_url":"https://github.com/cockroachdb/cockroach/pull/9810","diff_url":"https://github.com/cockroachdb/cockroach/pull/9810.diff","patch_url":"https://github.com/cockroachdb/cockroach/pull/9810.patch"},"body":"Reworked our usage of histograms. The primary objective was exposing \"sane\"\nhistograms to prometheus; prior to this change we exposed ever-changing\nstreaming quantiles of windowed histograms, which is completely worthless.\n\nTo support our in-house time series (which cannot ingest general histograms)\nand for \"casual\" users of histogram information (TxnCoordSender), support for\nwindowed histograms remains.\n\nIn effect, our Histogram type now wraps two internal histograms:\n\n- a \"real\" histogram which keeps totals and is scraped by prometheus\n- a windowed histogram (in turn composed of several subhistograms through which\n  it rotates) which is scraped by time series.\n\nThis should work reasonably well with the caveat that we cannot sum our\ninternal time series histograms and expect mathematically meaningful results,\nwhich is avoided for the most part as histogram source aggregation typically\ngrabs the maximum value observed, which *is* valid. The notable exception are\nrollups, which are not implemented yet but will end up averaging out the same\nquantile at different times, giving meaningless results. That latter\nrestriction seems unimportant in practice given that roll-ups also downsample\ndramatically, so the additional loss of fidelity is likely not a concern as\nlong as we document it appropriately.\n\nExisting tooling was simplified to keep less \"useless\" histograms. For example,\nwe were keeping multiple durations of sliding windows for each time series,\nbut this wasn't used. Now we record only one at a reasonably high resolution\nto time series (and prometheus doesn't use the windowed histograms at all).\n\nSimilar treatment is possible for \"rates\" which is another unidiomatic\nconstruct introduced by me back in the day and should be completely removable\n(in a future PR).\n\n<!-- Reviewable:start -->\n---\nThis change is [<img src=\"https://reviewable.io/review_button.svg\" height=\"34\" align=\"absmiddle\" alt=\"Reviewable\"/>](https://reviewable.io/reviews/cockroachdb/cockroach/9810)\n<!-- Reviewable:end -->\n"},"comment":{"url":"https://api.github.com/repos/cockroachdb/cockroach/issues/comments/252400012","html_url":"https://github.com/cockroachdb/cockroach/pull/9810#issuecomment-252400012","issue_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/9810","id":252400012,"user":{"login":"tschottdorf","id":5076964,"avatar_url":"https://avatars.githubusercontent.com/u/5076964?v=3","gravatar_id":"","url":"https://api.github.com/users/tschottdorf","html_url":"https://github.com/tschottdorf","followers_url":"https://api.github.com/users/tschottdorf/followers","following_url":"https://api.github.com/users/tschottdorf/following{/other_user}","gists_url":"https://api.github.com/users/tschottdorf/gists{/gist_id}","starred_url":"https://api.github.com/users/tschottdorf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tschottdorf/subscriptions","organizations_url":"https://api.github.com/users/tschottdorf/orgs","repos_url":"https://api.github.com/users/tschottdorf/repos","events_url":"https://api.github.com/users/tschottdorf/events{/privacy}","received_events_url":"https://api.github.com/users/tschottdorf/received_events","type":"User","site_admin":false},"created_at":"2016-10-08T03:35:38Z","updated_at":"2016-10-08T03:35:38Z","body":"I discussed this change at a high level with @mrtracy earlier today, so I'm going to go ahead with the merge and deploy it."}}
{"actor":{"display_login":"tschottdorf"}}