{"action":"created","comment":{"url":"https://api.github.com/repos/opentracing-contrib/go-stdlib/pulls/comments/171789782","pull_request_review_id":100705209,"id":171789782,"diff_hunk":"@@ -62,7 +62,31 @@ func MWComponentName(componentName string) MWOption {\n //\t        return \"HTTP \" + r.Method + \":/api/customers\"\n //      }),\n //   )\n+//\n+// MiddlewareWithSpan could add additional tag to the span.\n+// The options allow fine tuning the behavior of the middleware.\n+//\n+// Example:\n+//   mw := nethttp.MiddlewareWithSpan(\n+// \t\ttm.tracer,\n+// \t\thandler,\n+// \t\t[]nethttp.AdditionalSpan{\n+// \t\t\tfunc(r *http.Request) (string, string) {\n+// \t\t\t\treturn \"http.URI\", r.URL.EscapedPath()\n+// \t\t\t},\n+// \t\t},\n+// \t\tnethttp.OperationNameFunc(func(r *http.Request) string {\n+// \t\t\treturn \"HTTP \" + r.Method + \" \" + pattern\n+// \t\t}))\n+\n func Middleware(tr opentracing.Tracer, h http.Handler, options ...MWOption) http.Handler {\n+\tvar noneAdditionnalTag []AdditionalTag\n+\treturn MiddlewareWithTag(tr, h, noneAdditionnalTag, options...)\n+}\n+\n+type AdditionalTag func(r *http.Request) (string, string)\n+\n+func MiddlewareWithTag(tr opentracing.Tracer, h http.Handler, additionalTag []AdditionalTag, options ...MWOption) http.Handler {","path":"nethttp/server.go","position":null,"original_position":28,"commit_id":"ba8293b57c520ec3bf2935bc2707cdad46a0f3a5","original_commit_id":"08158ad488d8e2ec748510ef2534c4e7c02ec958","user":{"login":"ianwoolf","id":12888858,"avatar_url":"https://avatars2.githubusercontent.com/u/12888858?v=4","gravatar_id":"","url":"https://api.github.com/users/ianwoolf","html_url":"https://github.com/ianwoolf","followers_url":"https://api.github.com/users/ianwoolf/followers","following_url":"https://api.github.com/users/ianwoolf/following{/other_user}","gists_url":"https://api.github.com/users/ianwoolf/gists{/gist_id}","starred_url":"https://api.github.com/users/ianwoolf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ianwoolf/subscriptions","organizations_url":"https://api.github.com/users/ianwoolf/orgs","repos_url":"https://api.github.com/users/ianwoolf/repos","events_url":"https://api.github.com/users/ianwoolf/events{/privacy}","received_events_url":"https://api.github.com/users/ianwoolf/received_events","type":"User","site_admin":false},"body":"Is this ok?  Just take request and span as input, do anything in the function option.   \r\n\r\nOr taking MWOption type of parameter to set tag to the span is better?","created_at":"2018-03-02T08:44:42Z","updated_at":"2018-03-02T08:44:42Z","html_url":"https://github.com/opentracing-contrib/go-stdlib/pull/18#discussion_r171789782","pull_request_url":"https://api.github.com/repos/opentracing-contrib/go-stdlib/pulls/18","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/opentracing-contrib/go-stdlib/pulls/comments/171789782"},"html":{"href":"https://github.com/opentracing-contrib/go-stdlib/pull/18#discussion_r171789782"},"pull_request":{"href":"https://api.github.com/repos/opentracing-contrib/go-stdlib/pulls/18"}},"in_reply_to_id":171614318},"pull_request":{"url":"https://api.github.com/repos/opentracing-contrib/go-stdlib/pulls/18","id":172205899,"html_url":"https://github.com/opentracing-contrib/go-stdlib/pull/18","diff_url":"https://github.com/opentracing-contrib/go-stdlib/pull/18.diff","patch_url":"https://github.com/opentracing-contrib/go-stdlib/pull/18.patch","issue_url":"https://api.github.com/repos/opentracing-contrib/go-stdlib/issues/18","number":18,"state":"open","locked":false,"title":"add additional tag to Middleware for analysis and statistics","user":{"login":"ianwoolf","id":12888858,"avatar_url":"https://avatars2.githubusercontent.com/u/12888858?v=4","gravatar_id":"","url":"https://api.github.com/users/ianwoolf","html_url":"https://github.com/ianwoolf","followers_url":"https://api.github.com/users/ianwoolf/followers","following_url":"https://api.github.com/users/ianwoolf/following{/other_user}","gists_url":"https://api.github.com/users/ianwoolf/gists{/gist_id}","starred_url":"https://api.github.com/users/ianwoolf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ianwoolf/subscriptions","organizations_url":"https://api.github.com/users/ianwoolf/orgs","repos_url":"https://api.github.com/users/ianwoolf/repos","events_url":"https://api.github.com/users/ianwoolf/events{/privacy}","received_events_url":"https://api.github.com/users/ianwoolf/received_events","type":"User","site_admin":false},"body":"issue #17 ","created_at":"2018-03-01T11:05:09Z","updated_at":"2018-03-02T08:44:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"037a7b1a8acda25c1426b6a26e3e0d5faed0c575","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/opentracing-contrib/go-stdlib/pulls/18/commits","review_comments_url":"https://api.github.com/repos/opentracing-contrib/go-stdlib/pulls/18/comments","review_comment_url":"https://api.github.com/repos/opentracing-contrib/go-stdlib/pulls/comments{/number}","comments_url":"https://api.github.com/repos/opentracing-contrib/go-stdlib/issues/18/comments","statuses_url":"https://api.github.com/repos/opentracing-contrib/go-stdlib/statuses/ba8293b57c520ec3bf2935bc2707cdad46a0f3a5","head":{"label":"ianwoolf:pr-update-tag","ref":"pr-update-tag","sha":"ba8293b57c520ec3bf2935bc2707cdad46a0f3a5","user":{"login":"ianwoolf","id":12888858,"avatar_url":"https://avatars2.githubusercontent.com/u/12888858?v=4","gravatar_id":"","url":"https://api.github.com/users/ianwoolf","html_url":"https://github.com/ianwoolf","followers_url":"https://api.github.com/users/ianwoolf/followers","following_url":"https://api.github.com/users/ianwoolf/following{/other_user}","gists_url":"https://api.github.com/users/ianwoolf/gists{/gist_id}","starred_url":"https://api.github.com/users/ianwoolf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ianwoolf/subscriptions","organizations_url":"https://api.github.com/users/ianwoolf/orgs","repos_url":"https://api.github.com/users/ianwoolf/repos","events_url":"https://api.github.com/users/ianwoolf/events{/privacy}","received_events_url":"https://api.github.com/users/ianwoolf/received_events","type":"User","site_admin":false},"repo":{"id":122896821,"name":"go-stdlib","full_name":"ianwoolf/go-stdlib","owner":{"login":"ianwoolf","id":12888858,"avatar_url":"https://avatars2.githubusercontent.com/u/12888858?v=4","gravatar_id":"","url":"https://api.github.com/users/ianwoolf","html_url":"https://github.com/ianwoolf","followers_url":"https://api.github.com/users/ianwoolf/followers","following_url":"https://api.github.com/users/ianwoolf/following{/other_user}","gists_url":"https://api.github.com/users/ianwoolf/gists{/gist_id}","starred_url":"https://api.github.com/users/ianwoolf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ianwoolf/subscriptions","organizations_url":"https://api.github.com/users/ianwoolf/orgs","repos_url":"https://api.github.com/users/ianwoolf/repos","events_url":"https://api.github.com/users/ianwoolf/events{/privacy}","received_events_url":"https://api.github.com/users/ianwoolf/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ianwoolf/go-stdlib","description":"OpenTracing instrumentation for packages in the Go stdlib","fork":true,"url":"https://api.github.com/repos/ianwoolf/go-stdlib","forks_url":"https://api.github.com/repos/ianwoolf/go-stdlib/forks","keys_url":"https://api.github.com/repos/ianwoolf/go-stdlib/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ianwoolf/go-stdlib/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ianwoolf/go-stdlib/teams","hooks_url":"https://api.github.com/repos/ianwoolf/go-stdlib/hooks","issue_events_url":"https://api.github.com/repos/ianwoolf/go-stdlib/issues/events{/number}","events_url":"https://api.github.com/repos/ianwoolf/go-stdlib/events","assignees_url":"https://api.github.com/repos/ianwoolf/go-stdlib/assignees{/user}","branches_url":"https://api.github.com/repos/ianwoolf/go-stdlib/branches{/branch}","tags_url":"https://api.github.com/repos/ianwoolf/go-stdlib/tags","blobs_url":"https://api.github.com/repos/ianwoolf/go-stdlib/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ianwoolf/go-stdlib/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ianwoolf/go-stdlib/git/refs{/sha}","trees_url":"https://api.github.com/repos/ianwoolf/go-stdlib/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ianwoolf/go-stdlib/statuses/{sha}","languages_url":"https://api.github.com/repos/ianwoolf/go-stdlib/languages","stargazers_url":"https://api.github.com/repos/ianwoolf/go-stdlib/stargazers","contributors_url":"https://api.github.com/repos/ianwoolf/go-stdlib/contributors","subscribers_url":"https://api.github.com/repos/ianwoolf/go-stdlib/subscribers","subscription_url":"https://api.github.com/repos/ianwoolf/go-stdlib/subscription","commits_url":"https://api.github.com/repos/ianwoolf/go-stdlib/commits{/sha}","git_commits_url":"https://api.github.com/repos/ianwoolf/go-stdlib/git/commits{/sha}","comments_url":"https://api.github.com/repos/ianwoolf/go-stdlib/comments{/number}","issue_comment_url":"https://api.github.com/repos/ianwoolf/go-stdlib/issues/comments{/number}","contents_url":"https://api.github.com/repos/ianwoolf/go-stdlib/contents/{+path}","compare_url":"https://api.github.com/repos/ianwoolf/go-stdlib/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ianwoolf/go-stdlib/merges","archive_url":"https://api.github.com/repos/ianwoolf/go-stdlib/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ianwoolf/go-stdlib/downloads","issues_url":"https://api.github.com/repos/ianwoolf/go-stdlib/issues{/number}","pulls_url":"https://api.github.com/repos/ianwoolf/go-stdlib/pulls{/number}","milestones_url":"https://api.github.com/repos/ianwoolf/go-stdlib/milestones{/number}","notifications_url":"https://api.github.com/repos/ianwoolf/go-stdlib/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ianwoolf/go-stdlib/labels{/name}","releases_url":"https://api.github.com/repos/ianwoolf/go-stdlib/releases{/id}","deployments_url":"https://api.github.com/repos/ianwoolf/go-stdlib/deployments","created_at":"2018-02-26T01:39:46Z","updated_at":"2018-02-26T01:39:48Z","pushed_at":"2018-03-02T02:42:24Z","git_url":"git://github.com/ianwoolf/go-stdlib.git","ssh_url":"git@github.com:ianwoolf/go-stdlib.git","clone_url":"https://github.com/ianwoolf/go-stdlib.git","svn_url":"https://github.com/ianwoolf/go-stdlib","homepage":null,"size":26,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"opentracing-contrib:master","ref":"master","sha":"b1a47cfbdd7543e70e9ef3e73d0802ad306cc1cc","user":{"login":"opentracing-contrib","id":20525934,"avatar_url":"https://avatars0.githubusercontent.com/u/20525934?v=4","gravatar_id":"","url":"https://api.github.com/users/opentracing-contrib","html_url":"https://github.com/opentracing-contrib","followers_url":"https://api.github.com/users/opentracing-contrib/followers","following_url":"https://api.github.com/users/opentracing-contrib/following{/other_user}","gists_url":"https://api.github.com/users/opentracing-contrib/gists{/gist_id}","starred_url":"https://api.github.com/users/opentracing-contrib/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opentracing-contrib/subscriptions","organizations_url":"https://api.github.com/users/opentracing-contrib/orgs","repos_url":"https://api.github.com/users/opentracing-contrib/repos","events_url":"https://api.github.com/users/opentracing-contrib/events{/privacy}","received_events_url":"https://api.github.com/users/opentracing-contrib/received_events","type":"Organization","site_admin":false},"repo":{"id":63816350,"name":"go-stdlib","full_name":"opentracing-contrib/go-stdlib","owner":{"login":"opentracing-contrib","id":20525934,"avatar_url":"https://avatars0.githubusercontent.com/u/20525934?v=4","gravatar_id":"","url":"https://api.github.com/users/opentracing-contrib","html_url":"https://github.com/opentracing-contrib","followers_url":"https://api.github.com/users/opentracing-contrib/followers","following_url":"https://api.github.com/users/opentracing-contrib/following{/other_user}","gists_url":"https://api.github.com/users/opentracing-contrib/gists{/gist_id}","starred_url":"https://api.github.com/users/opentracing-contrib/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opentracing-contrib/subscriptions","organizations_url":"https://api.github.com/users/opentracing-contrib/orgs","repos_url":"https://api.github.com/users/opentracing-contrib/repos","events_url":"https://api.github.com/users/opentracing-contrib/events{/privacy}","received_events_url":"https://api.github.com/users/opentracing-contrib/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/opentracing-contrib/go-stdlib","description":"OpenTracing instrumentation for packages in the Go stdlib","fork":false,"url":"https://api.github.com/repos/opentracing-contrib/go-stdlib","forks_url":"https://api.github.com/repos/opentracing-contrib/go-stdlib/forks","keys_url":"https://api.github.com/repos/opentracing-contrib/go-stdlib/keys{/key_id}","collaborators_url":"https://api.github.com/repos/opentracing-contrib/go-stdlib/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/opentracing-contrib/go-stdlib/teams","hooks_url":"https://api.github.com/repos/opentracing-contrib/go-stdlib/hooks","issue_events_url":"https://api.github.com/repos/opentracing-contrib/go-stdlib/issues/events{/number}","events_url":"https://api.github.com/repos/opentracing-contrib/go-stdlib/events","assignees_url":"https://api.github.com/repos/opentracing-contrib/go-stdlib/assignees{/user}","branches_url":"https://api.github.com/repos/opentracing-contrib/go-stdlib/branches{/branch}","tags_url":"https://api.github.com/repos/opentracing-contrib/go-stdlib/tags","blobs_url":"https://api.github.com/repos/opentracing-contrib/go-stdlib/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/opentracing-contrib/go-stdlib/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/opentracing-contrib/go-stdlib/git/refs{/sha}","trees_url":"https://api.github.com/repos/opentracing-contrib/go-stdlib/git/trees{/sha}","statuses_url":"https://api.github.com/repos/opentracing-contrib/go-stdlib/statuses/{sha}","languages_url":"https://api.github.com/repos/opentracing-contrib/go-stdlib/languages","stargazers_url":"https://api.github.com/repos/opentracing-contrib/go-stdlib/stargazers","contributors_url":"https://api.github.com/repos/opentracing-contrib/go-stdlib/contributors","subscribers_url":"https://api.github.com/repos/opentracing-contrib/go-stdlib/subscribers","subscription_url":"https://api.github.com/repos/opentracing-contrib/go-stdlib/subscription","commits_url":"https://api.github.com/repos/opentracing-contrib/go-stdlib/commits{/sha}","git_commits_url":"https://api.github.com/repos/opentracing-contrib/go-stdlib/git/commits{/sha}","comments_url":"https://api.github.com/repos/opentracing-contrib/go-stdlib/comments{/number}","issue_comment_url":"https://api.github.com/repos/opentracing-contrib/go-stdlib/issues/comments{/number}","contents_url":"https://api.github.com/repos/opentracing-contrib/go-stdlib/contents/{+path}","compare_url":"https://api.github.com/repos/opentracing-contrib/go-stdlib/compare/{base}...{head}","merges_url":"https://api.github.com/repos/opentracing-contrib/go-stdlib/merges","archive_url":"https://api.github.com/repos/opentracing-contrib/go-stdlib/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/opentracing-contrib/go-stdlib/downloads","issues_url":"https://api.github.com/repos/opentracing-contrib/go-stdlib/issues{/number}","pulls_url":"https://api.github.com/repos/opentracing-contrib/go-stdlib/pulls{/number}","milestones_url":"https://api.github.com/repos/opentracing-contrib/go-stdlib/milestones{/number}","notifications_url":"https://api.github.com/repos/opentracing-contrib/go-stdlib/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/opentracing-contrib/go-stdlib/labels{/name}","releases_url":"https://api.github.com/repos/opentracing-contrib/go-stdlib/releases{/id}","deployments_url":"https://api.github.com/repos/opentracing-contrib/go-stdlib/deployments","created_at":"2016-07-20T21:38:32Z","updated_at":"2018-03-02T05:51:28Z","pushed_at":"2018-03-02T02:42:25Z","git_url":"git://github.com/opentracing-contrib/go-stdlib.git","ssh_url":"git@github.com:opentracing-contrib/go-stdlib.git","clone_url":"https://github.com/opentracing-contrib/go-stdlib.git","svn_url":"https://github.com/opentracing-contrib/go-stdlib","homepage":null,"size":25,"stargazers_count":67,"watchers_count":67,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":15,"mirror_url":null,"archived":false,"open_issues_count":5,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause"},"forks":15,"open_issues":5,"watchers":67,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/opentracing-contrib/go-stdlib/pulls/18"},"html":{"href":"https://github.com/opentracing-contrib/go-stdlib/pull/18"},"issue":{"href":"https://api.github.com/repos/opentracing-contrib/go-stdlib/issues/18"},"comments":{"href":"https://api.github.com/repos/opentracing-contrib/go-stdlib/issues/18/comments"},"review_comments":{"href":"https://api.github.com/repos/opentracing-contrib/go-stdlib/pulls/18/comments"},"review_comment":{"href":"https://api.github.com/repos/opentracing-contrib/go-stdlib/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/opentracing-contrib/go-stdlib/pulls/18/commits"},"statuses":{"href":"https://api.github.com/repos/opentracing-contrib/go-stdlib/statuses/ba8293b57c520ec3bf2935bc2707cdad46a0f3a5"}},"author_association":"NONE"}}
{"actor":{"display_login":"ianwoolf"}}