{"action":"created","issue":{"url":"https://api.github.com/repos/openfaas/faas/issues/813","repository_url":"https://api.github.com/repos/openfaas/faas","labels_url":"https://api.github.com/repos/openfaas/faas/issues/813/labels{/name}","comments_url":"https://api.github.com/repos/openfaas/faas/issues/813/comments","events_url":"https://api.github.com/repos/openfaas/faas/issues/813/events","html_url":"https://github.com/openfaas/faas/issues/813","id":349391217,"node_id":"MDU6SXNzdWUzNDkzOTEyMTc=","number":813,"title":"Enable X-Call-Id header for async-function calls","user":{"login":"pourabolghasem","id":2810739,"node_id":"MDQ6VXNlcjI4MTA3Mzk=","avatar_url":"https://avatars0.githubusercontent.com/u/2810739?v=4","gravatar_id":"","url":"https://api.github.com/users/pourabolghasem","html_url":"https://github.com/pourabolghasem","followers_url":"https://api.github.com/users/pourabolghasem/followers","following_url":"https://api.github.com/users/pourabolghasem/following{/other_user}","gists_url":"https://api.github.com/users/pourabolghasem/gists{/gist_id}","starred_url":"https://api.github.com/users/pourabolghasem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pourabolghasem/subscriptions","organizations_url":"https://api.github.com/users/pourabolghasem/orgs","repos_url":"https://api.github.com/users/pourabolghasem/repos","events_url":"https://api.github.com/users/pourabolghasem/events{/privacy}","received_events_url":"https://api.github.com/users/pourabolghasem/received_events","type":"User","site_admin":false},"labels":[{"id":505489877,"node_id":"MDU6TGFiZWw1MDU0ODk4Nzc=","url":"https://api.github.com/repos/openfaas/faas/labels/help%20wanted","name":"help wanted","color":"128A0C","default":true},{"id":689450713,"node_id":"MDU6TGFiZWw2ODk0NTA3MTM=","url":"https://api.github.com/repos/openfaas/faas/labels/proposal","name":"proposal","color":"ededed","default":false}],"state":"open","locked":false,"assignee":{"login":"ivanayov","id":4160133,"node_id":"MDQ6VXNlcjQxNjAxMzM=","avatar_url":"https://avatars3.githubusercontent.com/u/4160133?v=4","gravatar_id":"","url":"https://api.github.com/users/ivanayov","html_url":"https://github.com/ivanayov","followers_url":"https://api.github.com/users/ivanayov/followers","following_url":"https://api.github.com/users/ivanayov/following{/other_user}","gists_url":"https://api.github.com/users/ivanayov/gists{/gist_id}","starred_url":"https://api.github.com/users/ivanayov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ivanayov/subscriptions","organizations_url":"https://api.github.com/users/ivanayov/orgs","repos_url":"https://api.github.com/users/ivanayov/repos","events_url":"https://api.github.com/users/ivanayov/events{/privacy}","received_events_url":"https://api.github.com/users/ivanayov/received_events","type":"User","site_admin":false},"assignees":[{"login":"ivanayov","id":4160133,"node_id":"MDQ6VXNlcjQxNjAxMzM=","avatar_url":"https://avatars3.githubusercontent.com/u/4160133?v=4","gravatar_id":"","url":"https://api.github.com/users/ivanayov","html_url":"https://github.com/ivanayov","followers_url":"https://api.github.com/users/ivanayov/followers","following_url":"https://api.github.com/users/ivanayov/following{/other_user}","gists_url":"https://api.github.com/users/ivanayov/gists{/gist_id}","starred_url":"https://api.github.com/users/ivanayov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ivanayov/subscriptions","organizations_url":"https://api.github.com/users/ivanayov/orgs","repos_url":"https://api.github.com/users/ivanayov/repos","events_url":"https://api.github.com/users/ivanayov/events{/privacy}","received_events_url":"https://api.github.com/users/ivanayov/received_events","type":"User","site_admin":false}],"milestone":null,"comments":4,"created_at":"2018-08-10T06:27:00Z","updated_at":"2018-08-16T07:56:59Z","closed_at":null,"author_association":"NONE","body":"<!--- Provide a general summary of the issue in the Title above -->\r\n\r\n## Expected Behaviour\r\n<!--- If you're describing a bug, tell us what should happen -->\r\n<!--- If you're suggesting a change/improvement, tell us how it should work -->\r\nWhen an async-fucntion call is made, the only way for the caller to track the function execution is through X-Callback-Url header. This is great for event driven architectures. But if the caller wants to track (i.e., correlate) the result of individual function calls with the actual calls, it seems the only way is to embed the tracking information (uuid) within the request body of the async call or its header. This feature request is to enable including the X-Call-Id header the default behavior for async-fucntion calls as well. The X-Call-Id can then be included in the response to the async caller along with the http.StatusAccepted header. It can also be included in the call to X-Callback-Url, which then will enable correlating the function calls and their results.\r\n\r\n## Current Behaviour\r\n<!--- If describing a bug, tell us what happens instead of the expected behavior -->\r\n<!--- If suggesting a change/improvement, explain the difference from current behavior -->\r\nUpon an async call, the caller receives http.StatusAccepted header and no other information to be able to track this instance of the function call.\r\n\r\n## Possible Solution\r\n<!--- Not obligatory, but suggest a fix/reason for the bug, -->\r\n<!--- or ideas how to implement the addition or change -->\r\nThe following single line addition in faas/gateway/server.go can enable this feature:\r\n`faasHandlers.QueuedProxy = handlers.MakeCallIDMiddleware(faasHandlers.QueuedProxy)`\r\n\r\n## Context\r\n<!--- How has this issue affected you? What are you trying to accomplish? -->\r\n<!--- Providing context helps us come up with a solution that is most useful in the real world -->\r\nCorrelating the requests and responses for long running function calls (which are made through async calls) is a critical feature for enabling observability in analytics and data processing workloads. These workloads are not necessarily event-driven and are designed to follow the transformation of the data. X-Call-Id in combination with X-Callback-Url can enable such observability under these workloads."},"comment":{"url":"https://api.github.com/repos/openfaas/faas/issues/comments/413459221","html_url":"https://github.com/openfaas/faas/issues/813#issuecomment-413459221","issue_url":"https://api.github.com/repos/openfaas/faas/issues/813","id":413459221,"node_id":"MDEyOklzc3VlQ29tbWVudDQxMzQ1OTIyMQ==","user":{"login":"alexellis","id":6358735,"node_id":"MDQ6VXNlcjYzNTg3MzU=","avatar_url":"https://avatars1.githubusercontent.com/u/6358735?v=4","gravatar_id":"","url":"https://api.github.com/users/alexellis","html_url":"https://github.com/alexellis","followers_url":"https://api.github.com/users/alexellis/followers","following_url":"https://api.github.com/users/alexellis/following{/other_user}","gists_url":"https://api.github.com/users/alexellis/gists{/gist_id}","starred_url":"https://api.github.com/users/alexellis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexellis/subscriptions","organizations_url":"https://api.github.com/users/alexellis/orgs","repos_url":"https://api.github.com/users/alexellis/repos","events_url":"https://api.github.com/users/alexellis/events{/privacy}","received_events_url":"https://api.github.com/users/alexellis/received_events","type":"User","site_admin":false},"created_at":"2018-08-16T07:56:59Z","updated_at":"2018-08-16T07:56:59Z","author_association":"MEMBER","body":"@ivanayov what's your ETA on this? Thanks"}}
{"actor":{"display_login":"alexellis"}}