{"action":"created","comment":{"url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/pulls/comments/81619943","pull_request_review_id":2586912,"id":81619943,"diff_hunk":"@@ -0,0 +1,22 @@\n+﻿// Copyright (c) .NET Foundation. All rights reserved.\n+// Licensed under the MIT License. See License.txt in the project root for license information.\n+\n+using System;\n+using Microsoft.Azure.WebJobs.Host.Protocols;\n+\n+namespace Microsoft.Azure.WebJobs.Host\n+{\n+    internal static class TraceEventExtensions\n+    {\n+        private const string FunctionDescriptorKey = \"MS_FunctionDescriptor\";\n+        private const string FunctionInvocationIdKey = \"MS_FunctionInvocationId\";\n+        private const string HostIdKey = \"MS_HostId\";\n+\n+        public static void AddFunctionInstanceDetails(this TraceEvent traceEvent, Guid hostId, FunctionDescriptor descriptor, Guid functionId)\n+        {\n+            traceEvent.Properties[HostIdKey] = hostId;\n+            traceEvent.Properties[FunctionDescriptorKey] = descriptor;","path":"src/Microsoft.Azure.WebJobs.Host/Loggers/TraceEventExtensions.cs","position":18,"original_position":18,"commit_id":"425d51275e31890e2a832b1e74b9f6ea3a2bb853","original_commit_id":"425d51275e31890e2a832b1e74b9f6ea3a2bb853","user":{"login":"brettsam","id":1089915,"avatar_url":"https://avatars.githubusercontent.com/u/1089915?v=3","gravatar_id":"","url":"https://api.github.com/users/brettsam","html_url":"https://github.com/brettsam","followers_url":"https://api.github.com/users/brettsam/followers","following_url":"https://api.github.com/users/brettsam/following{/other_user}","gists_url":"https://api.github.com/users/brettsam/gists{/gist_id}","starred_url":"https://api.github.com/users/brettsam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brettsam/subscriptions","organizations_url":"https://api.github.com/users/brettsam/orgs","repos_url":"https://api.github.com/users/brettsam/repos","events_url":"https://api.github.com/users/brettsam/events{/privacy}","received_events_url":"https://api.github.com/users/brettsam/received_events","type":"User","site_admin":false},"body":"Yeah it's public. It includes a few other things that someone may want -- I didn't have a good reason to restrict them: https://github.com/Azure/azure-webjobs-sdk/blob/master/src/Microsoft.Azure.WebJobs.Protocols/FunctionDescriptor.cs","created_at":"2016-10-03T19:16:51Z","updated_at":"2016-10-03T19:16:51Z","html_url":"https://github.com/Azure/azure-webjobs-sdk/pull/854#discussion_r81619943","pull_request_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/pulls/854","_links":{"self":{"href":"https://api.github.com/repos/Azure/azure-webjobs-sdk/pulls/comments/81619943"},"html":{"href":"https://github.com/Azure/azure-webjobs-sdk/pull/854#discussion_r81619943"},"pull_request":{"href":"https://api.github.com/repos/Azure/azure-webjobs-sdk/pulls/854"}}},"pull_request":{"url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/pulls/854","id":87394885,"html_url":"https://github.com/Azure/azure-webjobs-sdk/pull/854","diff_url":"https://github.com/Azure/azure-webjobs-sdk/pull/854.diff","patch_url":"https://github.com/Azure/azure-webjobs-sdk/pull/854.patch","issue_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/issues/854","number":854,"state":"open","locked":false,"title":"injecting function details into TraceEvent.Properties","user":{"login":"brettsam","id":1089915,"avatar_url":"https://avatars.githubusercontent.com/u/1089915?v=3","gravatar_id":"","url":"https://api.github.com/users/brettsam","html_url":"https://github.com/brettsam","followers_url":"https://api.github.com/users/brettsam/followers","following_url":"https://api.github.com/users/brettsam/following{/other_user}","gists_url":"https://api.github.com/users/brettsam/gists{/gist_id}","starred_url":"https://api.github.com/users/brettsam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brettsam/subscriptions","organizations_url":"https://api.github.com/users/brettsam/orgs","repos_url":"https://api.github.com/users/brettsam/repos","events_url":"https://api.github.com/users/brettsam/events{/privacy}","received_events_url":"https://api.github.com/users/brettsam/received_events","type":"User","site_admin":false},"body":"For #774 and #784.\r\n\r\n@mathewc -- The tests are not ready yet but wanted a quick review of the approach here. This adds the hostId, instanceId, and functionDescriptor values to the Properties collection in both our `TraceWriterFunctionInstanceLogger` and the `TraceWriter` we pass to the function itself.\r\n\r\nI investigated including the trigger object as well. I could inject the *object* fairly easily with the `TraceWriter` that we pass as a parameter to functions. And I can include the *string* from `ToInvokeString()` with the `TraceWriterFunctionInstanceLogger`, but that felt odd to have one form in one message and another elsewhere. I'll keep looking into that.","created_at":"2016-09-29T21:11:33Z","updated_at":"2016-10-03T19:16:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"56d514da8f27abb9c3c4179fbedf7d5ee8514bc2","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/pulls/854/commits","review_comments_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/pulls/854/comments","review_comment_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/issues/854/comments","statuses_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/statuses/425d51275e31890e2a832b1e74b9f6ea3a2bb853","head":{"label":"brettsam:trace","ref":"trace","sha":"425d51275e31890e2a832b1e74b9f6ea3a2bb853","user":{"login":"brettsam","id":1089915,"avatar_url":"https://avatars.githubusercontent.com/u/1089915?v=3","gravatar_id":"","url":"https://api.github.com/users/brettsam","html_url":"https://github.com/brettsam","followers_url":"https://api.github.com/users/brettsam/followers","following_url":"https://api.github.com/users/brettsam/following{/other_user}","gists_url":"https://api.github.com/users/brettsam/gists{/gist_id}","starred_url":"https://api.github.com/users/brettsam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brettsam/subscriptions","organizations_url":"https://api.github.com/users/brettsam/orgs","repos_url":"https://api.github.com/users/brettsam/repos","events_url":"https://api.github.com/users/brettsam/events{/privacy}","received_events_url":"https://api.github.com/users/brettsam/received_events","type":"User","site_admin":false},"repo":{"id":52930359,"name":"azure-webjobs-sdk","full_name":"brettsam/azure-webjobs-sdk","owner":{"login":"brettsam","id":1089915,"avatar_url":"https://avatars.githubusercontent.com/u/1089915?v=3","gravatar_id":"","url":"https://api.github.com/users/brettsam","html_url":"https://github.com/brettsam","followers_url":"https://api.github.com/users/brettsam/followers","following_url":"https://api.github.com/users/brettsam/following{/other_user}","gists_url":"https://api.github.com/users/brettsam/gists{/gist_id}","starred_url":"https://api.github.com/users/brettsam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brettsam/subscriptions","organizations_url":"https://api.github.com/users/brettsam/orgs","repos_url":"https://api.github.com/users/brettsam/repos","events_url":"https://api.github.com/users/brettsam/events{/privacy}","received_events_url":"https://api.github.com/users/brettsam/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/brettsam/azure-webjobs-sdk","description":"Azure WebJobs SDK","fork":true,"url":"https://api.github.com/repos/brettsam/azure-webjobs-sdk","forks_url":"https://api.github.com/repos/brettsam/azure-webjobs-sdk/forks","keys_url":"https://api.github.com/repos/brettsam/azure-webjobs-sdk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/brettsam/azure-webjobs-sdk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/brettsam/azure-webjobs-sdk/teams","hooks_url":"https://api.github.com/repos/brettsam/azure-webjobs-sdk/hooks","issue_events_url":"https://api.github.com/repos/brettsam/azure-webjobs-sdk/issues/events{/number}","events_url":"https://api.github.com/repos/brettsam/azure-webjobs-sdk/events","assignees_url":"https://api.github.com/repos/brettsam/azure-webjobs-sdk/assignees{/user}","branches_url":"https://api.github.com/repos/brettsam/azure-webjobs-sdk/branches{/branch}","tags_url":"https://api.github.com/repos/brettsam/azure-webjobs-sdk/tags","blobs_url":"https://api.github.com/repos/brettsam/azure-webjobs-sdk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/brettsam/azure-webjobs-sdk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/brettsam/azure-webjobs-sdk/git/refs{/sha}","trees_url":"https://api.github.com/repos/brettsam/azure-webjobs-sdk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/brettsam/azure-webjobs-sdk/statuses/{sha}","languages_url":"https://api.github.com/repos/brettsam/azure-webjobs-sdk/languages","stargazers_url":"https://api.github.com/repos/brettsam/azure-webjobs-sdk/stargazers","contributors_url":"https://api.github.com/repos/brettsam/azure-webjobs-sdk/contributors","subscribers_url":"https://api.github.com/repos/brettsam/azure-webjobs-sdk/subscribers","subscription_url":"https://api.github.com/repos/brettsam/azure-webjobs-sdk/subscription","commits_url":"https://api.github.com/repos/brettsam/azure-webjobs-sdk/commits{/sha}","git_commits_url":"https://api.github.com/repos/brettsam/azure-webjobs-sdk/git/commits{/sha}","comments_url":"https://api.github.com/repos/brettsam/azure-webjobs-sdk/comments{/number}","issue_comment_url":"https://api.github.com/repos/brettsam/azure-webjobs-sdk/issues/comments{/number}","contents_url":"https://api.github.com/repos/brettsam/azure-webjobs-sdk/contents/{+path}","compare_url":"https://api.github.com/repos/brettsam/azure-webjobs-sdk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/brettsam/azure-webjobs-sdk/merges","archive_url":"https://api.github.com/repos/brettsam/azure-webjobs-sdk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/brettsam/azure-webjobs-sdk/downloads","issues_url":"https://api.github.com/repos/brettsam/azure-webjobs-sdk/issues{/number}","pulls_url":"https://api.github.com/repos/brettsam/azure-webjobs-sdk/pulls{/number}","milestones_url":"https://api.github.com/repos/brettsam/azure-webjobs-sdk/milestones{/number}","notifications_url":"https://api.github.com/repos/brettsam/azure-webjobs-sdk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/brettsam/azure-webjobs-sdk/labels{/name}","releases_url":"https://api.github.com/repos/brettsam/azure-webjobs-sdk/releases{/id}","deployments_url":"https://api.github.com/repos/brettsam/azure-webjobs-sdk/deployments","created_at":"2016-03-02T03:26:09Z","updated_at":"2016-03-02T03:26:14Z","pushed_at":"2016-09-30T22:02:58Z","git_url":"git://github.com/brettsam/azure-webjobs-sdk.git","ssh_url":"git@github.com:brettsam/azure-webjobs-sdk.git","clone_url":"https://github.com/brettsam/azure-webjobs-sdk.git","svn_url":"https://github.com/brettsam/azure-webjobs-sdk","homepage":"","size":11940,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Azure:master","ref":"master","sha":"196375ce9a0ffca67380abd3eb869f69abbe6597","user":{"login":"Azure","id":6844498,"avatar_url":"https://avatars.githubusercontent.com/u/6844498?v=3","gravatar_id":"","url":"https://api.github.com/users/Azure","html_url":"https://github.com/Azure","followers_url":"https://api.github.com/users/Azure/followers","following_url":"https://api.github.com/users/Azure/following{/other_user}","gists_url":"https://api.github.com/users/Azure/gists{/gist_id}","starred_url":"https://api.github.com/users/Azure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Azure/subscriptions","organizations_url":"https://api.github.com/users/Azure/orgs","repos_url":"https://api.github.com/users/Azure/repos","events_url":"https://api.github.com/users/Azure/events{/privacy}","received_events_url":"https://api.github.com/users/Azure/received_events","type":"Organization","site_admin":false},"repo":{"id":21712185,"name":"azure-webjobs-sdk","full_name":"Azure/azure-webjobs-sdk","owner":{"login":"Azure","id":6844498,"avatar_url":"https://avatars.githubusercontent.com/u/6844498?v=3","gravatar_id":"","url":"https://api.github.com/users/Azure","html_url":"https://github.com/Azure","followers_url":"https://api.github.com/users/Azure/followers","following_url":"https://api.github.com/users/Azure/following{/other_user}","gists_url":"https://api.github.com/users/Azure/gists{/gist_id}","starred_url":"https://api.github.com/users/Azure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Azure/subscriptions","organizations_url":"https://api.github.com/users/Azure/orgs","repos_url":"https://api.github.com/users/Azure/repos","events_url":"https://api.github.com/users/Azure/events{/privacy}","received_events_url":"https://api.github.com/users/Azure/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Azure/azure-webjobs-sdk","description":"Azure WebJobs SDK","fork":false,"url":"https://api.github.com/repos/Azure/azure-webjobs-sdk","forks_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/forks","keys_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/teams","hooks_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/hooks","issue_events_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/issues/events{/number}","events_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/events","assignees_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/assignees{/user}","branches_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/branches{/branch}","tags_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/tags","blobs_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/git/refs{/sha}","trees_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/statuses/{sha}","languages_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/languages","stargazers_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/stargazers","contributors_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/contributors","subscribers_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/subscribers","subscription_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/subscription","commits_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/commits{/sha}","git_commits_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/git/commits{/sha}","comments_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/comments{/number}","issue_comment_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/issues/comments{/number}","contents_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/contents/{+path}","compare_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/merges","archive_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/downloads","issues_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/issues{/number}","pulls_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/pulls{/number}","milestones_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/milestones{/number}","notifications_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/labels{/name}","releases_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/releases{/id}","deployments_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/deployments","created_at":"2014-07-10T22:15:31Z","updated_at":"2016-09-28T13:58:48Z","pushed_at":"2016-10-03T18:19:53Z","git_url":"git://github.com/Azure/azure-webjobs-sdk.git","ssh_url":"git@github.com:Azure/azure-webjobs-sdk.git","clone_url":"https://github.com/Azure/azure-webjobs-sdk.git","svn_url":"https://github.com/Azure/azure-webjobs-sdk","homepage":"","size":12253,"stargazers_count":145,"watchers_count":145,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":63,"mirror_url":null,"open_issues_count":198,"forks":63,"open_issues":198,"watchers":145,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Azure/azure-webjobs-sdk/pulls/854"},"html":{"href":"https://github.com/Azure/azure-webjobs-sdk/pull/854"},"issue":{"href":"https://api.github.com/repos/Azure/azure-webjobs-sdk/issues/854"},"comments":{"href":"https://api.github.com/repos/Azure/azure-webjobs-sdk/issues/854/comments"},"review_comments":{"href":"https://api.github.com/repos/Azure/azure-webjobs-sdk/pulls/854/comments"},"review_comment":{"href":"https://api.github.com/repos/Azure/azure-webjobs-sdk/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Azure/azure-webjobs-sdk/pulls/854/commits"},"statuses":{"href":"https://api.github.com/repos/Azure/azure-webjobs-sdk/statuses/425d51275e31890e2a832b1e74b9f6ea3a2bb853"}}}}
{"actor":{"display_login":"brettsam"}}