{"action":"created","comment":{"url":"https://api.github.com/repos/hawkular/hawkular-apm-opentracing-javascript/pulls/comments/86754274","pull_request_review_id":7394736,"id":86754274,"diff_hunk":"@@ -0,0 +1,128 @@\n+/*\n+ * Copyright 2015-2016 Red Hat, Inc. and/or its affiliates\n+ * and other contributors as indicated by the @author tags.\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ *    http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+\n+function toJson(node) {\n+    function deriveEndpointType(tags) {\n+        const urlTypes = [];\n+        Object.keys(tags).forEach((objectKey) => {\n+            if (objectKey.indexOf('.url') !== -1 || objectKey.indexOf('.uri') !== -1) {\n+                urlTypes.push(objectKey.substring(0, objectKey.length - 4).toUpperCase());\n+            }\n+        });\n+\n+        if (urlTypes.length > 0) {\n+            return urlTypes[0];\n+        }\n+\n+        return 'HTTP';\n+    }\n+\n+    function deriveOperation(span) {\n+        if (!span.getOperationName()) {\n+            const httpMethod = span.getTags()['http.method'];\n+            if (httpMethod) {\n+                return httpMethod;\n+            }\n+        }\n+        return span.getOperationName();\n+    }\n+\n+    function deriveComponentType(tags) {\n+        return tags.component;\n+    }\n+\n+    function deriveUrl(tags) {\n+        function parsePathFromURL(urlStr) {\n+            let path = urlStr;\n+            try {\n+                path = require('url').parse(urlStr, true).pathname;\n+            } catch (error) {}\n+\n+            return path;\n+        }\n+\n+        let url = tags['http.url'];\n+        if (url) {\n+            return parsePathFromURL(url);\n+        }\n+\n+        url = tags['http.uri'];\n+        if (url) {\n+            return parsePathFromURL(url);\n+        }\n+\n+        url = tags['http.path'];\n+        if (url) {\n+            return url;\n+        }\n+\n+        return null;\n+    }\n+\n+    function tagsToProperties(tags) {\n+        if (!tags || Object.keys(tags).length === 0) {\n+            return undefined;\n+        }\n+\n+        const properties = [];\n+        Object.keys(tags).forEach((objectKey) => {\n+            properties.push({\n+                name: objectKey,\n+                value: tags[objectKey],\n+                type: 'Text',","path":"lib/nodeUtils.js","position":86,"original_position":86,"commit_id":"88abd7770e7260ec365f622ccdb9d4097d62d880","original_commit_id":"88abd7770e7260ec365f622ccdb9d4097d62d880","user":{"login":"pavolloffay","id":5618424,"avatar_url":"https://avatars.githubusercontent.com/u/5618424?v=3","gravatar_id":"","url":"https://api.github.com/users/pavolloffay","html_url":"https://github.com/pavolloffay","followers_url":"https://api.github.com/users/pavolloffay/followers","following_url":"https://api.github.com/users/pavolloffay/following{/other_user}","gists_url":"https://api.github.com/users/pavolloffay/gists{/gist_id}","starred_url":"https://api.github.com/users/pavolloffay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pavolloffay/subscriptions","organizations_url":"https://api.github.com/users/pavolloffay/orgs","repos_url":"https://api.github.com/users/pavolloffay/repos","events_url":"https://api.github.com/users/pavolloffay/events{/privacy}","received_events_url":"https://api.github.com/users/pavolloffay/received_events","type":"User","site_admin":false},"body":"Ok I will use this http://www.w3schools.com/jsref/jsref_isnan.asp","created_at":"2016-11-07T11:09:23Z","updated_at":"2016-11-07T11:09:23Z","html_url":"https://github.com/hawkular/hawkular-apm-opentracing-javascript/pull/4#discussion_r86754274","pull_request_url":"https://api.github.com/repos/hawkular/hawkular-apm-opentracing-javascript/pulls/4","_links":{"self":{"href":"https://api.github.com/repos/hawkular/hawkular-apm-opentracing-javascript/pulls/comments/86754274"},"html":{"href":"https://github.com/hawkular/hawkular-apm-opentracing-javascript/pull/4#discussion_r86754274"},"pull_request":{"href":"https://api.github.com/repos/hawkular/hawkular-apm-opentracing-javascript/pulls/4"}}},"pull_request":{"url":"https://api.github.com/repos/hawkular/hawkular-apm-opentracing-javascript/pulls/4","id":91847435,"html_url":"https://github.com/hawkular/hawkular-apm-opentracing-javascript/pull/4","diff_url":"https://github.com/hawkular/hawkular-apm-opentracing-javascript/pull/4.diff","patch_url":"https://github.com/hawkular/hawkular-apm-opentracing-javascript/pull/4.patch","issue_url":"https://api.github.com/repos/hawkular/hawkular-apm-opentracing-javascript/issues/4","number":4,"state":"open","locked":false,"title":"Http recorder with APM Trace builder","user":{"login":"pavolloffay","id":5618424,"avatar_url":"https://avatars.githubusercontent.com/u/5618424?v=3","gravatar_id":"","url":"https://api.github.com/users/pavolloffay","html_url":"https://github.com/pavolloffay","followers_url":"https://api.github.com/users/pavolloffay/followers","following_url":"https://api.github.com/users/pavolloffay/following{/other_user}","gists_url":"https://api.github.com/users/pavolloffay/gists{/gist_id}","starred_url":"https://api.github.com/users/pavolloffay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pavolloffay/subscriptions","organizations_url":"https://api.github.com/users/pavolloffay/orgs","repos_url":"https://api.github.com/users/pavolloffay/repos","events_url":"https://api.github.com/users/pavolloffay/events{/privacy}","received_events_url":"https://api.github.com/users/pavolloffay/received_events","type":"User","site_admin":false},"body":"Http recorder for APM server. The \"biggest\" feature here is how trace and nodes are built.","created_at":"2016-11-01T19:27:46Z","updated_at":"2016-11-07T11:09:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7112312cffd5a894e45aa81c05ae366ec75f56e7","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/hawkular/hawkular-apm-opentracing-javascript/pulls/4/commits","review_comments_url":"https://api.github.com/repos/hawkular/hawkular-apm-opentracing-javascript/pulls/4/comments","review_comment_url":"https://api.github.com/repos/hawkular/hawkular-apm-opentracing-javascript/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hawkular/hawkular-apm-opentracing-javascript/issues/4/comments","statuses_url":"https://api.github.com/repos/hawkular/hawkular-apm-opentracing-javascript/statuses/88abd7770e7260ec365f622ccdb9d4097d62d880","head":{"label":"pavolloffay:apm-reporter","ref":"apm-reporter","sha":"88abd7770e7260ec365f622ccdb9d4097d62d880","user":{"login":"pavolloffay","id":5618424,"avatar_url":"https://avatars.githubusercontent.com/u/5618424?v=3","gravatar_id":"","url":"https://api.github.com/users/pavolloffay","html_url":"https://github.com/pavolloffay","followers_url":"https://api.github.com/users/pavolloffay/followers","following_url":"https://api.github.com/users/pavolloffay/following{/other_user}","gists_url":"https://api.github.com/users/pavolloffay/gists{/gist_id}","starred_url":"https://api.github.com/users/pavolloffay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pavolloffay/subscriptions","organizations_url":"https://api.github.com/users/pavolloffay/orgs","repos_url":"https://api.github.com/users/pavolloffay/repos","events_url":"https://api.github.com/users/pavolloffay/events{/privacy}","received_events_url":"https://api.github.com/users/pavolloffay/received_events","type":"User","site_admin":false},"repo":{"id":71373721,"name":"hawkular-apm-opentracing-javascript","full_name":"pavolloffay/hawkular-apm-opentracing-javascript","owner":{"login":"pavolloffay","id":5618424,"avatar_url":"https://avatars.githubusercontent.com/u/5618424?v=3","gravatar_id":"","url":"https://api.github.com/users/pavolloffay","html_url":"https://github.com/pavolloffay","followers_url":"https://api.github.com/users/pavolloffay/followers","following_url":"https://api.github.com/users/pavolloffay/following{/other_user}","gists_url":"https://api.github.com/users/pavolloffay/gists{/gist_id}","starred_url":"https://api.github.com/users/pavolloffay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pavolloffay/subscriptions","organizations_url":"https://api.github.com/users/pavolloffay/orgs","repos_url":"https://api.github.com/users/pavolloffay/repos","events_url":"https://api.github.com/users/pavolloffay/events{/privacy}","received_events_url":"https://api.github.com/users/pavolloffay/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pavolloffay/hawkular-apm-opentracing-javascript","description":null,"fork":true,"url":"https://api.github.com/repos/pavolloffay/hawkular-apm-opentracing-javascript","forks_url":"https://api.github.com/repos/pavolloffay/hawkular-apm-opentracing-javascript/forks","keys_url":"https://api.github.com/repos/pavolloffay/hawkular-apm-opentracing-javascript/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pavolloffay/hawkular-apm-opentracing-javascript/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pavolloffay/hawkular-apm-opentracing-javascript/teams","hooks_url":"https://api.github.com/repos/pavolloffay/hawkular-apm-opentracing-javascript/hooks","issue_events_url":"https://api.github.com/repos/pavolloffay/hawkular-apm-opentracing-javascript/issues/events{/number}","events_url":"https://api.github.com/repos/pavolloffay/hawkular-apm-opentracing-javascript/events","assignees_url":"https://api.github.com/repos/pavolloffay/hawkular-apm-opentracing-javascript/assignees{/user}","branches_url":"https://api.github.com/repos/pavolloffay/hawkular-apm-opentracing-javascript/branches{/branch}","tags_url":"https://api.github.com/repos/pavolloffay/hawkular-apm-opentracing-javascript/tags","blobs_url":"https://api.github.com/repos/pavolloffay/hawkular-apm-opentracing-javascript/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pavolloffay/hawkular-apm-opentracing-javascript/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pavolloffay/hawkular-apm-opentracing-javascript/git/refs{/sha}","trees_url":"https://api.github.com/repos/pavolloffay/hawkular-apm-opentracing-javascript/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pavolloffay/hawkular-apm-opentracing-javascript/statuses/{sha}","languages_url":"https://api.github.com/repos/pavolloffay/hawkular-apm-opentracing-javascript/languages","stargazers_url":"https://api.github.com/repos/pavolloffay/hawkular-apm-opentracing-javascript/stargazers","contributors_url":"https://api.github.com/repos/pavolloffay/hawkular-apm-opentracing-javascript/contributors","subscribers_url":"https://api.github.com/repos/pavolloffay/hawkular-apm-opentracing-javascript/subscribers","subscription_url":"https://api.github.com/repos/pavolloffay/hawkular-apm-opentracing-javascript/subscription","commits_url":"https://api.github.com/repos/pavolloffay/hawkular-apm-opentracing-javascript/commits{/sha}","git_commits_url":"https://api.github.com/repos/pavolloffay/hawkular-apm-opentracing-javascript/git/commits{/sha}","comments_url":"https://api.github.com/repos/pavolloffay/hawkular-apm-opentracing-javascript/comments{/number}","issue_comment_url":"https://api.github.com/repos/pavolloffay/hawkular-apm-opentracing-javascript/issues/comments{/number}","contents_url":"https://api.github.com/repos/pavolloffay/hawkular-apm-opentracing-javascript/contents/{+path}","compare_url":"https://api.github.com/repos/pavolloffay/hawkular-apm-opentracing-javascript/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pavolloffay/hawkular-apm-opentracing-javascript/merges","archive_url":"https://api.github.com/repos/pavolloffay/hawkular-apm-opentracing-javascript/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pavolloffay/hawkular-apm-opentracing-javascript/downloads","issues_url":"https://api.github.com/repos/pavolloffay/hawkular-apm-opentracing-javascript/issues{/number}","pulls_url":"https://api.github.com/repos/pavolloffay/hawkular-apm-opentracing-javascript/pulls{/number}","milestones_url":"https://api.github.com/repos/pavolloffay/hawkular-apm-opentracing-javascript/milestones{/number}","notifications_url":"https://api.github.com/repos/pavolloffay/hawkular-apm-opentracing-javascript/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pavolloffay/hawkular-apm-opentracing-javascript/labels{/name}","releases_url":"https://api.github.com/repos/pavolloffay/hawkular-apm-opentracing-javascript/releases{/id}","deployments_url":"https://api.github.com/repos/pavolloffay/hawkular-apm-opentracing-javascript/deployments","created_at":"2016-10-19T15:50:43Z","updated_at":"2016-10-19T15:35:57Z","pushed_at":"2016-11-04T16:23:26Z","git_url":"git://github.com/pavolloffay/hawkular-apm-opentracing-javascript.git","ssh_url":"git@github.com:pavolloffay/hawkular-apm-opentracing-javascript.git","clone_url":"https://github.com/pavolloffay/hawkular-apm-opentracing-javascript.git","svn_url":"https://github.com/pavolloffay/hawkular-apm-opentracing-javascript","homepage":null,"size":40,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_downloads":true,"has_wiki":false,"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":"hawkular:master","ref":"master","sha":"7676c80f9a862ebb9e9d828e86300109b9f053a7","user":{"login":"hawkular","id":10179627,"avatar_url":"https://avatars.githubusercontent.com/u/10179627?v=3","gravatar_id":"","url":"https://api.github.com/users/hawkular","html_url":"https://github.com/hawkular","followers_url":"https://api.github.com/users/hawkular/followers","following_url":"https://api.github.com/users/hawkular/following{/other_user}","gists_url":"https://api.github.com/users/hawkular/gists{/gist_id}","starred_url":"https://api.github.com/users/hawkular/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hawkular/subscriptions","organizations_url":"https://api.github.com/users/hawkular/orgs","repos_url":"https://api.github.com/users/hawkular/repos","events_url":"https://api.github.com/users/hawkular/events{/privacy}","received_events_url":"https://api.github.com/users/hawkular/received_events","type":"Organization","site_admin":false},"repo":{"id":71372354,"name":"hawkular-apm-opentracing-javascript","full_name":"hawkular/hawkular-apm-opentracing-javascript","owner":{"login":"hawkular","id":10179627,"avatar_url":"https://avatars.githubusercontent.com/u/10179627?v=3","gravatar_id":"","url":"https://api.github.com/users/hawkular","html_url":"https://github.com/hawkular","followers_url":"https://api.github.com/users/hawkular/followers","following_url":"https://api.github.com/users/hawkular/following{/other_user}","gists_url":"https://api.github.com/users/hawkular/gists{/gist_id}","starred_url":"https://api.github.com/users/hawkular/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hawkular/subscriptions","organizations_url":"https://api.github.com/users/hawkular/orgs","repos_url":"https://api.github.com/users/hawkular/repos","events_url":"https://api.github.com/users/hawkular/events{/privacy}","received_events_url":"https://api.github.com/users/hawkular/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hawkular/hawkular-apm-opentracing-javascript","description":"Hawkular-APM OpenTracing JavaScript Implementation","fork":false,"url":"https://api.github.com/repos/hawkular/hawkular-apm-opentracing-javascript","forks_url":"https://api.github.com/repos/hawkular/hawkular-apm-opentracing-javascript/forks","keys_url":"https://api.github.com/repos/hawkular/hawkular-apm-opentracing-javascript/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hawkular/hawkular-apm-opentracing-javascript/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hawkular/hawkular-apm-opentracing-javascript/teams","hooks_url":"https://api.github.com/repos/hawkular/hawkular-apm-opentracing-javascript/hooks","issue_events_url":"https://api.github.com/repos/hawkular/hawkular-apm-opentracing-javascript/issues/events{/number}","events_url":"https://api.github.com/repos/hawkular/hawkular-apm-opentracing-javascript/events","assignees_url":"https://api.github.com/repos/hawkular/hawkular-apm-opentracing-javascript/assignees{/user}","branches_url":"https://api.github.com/repos/hawkular/hawkular-apm-opentracing-javascript/branches{/branch}","tags_url":"https://api.github.com/repos/hawkular/hawkular-apm-opentracing-javascript/tags","blobs_url":"https://api.github.com/repos/hawkular/hawkular-apm-opentracing-javascript/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hawkular/hawkular-apm-opentracing-javascript/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hawkular/hawkular-apm-opentracing-javascript/git/refs{/sha}","trees_url":"https://api.github.com/repos/hawkular/hawkular-apm-opentracing-javascript/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hawkular/hawkular-apm-opentracing-javascript/statuses/{sha}","languages_url":"https://api.github.com/repos/hawkular/hawkular-apm-opentracing-javascript/languages","stargazers_url":"https://api.github.com/repos/hawkular/hawkular-apm-opentracing-javascript/stargazers","contributors_url":"https://api.github.com/repos/hawkular/hawkular-apm-opentracing-javascript/contributors","subscribers_url":"https://api.github.com/repos/hawkular/hawkular-apm-opentracing-javascript/subscribers","subscription_url":"https://api.github.com/repos/hawkular/hawkular-apm-opentracing-javascript/subscription","commits_url":"https://api.github.com/repos/hawkular/hawkular-apm-opentracing-javascript/commits{/sha}","git_commits_url":"https://api.github.com/repos/hawkular/hawkular-apm-opentracing-javascript/git/commits{/sha}","comments_url":"https://api.github.com/repos/hawkular/hawkular-apm-opentracing-javascript/comments{/number}","issue_comment_url":"https://api.github.com/repos/hawkular/hawkular-apm-opentracing-javascript/issues/comments{/number}","contents_url":"https://api.github.com/repos/hawkular/hawkular-apm-opentracing-javascript/contents/{+path}","compare_url":"https://api.github.com/repos/hawkular/hawkular-apm-opentracing-javascript/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hawkular/hawkular-apm-opentracing-javascript/merges","archive_url":"https://api.github.com/repos/hawkular/hawkular-apm-opentracing-javascript/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hawkular/hawkular-apm-opentracing-javascript/downloads","issues_url":"https://api.github.com/repos/hawkular/hawkular-apm-opentracing-javascript/issues{/number}","pulls_url":"https://api.github.com/repos/hawkular/hawkular-apm-opentracing-javascript/pulls{/number}","milestones_url":"https://api.github.com/repos/hawkular/hawkular-apm-opentracing-javascript/milestones{/number}","notifications_url":"https://api.github.com/repos/hawkular/hawkular-apm-opentracing-javascript/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hawkular/hawkular-apm-opentracing-javascript/labels{/name}","releases_url":"https://api.github.com/repos/hawkular/hawkular-apm-opentracing-javascript/releases{/id}","deployments_url":"https://api.github.com/repos/hawkular/hawkular-apm-opentracing-javascript/deployments","created_at":"2016-10-19T15:35:48Z","updated_at":"2016-11-01T18:57:24Z","pushed_at":"2016-11-04T16:23:27Z","git_url":"git://github.com/hawkular/hawkular-apm-opentracing-javascript.git","ssh_url":"git@github.com:hawkular/hawkular-apm-opentracing-javascript.git","clone_url":"https://github.com/hawkular/hawkular-apm-opentracing-javascript.git","svn_url":"https://github.com/hawkular/hawkular-apm-opentracing-javascript","homepage":"","size":29,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hawkular/hawkular-apm-opentracing-javascript/pulls/4"},"html":{"href":"https://github.com/hawkular/hawkular-apm-opentracing-javascript/pull/4"},"issue":{"href":"https://api.github.com/repos/hawkular/hawkular-apm-opentracing-javascript/issues/4"},"comments":{"href":"https://api.github.com/repos/hawkular/hawkular-apm-opentracing-javascript/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/hawkular/hawkular-apm-opentracing-javascript/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/hawkular/hawkular-apm-opentracing-javascript/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hawkular/hawkular-apm-opentracing-javascript/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/hawkular/hawkular-apm-opentracing-javascript/statuses/88abd7770e7260ec365f622ccdb9d4097d62d880"}}}}
{"actor":{"display_login":"pavolloffay"}}