{"action":"created","comment":{"url":"https://api.github.com/repos/DataDog/dd-trace-js/pulls/comments/215080750","pull_request_review_id":152270640,"id":215080750,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxNTA4MDc1MA==","diff_hunk":"@@ -521,21 +604,25 @@ describe('Plugin', () => {\n \n         it('should handle calling low level APIs directly', done => {\n           const source = `query MyQuery { hello(name: \"world\") }`\n-          const document = graphql.parse(source)\n \n           agent\n             .use(traces => {\n               const spans = sort(traces[0])\n \n-              expect(spans).to.have.length(3)\n-              expect(spans[0]).to.have.property('service', 'test-graphql')\n+              expect(spans).to.have.length(6)\n               expect(spans[0]).to.have.property('name', 'graphql.query')\n-              expect(spans[0]).to.have.property('resource', 'query MyQuery')\n-              expect(spans[0].meta).to.have.property('graphql.document', source)","path":"test/plugins/graphql.spec.js","position":286,"original_position":286,"commit_id":"82761da024feb3613ee2864bafa77a9c44f8f75f","original_commit_id":"82761da024feb3613ee2864bafa77a9c44f8f75f","user":{"login":"rochdev","id":1596303,"node_id":"MDQ6VXNlcjE1OTYzMDM=","avatar_url":"https://avatars2.githubusercontent.com/u/1596303?v=4","gravatar_id":"","url":"https://api.github.com/users/rochdev","html_url":"https://github.com/rochdev","followers_url":"https://api.github.com/users/rochdev/followers","following_url":"https://api.github.com/users/rochdev/following{/other_user}","gists_url":"https://api.github.com/users/rochdev/gists{/gist_id}","starred_url":"https://api.github.com/users/rochdev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rochdev/subscriptions","organizations_url":"https://api.github.com/users/rochdev/orgs","repos_url":"https://api.github.com/users/rochdev/repos","events_url":"https://api.github.com/users/rochdev/events{/privacy}","received_events_url":"https://api.github.com/users/rochdev/received_events","type":"User","site_admin":false},"body":"You are correct, it is redundant. I missed it because I was looking at just the diff.","created_at":"2018-09-04T22:01:02Z","updated_at":"2018-09-04T22:01:02Z","html_url":"https://github.com/DataDog/dd-trace-js/pull/245#discussion_r215080750","pull_request_url":"https://api.github.com/repos/DataDog/dd-trace-js/pulls/245","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/DataDog/dd-trace-js/pulls/comments/215080750"},"html":{"href":"https://github.com/DataDog/dd-trace-js/pull/245#discussion_r215080750"},"pull_request":{"href":"https://api.github.com/repos/DataDog/dd-trace-js/pulls/245"}},"in_reply_to_id":214938649},"pull_request":{"url":"https://api.github.com/repos/DataDog/dd-trace-js/pulls/245","id":209135595,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA5MTM1NTk1","html_url":"https://github.com/DataDog/dd-trace-js/pull/245","diff_url":"https://github.com/DataDog/dd-trace-js/pull/245.diff","patch_url":"https://github.com/DataDog/dd-trace-js/pull/245.patch","issue_url":"https://api.github.com/repos/DataDog/dd-trace-js/issues/245","number":245,"state":"open","locked":false,"title":"[GraphQL] Instrument document parsing & validation and include variables in metadata","user":{"login":"alloy","id":2320,"node_id":"MDQ6VXNlcjIzMjA=","avatar_url":"https://avatars2.githubusercontent.com/u/2320?v=4","gravatar_id":"","url":"https://api.github.com/users/alloy","html_url":"https://github.com/alloy","followers_url":"https://api.github.com/users/alloy/followers","following_url":"https://api.github.com/users/alloy/following{/other_user}","gists_url":"https://api.github.com/users/alloy/gists{/gist_id}","starred_url":"https://api.github.com/users/alloy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alloy/subscriptions","organizations_url":"https://api.github.com/users/alloy/orgs","repos_url":"https://api.github.com/users/alloy/repos","events_url":"https://api.github.com/users/alloy/events{/privacy}","received_events_url":"https://api.github.com/users/alloy/received_events","type":"User","site_admin":false},"body":"So the logic in this PR may seem a little unintuitive at first, but my understanding of the existing code is that we really want the operation span to be the parent of all GraphQL related spans and we want to use the operation name as its name.\r\n\r\nThis means we can’t create the parse and validation spans _until_ the operation span has been created (otherwise we don’t have access to the parsed operation name), which is why my changes only record the timing but defer creation of the spans until the operation span is created.\r\n\r\nI also ended up simplifying the tests a little, because they were a bit cumbersome to work with when adding new spans. Rather than assuming spans exist at a certain index, I added a helper function (`findSpan`) to find the spans based on data that the test previously asserted on. Additionally, most tests don’t really seem to need a total span count assertion, so I only left those in 2 places, which would make updating those a lot easier in the future.","created_at":"2018-08-17T12:39:30Z","updated_at":"2018-09-04T22:01:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2609fd5d025340d65c90d0ee4a593ecee03d6819","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":810199037,"node_id":"MDU6TGFiZWw4MTAxOTkwMzc=","url":"https://api.github.com/repos/DataDog/dd-trace-js/labels/community","name":"community","color":"0e8a16","default":false},{"id":807931152,"node_id":"MDU6TGFiZWw4MDc5MzExNTI=","url":"https://api.github.com/repos/DataDog/dd-trace-js/labels/enhancement","name":"enhancement","color":"84b6eb","default":true},{"id":810199574,"node_id":"MDU6TGFiZWw4MTAxOTk1NzQ=","url":"https://api.github.com/repos/DataDog/dd-trace-js/labels/integrations","name":"integrations","color":"c2e0c6","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/DataDog/dd-trace-js/pulls/245/commits","review_comments_url":"https://api.github.com/repos/DataDog/dd-trace-js/pulls/245/comments","review_comment_url":"https://api.github.com/repos/DataDog/dd-trace-js/pulls/comments{/number}","comments_url":"https://api.github.com/repos/DataDog/dd-trace-js/issues/245/comments","statuses_url":"https://api.github.com/repos/DataDog/dd-trace-js/statuses/82761da024feb3613ee2864bafa77a9c44f8f75f","head":{"label":"artsy:graphql-trace-query-parsing-and-validation","ref":"graphql-trace-query-parsing-and-validation","sha":"82761da024feb3613ee2864bafa77a9c44f8f75f","user":{"login":"artsy","id":546231,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU0NjIzMQ==","avatar_url":"https://avatars3.githubusercontent.com/u/546231?v=4","gravatar_id":"","url":"https://api.github.com/users/artsy","html_url":"https://github.com/artsy","followers_url":"https://api.github.com/users/artsy/followers","following_url":"https://api.github.com/users/artsy/following{/other_user}","gists_url":"https://api.github.com/users/artsy/gists{/gist_id}","starred_url":"https://api.github.com/users/artsy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/artsy/subscriptions","organizations_url":"https://api.github.com/users/artsy/orgs","repos_url":"https://api.github.com/users/artsy/repos","events_url":"https://api.github.com/users/artsy/events{/privacy}","received_events_url":"https://api.github.com/users/artsy/received_events","type":"Organization","site_admin":false},"repo":{"id":144856448,"node_id":"MDEwOlJlcG9zaXRvcnkxNDQ4NTY0NDg=","name":"dd-trace-js","full_name":"artsy/dd-trace-js","owner":{"login":"artsy","id":546231,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU0NjIzMQ==","avatar_url":"https://avatars3.githubusercontent.com/u/546231?v=4","gravatar_id":"","url":"https://api.github.com/users/artsy","html_url":"https://github.com/artsy","followers_url":"https://api.github.com/users/artsy/followers","following_url":"https://api.github.com/users/artsy/following{/other_user}","gists_url":"https://api.github.com/users/artsy/gists{/gist_id}","starred_url":"https://api.github.com/users/artsy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/artsy/subscriptions","organizations_url":"https://api.github.com/users/artsy/orgs","repos_url":"https://api.github.com/users/artsy/repos","events_url":"https://api.github.com/users/artsy/events{/privacy}","received_events_url":"https://api.github.com/users/artsy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/artsy/dd-trace-js","description":"JavaScript APM Tracer (beta)","fork":true,"url":"https://api.github.com/repos/artsy/dd-trace-js","forks_url":"https://api.github.com/repos/artsy/dd-trace-js/forks","keys_url":"https://api.github.com/repos/artsy/dd-trace-js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/artsy/dd-trace-js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/artsy/dd-trace-js/teams","hooks_url":"https://api.github.com/repos/artsy/dd-trace-js/hooks","issue_events_url":"https://api.github.com/repos/artsy/dd-trace-js/issues/events{/number}","events_url":"https://api.github.com/repos/artsy/dd-trace-js/events","assignees_url":"https://api.github.com/repos/artsy/dd-trace-js/assignees{/user}","branches_url":"https://api.github.com/repos/artsy/dd-trace-js/branches{/branch}","tags_url":"https://api.github.com/repos/artsy/dd-trace-js/tags","blobs_url":"https://api.github.com/repos/artsy/dd-trace-js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/artsy/dd-trace-js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/artsy/dd-trace-js/git/refs{/sha}","trees_url":"https://api.github.com/repos/artsy/dd-trace-js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/artsy/dd-trace-js/statuses/{sha}","languages_url":"https://api.github.com/repos/artsy/dd-trace-js/languages","stargazers_url":"https://api.github.com/repos/artsy/dd-trace-js/stargazers","contributors_url":"https://api.github.com/repos/artsy/dd-trace-js/contributors","subscribers_url":"https://api.github.com/repos/artsy/dd-trace-js/subscribers","subscription_url":"https://api.github.com/repos/artsy/dd-trace-js/subscription","commits_url":"https://api.github.com/repos/artsy/dd-trace-js/commits{/sha}","git_commits_url":"https://api.github.com/repos/artsy/dd-trace-js/git/commits{/sha}","comments_url":"https://api.github.com/repos/artsy/dd-trace-js/comments{/number}","issue_comment_url":"https://api.github.com/repos/artsy/dd-trace-js/issues/comments{/number}","contents_url":"https://api.github.com/repos/artsy/dd-trace-js/contents/{+path}","compare_url":"https://api.github.com/repos/artsy/dd-trace-js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/artsy/dd-trace-js/merges","archive_url":"https://api.github.com/repos/artsy/dd-trace-js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/artsy/dd-trace-js/downloads","issues_url":"https://api.github.com/repos/artsy/dd-trace-js/issues{/number}","pulls_url":"https://api.github.com/repos/artsy/dd-trace-js/pulls{/number}","milestones_url":"https://api.github.com/repos/artsy/dd-trace-js/milestones{/number}","notifications_url":"https://api.github.com/repos/artsy/dd-trace-js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/artsy/dd-trace-js/labels{/name}","releases_url":"https://api.github.com/repos/artsy/dd-trace-js/releases{/id}","deployments_url":"https://api.github.com/repos/artsy/dd-trace-js/deployments","created_at":"2018-08-15T13:26:50Z","updated_at":"2018-09-03T13:33:09Z","pushed_at":"2018-09-04T12:15:27Z","git_url":"git://github.com/artsy/dd-trace-js.git","ssh_url":"git@github.com:artsy/dd-trace-js.git","clone_url":"https://github.com/artsy/dd-trace-js.git","svn_url":"https://github.com/artsy/dd-trace-js","homepage":"https://docs.datadoghq.com/tracing/","size":428,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"artsy"}},"base":{"label":"DataDog:master","ref":"master","sha":"aa607860ea6bb57f2f69fa7ee72ed3ce25abfbf6","user":{"login":"DataDog","id":365230,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM2NTIzMA==","avatar_url":"https://avatars1.githubusercontent.com/u/365230?v=4","gravatar_id":"","url":"https://api.github.com/users/DataDog","html_url":"https://github.com/DataDog","followers_url":"https://api.github.com/users/DataDog/followers","following_url":"https://api.github.com/users/DataDog/following{/other_user}","gists_url":"https://api.github.com/users/DataDog/gists{/gist_id}","starred_url":"https://api.github.com/users/DataDog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DataDog/subscriptions","organizations_url":"https://api.github.com/users/DataDog/orgs","repos_url":"https://api.github.com/users/DataDog/repos","events_url":"https://api.github.com/users/DataDog/events{/privacy}","received_events_url":"https://api.github.com/users/DataDog/received_events","type":"Organization","site_admin":false},"repo":{"id":117877090,"node_id":"MDEwOlJlcG9zaXRvcnkxMTc4NzcwOTA=","name":"dd-trace-js","full_name":"DataDog/dd-trace-js","owner":{"login":"DataDog","id":365230,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM2NTIzMA==","avatar_url":"https://avatars1.githubusercontent.com/u/365230?v=4","gravatar_id":"","url":"https://api.github.com/users/DataDog","html_url":"https://github.com/DataDog","followers_url":"https://api.github.com/users/DataDog/followers","following_url":"https://api.github.com/users/DataDog/following{/other_user}","gists_url":"https://api.github.com/users/DataDog/gists{/gist_id}","starred_url":"https://api.github.com/users/DataDog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DataDog/subscriptions","organizations_url":"https://api.github.com/users/DataDog/orgs","repos_url":"https://api.github.com/users/DataDog/repos","events_url":"https://api.github.com/users/DataDog/events{/privacy}","received_events_url":"https://api.github.com/users/DataDog/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/DataDog/dd-trace-js","description":"JavaScript APM Tracer","fork":false,"url":"https://api.github.com/repos/DataDog/dd-trace-js","forks_url":"https://api.github.com/repos/DataDog/dd-trace-js/forks","keys_url":"https://api.github.com/repos/DataDog/dd-trace-js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DataDog/dd-trace-js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DataDog/dd-trace-js/teams","hooks_url":"https://api.github.com/repos/DataDog/dd-trace-js/hooks","issue_events_url":"https://api.github.com/repos/DataDog/dd-trace-js/issues/events{/number}","events_url":"https://api.github.com/repos/DataDog/dd-trace-js/events","assignees_url":"https://api.github.com/repos/DataDog/dd-trace-js/assignees{/user}","branches_url":"https://api.github.com/repos/DataDog/dd-trace-js/branches{/branch}","tags_url":"https://api.github.com/repos/DataDog/dd-trace-js/tags","blobs_url":"https://api.github.com/repos/DataDog/dd-trace-js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DataDog/dd-trace-js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DataDog/dd-trace-js/git/refs{/sha}","trees_url":"https://api.github.com/repos/DataDog/dd-trace-js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DataDog/dd-trace-js/statuses/{sha}","languages_url":"https://api.github.com/repos/DataDog/dd-trace-js/languages","stargazers_url":"https://api.github.com/repos/DataDog/dd-trace-js/stargazers","contributors_url":"https://api.github.com/repos/DataDog/dd-trace-js/contributors","subscribers_url":"https://api.github.com/repos/DataDog/dd-trace-js/subscribers","subscription_url":"https://api.github.com/repos/DataDog/dd-trace-js/subscription","commits_url":"https://api.github.com/repos/DataDog/dd-trace-js/commits{/sha}","git_commits_url":"https://api.github.com/repos/DataDog/dd-trace-js/git/commits{/sha}","comments_url":"https://api.github.com/repos/DataDog/dd-trace-js/comments{/number}","issue_comment_url":"https://api.github.com/repos/DataDog/dd-trace-js/issues/comments{/number}","contents_url":"https://api.github.com/repos/DataDog/dd-trace-js/contents/{+path}","compare_url":"https://api.github.com/repos/DataDog/dd-trace-js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DataDog/dd-trace-js/merges","archive_url":"https://api.github.com/repos/DataDog/dd-trace-js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DataDog/dd-trace-js/downloads","issues_url":"https://api.github.com/repos/DataDog/dd-trace-js/issues{/number}","pulls_url":"https://api.github.com/repos/DataDog/dd-trace-js/pulls{/number}","milestones_url":"https://api.github.com/repos/DataDog/dd-trace-js/milestones{/number}","notifications_url":"https://api.github.com/repos/DataDog/dd-trace-js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DataDog/dd-trace-js/labels{/name}","releases_url":"https://api.github.com/repos/DataDog/dd-trace-js/releases{/id}","deployments_url":"https://api.github.com/repos/DataDog/dd-trace-js/deployments","created_at":"2018-01-17T18:40:03Z","updated_at":"2018-09-04T18:35:58Z","pushed_at":"2018-09-03T12:05:18Z","git_url":"git://github.com/DataDog/dd-trace-js.git","ssh_url":"git@github.com:DataDog/dd-trace-js.git","clone_url":"https://github.com/DataDog/dd-trace-js.git","svn_url":"https://github.com/DataDog/dd-trace-js","homepage":"https://docs.datadoghq.com/tracing/","size":951,"stargazers_count":49,"watchers_count":49,"language":"JavaScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":22,"mirror_url":null,"archived":false,"open_issues_count":35,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":22,"open_issues":35,"watchers":49,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/DataDog/dd-trace-js/pulls/245"},"html":{"href":"https://github.com/DataDog/dd-trace-js/pull/245"},"issue":{"href":"https://api.github.com/repos/DataDog/dd-trace-js/issues/245"},"comments":{"href":"https://api.github.com/repos/DataDog/dd-trace-js/issues/245/comments"},"review_comments":{"href":"https://api.github.com/repos/DataDog/dd-trace-js/pulls/245/comments"},"review_comment":{"href":"https://api.github.com/repos/DataDog/dd-trace-js/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/DataDog/dd-trace-js/pulls/245/commits"},"statuses":{"href":"https://api.github.com/repos/DataDog/dd-trace-js/statuses/82761da024feb3613ee2864bafa77a9c44f8f75f"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"rochdev"}}