{"action":"created","issue":{"url":"https://api.github.com/repos/prometheus/client_golang/issues/131","labels_url":"https://api.github.com/repos/prometheus/client_golang/issues/131/labels{/name}","comments_url":"https://api.github.com/repos/prometheus/client_golang/issues/131/comments","events_url":"https://api.github.com/repos/prometheus/client_golang/issues/131/events","html_url":"https://github.com/prometheus/client_golang/pull/131","id":85297456,"number":131,"title":"Solve \"The Proxy Problem\" of http.InstrumentHandler","user":{"login":"telendt","id":85191,"avatar_url":"https://avatars.githubusercontent.com/u/85191?v=3","gravatar_id":"","url":"https://api.github.com/users/telendt","html_url":"https://github.com/telendt","followers_url":"https://api.github.com/users/telendt/followers","following_url":"https://api.github.com/users/telendt/following{/other_user}","gists_url":"https://api.github.com/users/telendt/gists{/gist_id}","starred_url":"https://api.github.com/users/telendt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/telendt/subscriptions","organizations_url":"https://api.github.com/users/telendt/orgs","repos_url":"https://api.github.com/users/telendt/repos","events_url":"https://api.github.com/users/telendt/events{/privacy}","received_events_url":"https://api.github.com/users/telendt/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-06-04T21:58:10Z","updated_at":"2015-06-05T08:03:48Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/prometheus/client_golang/pulls/131","html_url":"https://github.com/prometheus/client_golang/pull/131","diff_url":"https://github.com/prometheus/client_golang/pull/131.diff","patch_url":"https://github.com/prometheus/client_golang/pull/131.patch"},"body":"`InstrumentHandler` provides proxy object over given `http.ResponseWriter` - `responseWriterDelegator` that only implements the bare minimum required of an `http.ResponseWriter` and doesn’t implement any interface upgrades (`http.Flusher`, `http.Hijacker`, etc.). One example of negative side-effect of this is decreased performance of `http.FileServer` handler after instrumentation.\r\nThis PR fixes it by providing `fancyResponseWriterDelegator` with all the fancy bells and whistles if standard library `http.ResponseWriter` is detected. More info [here](https://avtok.com/2014/11/05/interface-upgrades.html#the-proxy-problem).\r\n\r\nI also switched `responseWriterDelegator.written` to int64 (to allow responses greater than 4GB) in different commit. If you prefer two different PRs or one PR with squashed commits just let me know."},"comment":{"url":"https://api.github.com/repos/prometheus/client_golang/issues/comments/109197832","html_url":"https://github.com/prometheus/client_golang/pull/131#issuecomment-109197832","issue_url":"https://api.github.com/repos/prometheus/client_golang/issues/131","id":109197832,"user":{"login":"telendt","id":85191,"avatar_url":"https://avatars.githubusercontent.com/u/85191?v=3","gravatar_id":"","url":"https://api.github.com/users/telendt","html_url":"https://github.com/telendt","followers_url":"https://api.github.com/users/telendt/followers","following_url":"https://api.github.com/users/telendt/following{/other_user}","gists_url":"https://api.github.com/users/telendt/gists{/gist_id}","starred_url":"https://api.github.com/users/telendt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/telendt/subscriptions","organizations_url":"https://api.github.com/users/telendt/orgs","repos_url":"https://api.github.com/users/telendt/repos","events_url":"https://api.github.com/users/telendt/events{/privacy}","received_events_url":"https://api.github.com/users/telendt/received_events","type":"User","site_admin":false},"created_at":"2015-06-05T08:03:48Z","updated_at":"2015-06-05T08:03:48Z","body":"@fabxc Yes, I've heard that @beorn7 as well. I just wanted to add that this change should be backward compatible :)"}}