{"action":"created","issue":{"url":"https://api.github.com/repos/StackStorm/st2/issues/1847","labels_url":"https://api.github.com/repos/StackStorm/st2/issues/1847/labels{/name}","comments_url":"https://api.github.com/repos/StackStorm/st2/issues/1847/comments","events_url":"https://api.github.com/repos/StackStorm/st2/issues/1847/events","html_url":"https://github.com/StackStorm/st2/pull/1847","id":102024941,"number":1847,"title":"RFR: Add X-Request-ID API headers so we can trace request in logs easily.","user":{"login":"lakshmi-kannan","id":1839421,"avatar_url":"https://avatars.githubusercontent.com/u/1839421?v=3","gravatar_id":"","url":"https://api.github.com/users/lakshmi-kannan","html_url":"https://github.com/lakshmi-kannan","followers_url":"https://api.github.com/users/lakshmi-kannan/followers","following_url":"https://api.github.com/users/lakshmi-kannan/following{/other_user}","gists_url":"https://api.github.com/users/lakshmi-kannan/gists{/gist_id}","starred_url":"https://api.github.com/users/lakshmi-kannan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lakshmi-kannan/subscriptions","organizations_url":"https://api.github.com/users/lakshmi-kannan/orgs","repos_url":"https://api.github.com/users/lakshmi-kannan/repos","events_url":"https://api.github.com/users/lakshmi-kannan/events{/privacy}","received_events_url":"https://api.github.com/users/lakshmi-kannan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-19T23:46:42Z","updated_at":"2015-08-19T23:54:54Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/StackStorm/st2/pulls/1847","html_url":"https://github.com/StackStorm/st2/pull/1847","diff_url":"https://github.com/StackStorm/st2/pull/1847.diff","patch_url":"https://github.com/StackStorm/st2/pull/1847.patch"},"body":"Example:\r\n\r\n```\r\n(virtualenv)/m/s/s/st2 git:support_trace_id_in_cli_run ❯❯❯ grep \"a64fd291-f9cf-4797-89e8-b4a58c8f12db\" logs/st2api.log\r\n2015-08-19 16:42:38,875 140597257636112 INFO log [-] a64fd291-f9cf-4797-89e8-b4a58c8f12db -  GET /v1/rules with filters={} (remote_addr='127.0.0.1',method='GET',filters={},request_id='a64fd291-f9cf-4797-89e8-b4a58c8f12db',path='/v1/rules')\r\n(virtualenv)/m/s/s/st2 git:support_trace_id_in_cli_run ❯❯❯\r\n```\r\n\r\n```\r\n(virtualenv)/m/s/s/st2 git:support_trace_id_in_cli_run ❯❯❯ http http://localhost:9101/v1/rules             ✭ ✱ ◼\r\nHTTP/1.1 200 OK\r\nAccess-Control-Allow-Headers: Content-Type,Authorization,X-Auth-Token,X-Request-ID\r\nAccess-Control-Allow-Methods: GET,POST,PUT,DELETE,OPTIONS\r\nAccess-Control-Allow-Origin: http://127.0.0.1:9101/\r\nAccess-Control-Expose-Headers: Content-Type,X-Limit,X-Total-Count,X-Request-ID\r\nConnection: keep-alive\r\nContent-Length: 30806\r\nContent-Type: application/json; charset=UTF-8\r\nDate: Wed, 19 Aug 2015 23:42:38 GMT\r\nX-Request-Id: a64fd291-f9cf-4797-89e8-b4a58c8f12db\r\nX-Total-Count: 38\r\n```\r\n\r\n```\r\n(virtualenv)/m/s/s/st2 git:support_trace_id_in_cli_run ❯❯❯ http http://localhost:9101/v1/rules                         ✭ ✱ ◼\r\nHTTP/1.1 500 Internal Server Error\r\nAccess-Control-Allow-Headers: Content-Type,Authorization,X-Auth-Token,X-Request-ID\r\nAccess-Control-Allow-Methods: GET,POST,PUT,DELETE,OPTIONS\r\nAccess-Control-Allow-Origin: http://127.0.0.1:9101/\r\nAccess-Control-Expose-Headers: Content-Type,X-Limit,X-Total-Count,X-Request-ID\r\nConnection: keep-alive\r\nContent-Length: 36\r\nContent-Type: application/json\r\nDate: Wed, 19 Aug 2015 23:50:24 GMT\r\nX-Request-Id: 15612f18-21b7-47b9-82fb-34657b7be2d5\r\n\r\n{\r\n    \"faultstring\": \"500 testing\"\r\n}\r\n\r\n(virtualenv)/m/s/s/st2 git:support_trace_id_in_cli_run ❯❯❯\r\n\r\n(virtualenv)/m/s/s/st2 git:support_trace_id_in_cli_run ❯❯❯ grep \"15612f18-21b7-47b9-82fb-34657b7be2d5\" logs/st2api.log\r\n2015-08-19 16:50:24,186 140260114315536 INFO log [-] 15612f18-21b7-47b9-82fb-34657b7be2d5 -  GET /v1/rules with filters={} (remote_addr='127.0.0.1',method='GET',filters={},request_id='15612f18-21b7-47b9-82fb-34657b7be2d5',path='/v1/rules')\r\n(virtualenv)/m/s/s/st2 git:support_trace_id_in_cli_run ❯❯❯\r\n```"},"comment":{"url":"https://api.github.com/repos/StackStorm/st2/issues/comments/132828917","html_url":"https://github.com/StackStorm/st2/pull/1847#issuecomment-132828917","issue_url":"https://api.github.com/repos/StackStorm/st2/issues/1847","id":132828917,"user":{"login":"manasdk","id":1776099,"avatar_url":"https://avatars.githubusercontent.com/u/1776099?v=3","gravatar_id":"","url":"https://api.github.com/users/manasdk","html_url":"https://github.com/manasdk","followers_url":"https://api.github.com/users/manasdk/followers","following_url":"https://api.github.com/users/manasdk/following{/other_user}","gists_url":"https://api.github.com/users/manasdk/gists{/gist_id}","starred_url":"https://api.github.com/users/manasdk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/manasdk/subscriptions","organizations_url":"https://api.github.com/users/manasdk/orgs","repos_url":"https://api.github.com/users/manasdk/repos","events_url":"https://api.github.com/users/manasdk/events{/privacy}","received_events_url":"https://api.github.com/users/manasdk/received_events","type":"User","site_admin":false},"created_at":"2015-08-19T23:54:54Z","updated_at":"2015-08-19T23:54:54Z","body":"Works for me.\r\n\r\n+1"}}