{"action":"created","issue":{"url":"https://api.github.com/repos/alphagov/gds-api-adapters/issues/357","labels_url":"https://api.github.com/repos/alphagov/gds-api-adapters/issues/357/labels{/name}","comments_url":"https://api.github.com/repos/alphagov/gds-api-adapters/issues/357/comments","events_url":"https://api.github.com/repos/alphagov/gds-api-adapters/issues/357/events","html_url":"https://github.com/alphagov/gds-api-adapters/pull/357","id":107017596,"number":357,"title":"[FOR DISCUSSION:] Log API call times to Statsd","user":{"login":"mattbostock","id":4348848,"avatar_url":"https://avatars.githubusercontent.com/u/4348848?v=3","gravatar_id":"","url":"https://api.github.com/users/mattbostock","html_url":"https://github.com/mattbostock","followers_url":"https://api.github.com/users/mattbostock/followers","following_url":"https://api.github.com/users/mattbostock/following{/other_user}","gists_url":"https://api.github.com/users/mattbostock/gists{/gist_id}","starred_url":"https://api.github.com/users/mattbostock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattbostock/subscriptions","organizations_url":"https://api.github.com/users/mattbostock/orgs","repos_url":"https://api.github.com/users/mattbostock/repos","events_url":"https://api.github.com/users/mattbostock/events{/privacy}","received_events_url":"https://api.github.com/users/mattbostock/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-09-17T16:01:29Z","updated_at":"2015-09-18T12:34:38Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/alphagov/gds-api-adapters/pulls/357","html_url":"https://github.com/alphagov/gds-api-adapters/pull/357","diff_url":"https://github.com/alphagov/gds-api-adapters/pull/357.diff","patch_url":"https://github.com/alphagov/gds-api-adapters/pull/357.patch"},"body":"Log the duration of API calls to statsd for each application, using\r\ntheir hostname to distinguish between each application.\r\n\r\nAlthough we already track request times in Nginx, it's hard to see where\r\nthose API calls originated from.\r\n\r\nBy logging call times in this way, we'll be able to see:\r\n\r\n- call times by machine they originated from\r\n- call times by application they originated from\r\n- call times by application the API call is targetting\r\n\r\nBy combining these three dimensions, we should be able to build a useful\r\npicture for troubleshooting misbehaving APIs, networking partitions and\r\nback-pressure.\r\n\r\n__Note: I haven't tested this yet as I'd like feedback on the implementation and as to how useful this is__."},"comment":{"url":"https://api.github.com/repos/alphagov/gds-api-adapters/issues/comments/141439730","html_url":"https://github.com/alphagov/gds-api-adapters/pull/357#issuecomment-141439730","issue_url":"https://api.github.com/repos/alphagov/gds-api-adapters/issues/357","id":141439730,"user":{"login":"tijmenb","id":233676,"avatar_url":"https://avatars.githubusercontent.com/u/233676?v=3","gravatar_id":"","url":"https://api.github.com/users/tijmenb","html_url":"https://github.com/tijmenb","followers_url":"https://api.github.com/users/tijmenb/followers","following_url":"https://api.github.com/users/tijmenb/following{/other_user}","gists_url":"https://api.github.com/users/tijmenb/gists{/gist_id}","starred_url":"https://api.github.com/users/tijmenb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tijmenb/subscriptions","organizations_url":"https://api.github.com/users/tijmenb/orgs","repos_url":"https://api.github.com/users/tijmenb/repos","events_url":"https://api.github.com/users/tijmenb/events{/privacy}","received_events_url":"https://api.github.com/users/tijmenb/received_events","type":"User","site_admin":false},"created_at":"2015-09-18T12:34:38Z","updated_at":"2015-09-18T12:34:38Z","body":"I don't know much about these things, but would it be nicer to make `gds-api-adapters` emit [ActiveSupport Instrumentation events](http://edgeguides.rubyonrails.org/active_support_instrumentation.html), and let the apps itself forward those to statsd? "}}