{"action":"created","comment":{"url":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/pulls/comments/52978659","id":52978659,"diff_hunk":"@@ -1,67 +1,75 @@\n ﻿using System;\n using System.Runtime.CompilerServices;\n using log4net;\n-using Medidata.CrossApplicationTracer;\n using Medidata.ZipkinTracer.Core.Collector;\n \n namespace Medidata.ZipkinTracer.Core\n {\n     public class ZipkinClient: ITracerClient\n     {\n-        internal bool isTraceOn;\n         internal SpanCollector spanCollector;\n         internal SpanTracer spanTracer;\n \n-        private ITraceProvider traceProvider;\n         private ILog logger;\n+        public bool IsTraceOn { get; set; }\n+        public ITraceProvider TraceProvider { get; }\n+        public IZipkinConfig ZipkinConfig { get; }\n \n-        public ZipkinClient(ITraceProvider tracerProvider, ILog logger) : this(tracerProvider, logger, new ZipkinConfig(), new SpanCollectorBuilder()) { }\n+        public ZipkinClient(ITraceProvider tracerProvider, ILog logger, IZipkinConfig zipkinConfig)\n+            : this(tracerProvider, logger, zipkinConfig, new SpanCollectorBuilder()) { }\n \n-        public ZipkinClient(ITraceProvider traceProvider, ILog logger, IZipkinConfig zipkinConfig, ISpanCollectorBuilder spanCollectorBuilder)\n+        public ZipkinClient(ITraceProvider traceProvider, ILog logger, IZipkinConfig zipkinConfig,\n+            ISpanCollectorBuilder spanCollectorBuilder)\n         {\n-            this.logger = logger;\n+            if (traceProvider == null) throw new ArgumentNullException(nameof(traceProvider));\n+            if (logger == null) throw new ArgumentNullException(nameof(logger));\n+            if (zipkinConfig == null) throw new ArgumentNullException(nameof(zipkinConfig));\n+            if (spanCollectorBuilder == null) throw new ArgumentNullException(nameof(spanCollectorBuilder));\n \n-            isTraceOn = logger != null && IsConfigValuesValid(zipkinConfig) && IsTraceProviderValidAndSamplingOn(traceProvider);\n+            IsTraceOn = zipkinConfig.Enable && IsTraceProviderSamplingOn(traceProvider);\n \n-            if (!isTraceOn)\n+            if (!IsTraceOn)\n                 return;\n \n+            zipkinConfig.Validate();","path":"src/Medidata.ZipkinTracer.Core/ZipkinClient.cs","position":42,"original_position":42,"commit_id":"c9a4049dd353aa410b008913b540aa20e5e38a8e","original_commit_id":"c9a4049dd353aa410b008913b540aa20e5e38a8e","user":{"login":"bvillanueva-mdsol","id":10608964,"avatar_url":"https://avatars.githubusercontent.com/u/10608964?v=3","gravatar_id":"","url":"https://api.github.com/users/bvillanueva-mdsol","html_url":"https://github.com/bvillanueva-mdsol","followers_url":"https://api.github.com/users/bvillanueva-mdsol/followers","following_url":"https://api.github.com/users/bvillanueva-mdsol/following{/other_user}","gists_url":"https://api.github.com/users/bvillanueva-mdsol/gists{/gist_id}","starred_url":"https://api.github.com/users/bvillanueva-mdsol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bvillanueva-mdsol/subscriptions","organizations_url":"https://api.github.com/users/bvillanueva-mdsol/orgs","repos_url":"https://api.github.com/users/bvillanueva-mdsol/repos","events_url":"https://api.github.com/users/bvillanueva-mdsol/events{/privacy}","received_events_url":"https://api.github.com/users/bvillanueva-mdsol/received_events","type":"User","site_admin":false},"body":"Somehow Validate() here is the 2nd call when instantiated from ZipkinMiddleWare. We can call this once before ZipkinClient is instantiated.","created_at":"2016-02-16T08:14:03Z","updated_at":"2016-02-16T08:14:03Z","html_url":"https://github.com/mdsol/Medidata.ZipkinTracerModule/pull/77#discussion_r52978659","pull_request_url":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/pulls/77","_links":{"self":{"href":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/pulls/comments/52978659"},"html":{"href":"https://github.com/mdsol/Medidata.ZipkinTracerModule/pull/77#discussion_r52978659"},"pull_request":{"href":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/pulls/77"}}},"pull_request":{"url":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/pulls/77","id":59327922,"html_url":"https://github.com/mdsol/Medidata.ZipkinTracerModule/pull/77","diff_url":"https://github.com/mdsol/Medidata.ZipkinTracerModule/pull/77.diff","patch_url":"https://github.com/mdsol/Medidata.ZipkinTracerModule/pull/77.patch","issue_url":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/issues/77","number":77,"state":"open","locked":false,"title":"[MCC-203861] implement middleware and handler","user":{"login":"kenyamat","id":7456149,"avatar_url":"https://avatars.githubusercontent.com/u/7456149?v=3","gravatar_id":"","url":"https://api.github.com/users/kenyamat","html_url":"https://github.com/kenyamat","followers_url":"https://api.github.com/users/kenyamat/followers","following_url":"https://api.github.com/users/kenyamat/following{/other_user}","gists_url":"https://api.github.com/users/kenyamat/gists{/gist_id}","starred_url":"https://api.github.com/users/kenyamat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kenyamat/subscriptions","organizations_url":"https://api.github.com/users/kenyamat/orgs","repos_url":"https://api.github.com/users/kenyamat/repos","events_url":"https://api.github.com/users/kenyamat/events{/privacy}","received_events_url":"https://api.github.com/users/kenyamat/received_events","type":"User","site_admin":false},"body":"@lschreck-mdsol @bvillanueva-mdsol @mdsol/monitoring-sentinels create middleware and handler for zipkin. Please review.","created_at":"2016-02-15T07:13:12Z","updated_at":"2016-02-16T08:14:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0f19c655bec8c1e152607ad16f1f447f91e80f49","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/pulls/77/commits","review_comments_url":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/pulls/77/comments","review_comment_url":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/issues/77/comments","statuses_url":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/statuses/c9a4049dd353aa410b008913b540aa20e5e38a8e","head":{"label":"mdsol:feature/middleware","ref":"feature/middleware","sha":"c9a4049dd353aa410b008913b540aa20e5e38a8e","user":{"login":"mdsol","id":171103,"avatar_url":"https://avatars.githubusercontent.com/u/171103?v=3","gravatar_id":"","url":"https://api.github.com/users/mdsol","html_url":"https://github.com/mdsol","followers_url":"https://api.github.com/users/mdsol/followers","following_url":"https://api.github.com/users/mdsol/following{/other_user}","gists_url":"https://api.github.com/users/mdsol/gists{/gist_id}","starred_url":"https://api.github.com/users/mdsol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mdsol/subscriptions","organizations_url":"https://api.github.com/users/mdsol/orgs","repos_url":"https://api.github.com/users/mdsol/repos","events_url":"https://api.github.com/users/mdsol/events{/privacy}","received_events_url":"https://api.github.com/users/mdsol/received_events","type":"Organization","site_admin":false},"repo":{"id":21194896,"name":"Medidata.ZipkinTracerModule","full_name":"mdsol/Medidata.ZipkinTracerModule","owner":{"login":"mdsol","id":171103,"avatar_url":"https://avatars.githubusercontent.com/u/171103?v=3","gravatar_id":"","url":"https://api.github.com/users/mdsol","html_url":"https://github.com/mdsol","followers_url":"https://api.github.com/users/mdsol/followers","following_url":"https://api.github.com/users/mdsol/following{/other_user}","gists_url":"https://api.github.com/users/mdsol/gists{/gist_id}","starred_url":"https://api.github.com/users/mdsol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mdsol/subscriptions","organizations_url":"https://api.github.com/users/mdsol/orgs","repos_url":"https://api.github.com/users/mdsol/repos","events_url":"https://api.github.com/users/mdsol/events{/privacy}","received_events_url":"https://api.github.com/users/mdsol/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mdsol/Medidata.ZipkinTracerModule","description":"Zipkin Request Tracing for .Net Apps","fork":false,"url":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule","forks_url":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/forks","keys_url":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/teams","hooks_url":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/hooks","issue_events_url":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/issues/events{/number}","events_url":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/events","assignees_url":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/assignees{/user}","branches_url":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/branches{/branch}","tags_url":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/tags","blobs_url":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/git/refs{/sha}","trees_url":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/statuses/{sha}","languages_url":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/languages","stargazers_url":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/stargazers","contributors_url":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/contributors","subscribers_url":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/subscribers","subscription_url":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/subscription","commits_url":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/commits{/sha}","git_commits_url":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/git/commits{/sha}","comments_url":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/comments{/number}","issue_comment_url":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/issues/comments{/number}","contents_url":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/contents/{+path}","compare_url":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/merges","archive_url":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/downloads","issues_url":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/issues{/number}","pulls_url":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/pulls{/number}","milestones_url":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/milestones{/number}","notifications_url":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/labels{/name}","releases_url":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/releases{/id}","deployments_url":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/deployments","created_at":"2014-06-25T07:55:02Z","updated_at":"2016-02-08T03:53:04Z","pushed_at":"2016-02-16T06:25:28Z","git_url":"git://github.com/mdsol/Medidata.ZipkinTracerModule.git","ssh_url":"git@github.com:mdsol/Medidata.ZipkinTracerModule.git","clone_url":"https://github.com/mdsol/Medidata.ZipkinTracerModule.git","svn_url":"https://github.com/mdsol/Medidata.ZipkinTracerModule","homepage":null,"size":2243,"stargazers_count":1,"watchers_count":1,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":1,"forks":2,"open_issues":1,"watchers":1,"default_branch":"develop"}},"base":{"label":"mdsol:develop","ref":"develop","sha":"c04cc44d5729e39ad7ef553f9a9a238c6639b0b2","user":{"login":"mdsol","id":171103,"avatar_url":"https://avatars.githubusercontent.com/u/171103?v=3","gravatar_id":"","url":"https://api.github.com/users/mdsol","html_url":"https://github.com/mdsol","followers_url":"https://api.github.com/users/mdsol/followers","following_url":"https://api.github.com/users/mdsol/following{/other_user}","gists_url":"https://api.github.com/users/mdsol/gists{/gist_id}","starred_url":"https://api.github.com/users/mdsol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mdsol/subscriptions","organizations_url":"https://api.github.com/users/mdsol/orgs","repos_url":"https://api.github.com/users/mdsol/repos","events_url":"https://api.github.com/users/mdsol/events{/privacy}","received_events_url":"https://api.github.com/users/mdsol/received_events","type":"Organization","site_admin":false},"repo":{"id":21194896,"name":"Medidata.ZipkinTracerModule","full_name":"mdsol/Medidata.ZipkinTracerModule","owner":{"login":"mdsol","id":171103,"avatar_url":"https://avatars.githubusercontent.com/u/171103?v=3","gravatar_id":"","url":"https://api.github.com/users/mdsol","html_url":"https://github.com/mdsol","followers_url":"https://api.github.com/users/mdsol/followers","following_url":"https://api.github.com/users/mdsol/following{/other_user}","gists_url":"https://api.github.com/users/mdsol/gists{/gist_id}","starred_url":"https://api.github.com/users/mdsol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mdsol/subscriptions","organizations_url":"https://api.github.com/users/mdsol/orgs","repos_url":"https://api.github.com/users/mdsol/repos","events_url":"https://api.github.com/users/mdsol/events{/privacy}","received_events_url":"https://api.github.com/users/mdsol/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mdsol/Medidata.ZipkinTracerModule","description":"Zipkin Request Tracing for .Net Apps","fork":false,"url":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule","forks_url":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/forks","keys_url":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/teams","hooks_url":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/hooks","issue_events_url":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/issues/events{/number}","events_url":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/events","assignees_url":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/assignees{/user}","branches_url":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/branches{/branch}","tags_url":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/tags","blobs_url":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/git/refs{/sha}","trees_url":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/statuses/{sha}","languages_url":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/languages","stargazers_url":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/stargazers","contributors_url":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/contributors","subscribers_url":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/subscribers","subscription_url":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/subscription","commits_url":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/commits{/sha}","git_commits_url":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/git/commits{/sha}","comments_url":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/comments{/number}","issue_comment_url":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/issues/comments{/number}","contents_url":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/contents/{+path}","compare_url":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/merges","archive_url":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/downloads","issues_url":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/issues{/number}","pulls_url":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/pulls{/number}","milestones_url":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/milestones{/number}","notifications_url":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/labels{/name}","releases_url":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/releases{/id}","deployments_url":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/deployments","created_at":"2014-06-25T07:55:02Z","updated_at":"2016-02-08T03:53:04Z","pushed_at":"2016-02-16T06:25:28Z","git_url":"git://github.com/mdsol/Medidata.ZipkinTracerModule.git","ssh_url":"git@github.com:mdsol/Medidata.ZipkinTracerModule.git","clone_url":"https://github.com/mdsol/Medidata.ZipkinTracerModule.git","svn_url":"https://github.com/mdsol/Medidata.ZipkinTracerModule","homepage":null,"size":2243,"stargazers_count":1,"watchers_count":1,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":1,"forks":2,"open_issues":1,"watchers":1,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/pulls/77"},"html":{"href":"https://github.com/mdsol/Medidata.ZipkinTracerModule/pull/77"},"issue":{"href":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/issues/77"},"comments":{"href":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/issues/77/comments"},"review_comments":{"href":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/pulls/77/comments"},"review_comment":{"href":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/pulls/77/commits"},"statuses":{"href":"https://api.github.com/repos/mdsol/Medidata.ZipkinTracerModule/statuses/c9a4049dd353aa410b008913b540aa20e5e38a8e"}}}}