{"action":"created","comment":{"url":"https://api.github.com/repos/DataDog/integrations-core/pulls/comments/216096089","pull_request_review_id":153514017,"id":216096089,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxNjA5NjA4OQ==","diff_hunk":"@@ -1,3 +1,6 @@\n # (C) Datadog, Inc. 2018\n # All rights reserved\n # Licensed under a 3-clause BSD style license (see LICENSE)\n+from ddtrace import patch\n+\n+patch(requests=True)","path":"datadog_checks_base/datadog_checks/utils/__init__.py","position":6,"original_position":6,"commit_id":"5dc1d65686a3968e8fb17271265597a2c621489c","original_commit_id":"5dc1d65686a3968e8fb17271265597a2c621489c","user":{"login":"nmuesch","id":8941884,"node_id":"MDQ6VXNlcjg5NDE4ODQ=","avatar_url":"https://avatars0.githubusercontent.com/u/8941884?v=4","gravatar_id":"","url":"https://api.github.com/users/nmuesch","html_url":"https://github.com/nmuesch","followers_url":"https://api.github.com/users/nmuesch/followers","following_url":"https://api.github.com/users/nmuesch/following{/other_user}","gists_url":"https://api.github.com/users/nmuesch/gists{/gist_id}","starred_url":"https://api.github.com/users/nmuesch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nmuesch/subscriptions","organizations_url":"https://api.github.com/users/nmuesch/orgs","repos_url":"https://api.github.com/users/nmuesch/repos","events_url":"https://api.github.com/users/nmuesch/events{/privacy}","received_events_url":"https://api.github.com/users/nmuesch/received_events","type":"User","site_admin":false},"body":"@masci Is this something you are familiar with? I can look into digging up the answer if not. \r\n\r\nDo we know what the overhead of enabling this early on for all checks would be? ","created_at":"2018-09-07T21:50:37Z","updated_at":"2018-09-07T21:50:37Z","html_url":"https://github.com/DataDog/integrations-core/pull/2079#discussion_r216096089","pull_request_url":"https://api.github.com/repos/DataDog/integrations-core/pulls/2079","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/DataDog/integrations-core/pulls/comments/216096089"},"html":{"href":"https://github.com/DataDog/integrations-core/pull/2079#discussion_r216096089"},"pull_request":{"href":"https://api.github.com/repos/DataDog/integrations-core/pulls/2079"}},"in_reply_to_id":214619924},"pull_request":{"url":"https://api.github.com/repos/DataDog/integrations-core/pulls/2079","id":209564673,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA5NTY0Njcz","html_url":"https://github.com/DataDog/integrations-core/pull/2079","diff_url":"https://github.com/DataDog/integrations-core/pull/2079.diff","patch_url":"https://github.com/DataDog/integrations-core/pull/2079.patch","issue_url":"https://api.github.com/repos/DataDog/integrations-core/issues/2079","number":2079,"state":"open","locked":false,"title":"Adds ability to Trace \"check\" function with DD APM","user":{"login":"nmuesch","id":8941884,"node_id":"MDQ6VXNlcjg5NDE4ODQ=","avatar_url":"https://avatars0.githubusercontent.com/u/8941884?v=4","gravatar_id":"","url":"https://api.github.com/users/nmuesch","html_url":"https://github.com/nmuesch","followers_url":"https://api.github.com/users/nmuesch/followers","following_url":"https://api.github.com/users/nmuesch/following{/other_user}","gists_url":"https://api.github.com/users/nmuesch/gists{/gist_id}","starred_url":"https://api.github.com/users/nmuesch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nmuesch/subscriptions","organizations_url":"https://api.github.com/users/nmuesch/orgs","repos_url":"https://api.github.com/users/nmuesch/repos","events_url":"https://api.github.com/users/nmuesch/events{/privacy}","received_events_url":"https://api.github.com/users/nmuesch/received_events","type":"User","site_admin":false},"body":"### What does this PR do?\r\n\r\nAdds in the ddtrace lib as a static dependency \r\nAdds ability to enable/disable tracing at a per instance level using a new decorator in datadog_checks_base, and enabled auto patching of `requests`\r\nAdd first example of tracing in OpenStack for the `check` function. \r\n\r\n### Motivation\r\n\r\nWant the ability to see function performance for the more complicated/scaled integrations\r\n\r\nEx: https://cl.ly/86a53f2ed3a9\r\n\r\n### Review checklist\r\n\r\n- [x] PR has a [meaningful title](https://github.com/DataDog/integrations-core/blob/master/CONTRIBUTING.md#pull-request-title) or PR has the `no-changelog` label attached\r\n- [ ] Feature or bugfix has tests\r\n- [ ] Git history is clean\r\n- [ ] If PR impacts documentation, docs team has been notified or an issue has been opened on the [documentation repo](https://github.com/DataDog/documentation/issues/new)\r\n\r\n### Additional Notes\r\n\r\nThis is currently enabled/disabled at a per instance level using `trace_check` in the integration configuration file. Doing this means there are two assumptions about the method being wrapped:\r\n* ~The method is a class method, so we can use the class name as the Service Name~ The Service name will be static across all integrations, and the resource name is the name of the function being bassed, and the span name is static/is always integration check\r\n* ~The first passed param is the `instance` so we can check if tracing is enabled/disabled for this check.~ EDIT: now we just check that `instance` is any of the params passed to the function using the `inspect` module, so we gain a little more flexibility here. \r\n\r\n","created_at":"2018-08-20T15:46:56Z","updated_at":"2018-09-07T21:50:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ea6a62d80d4fffeaf11d29a8880cd35b808ed1a9","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":937215339,"node_id":"MDU6TGFiZWw5MzcyMTUzMzk=","url":"https://api.github.com/repos/DataDog/integrations-core/labels/changelog/Added","name":"changelog/Added","color":"f2983e","default":false},{"id":936565809,"node_id":"MDU6TGFiZWw5MzY1NjU4MDk=","url":"https://api.github.com/repos/DataDog/integrations-core/labels/integration/datadog_checks_base","name":"integration/datadog_checks_base","color":"bfdadc","default":false},{"id":936575040,"node_id":"MDU6TGFiZWw5MzY1NzUwNDA=","url":"https://api.github.com/repos/DataDog/integrations-core/labels/integration/openstack","name":"integration/openstack","color":"bfdadc","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/DataDog/integrations-core/pulls/2079/commits","review_comments_url":"https://api.github.com/repos/DataDog/integrations-core/pulls/2079/comments","review_comment_url":"https://api.github.com/repos/DataDog/integrations-core/pulls/comments{/number}","comments_url":"https://api.github.com/repos/DataDog/integrations-core/issues/2079/comments","statuses_url":"https://api.github.com/repos/DataDog/integrations-core/statuses/5dc1d65686a3968e8fb17271265597a2c621489c","head":{"label":"DataDog:nick/trace_openstack","ref":"nick/trace_openstack","sha":"5dc1d65686a3968e8fb17271265597a2c621489c","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":47203045,"node_id":"MDEwOlJlcG9zaXRvcnk0NzIwMzA0NQ==","name":"integrations-core","full_name":"DataDog/integrations-core","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/integrations-core","description":"Core integrations of the datadog agent","fork":false,"url":"https://api.github.com/repos/DataDog/integrations-core","forks_url":"https://api.github.com/repos/DataDog/integrations-core/forks","keys_url":"https://api.github.com/repos/DataDog/integrations-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DataDog/integrations-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DataDog/integrations-core/teams","hooks_url":"https://api.github.com/repos/DataDog/integrations-core/hooks","issue_events_url":"https://api.github.com/repos/DataDog/integrations-core/issues/events{/number}","events_url":"https://api.github.com/repos/DataDog/integrations-core/events","assignees_url":"https://api.github.com/repos/DataDog/integrations-core/assignees{/user}","branches_url":"https://api.github.com/repos/DataDog/integrations-core/branches{/branch}","tags_url":"https://api.github.com/repos/DataDog/integrations-core/tags","blobs_url":"https://api.github.com/repos/DataDog/integrations-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DataDog/integrations-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DataDog/integrations-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/DataDog/integrations-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DataDog/integrations-core/statuses/{sha}","languages_url":"https://api.github.com/repos/DataDog/integrations-core/languages","stargazers_url":"https://api.github.com/repos/DataDog/integrations-core/stargazers","contributors_url":"https://api.github.com/repos/DataDog/integrations-core/contributors","subscribers_url":"https://api.github.com/repos/DataDog/integrations-core/subscribers","subscription_url":"https://api.github.com/repos/DataDog/integrations-core/subscription","commits_url":"https://api.github.com/repos/DataDog/integrations-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/DataDog/integrations-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/DataDog/integrations-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/DataDog/integrations-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/DataDog/integrations-core/contents/{+path}","compare_url":"https://api.github.com/repos/DataDog/integrations-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DataDog/integrations-core/merges","archive_url":"https://api.github.com/repos/DataDog/integrations-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DataDog/integrations-core/downloads","issues_url":"https://api.github.com/repos/DataDog/integrations-core/issues{/number}","pulls_url":"https://api.github.com/repos/DataDog/integrations-core/pulls{/number}","milestones_url":"https://api.github.com/repos/DataDog/integrations-core/milestones{/number}","notifications_url":"https://api.github.com/repos/DataDog/integrations-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DataDog/integrations-core/labels{/name}","releases_url":"https://api.github.com/repos/DataDog/integrations-core/releases{/id}","deployments_url":"https://api.github.com/repos/DataDog/integrations-core/deployments","created_at":"2015-12-01T16:41:45Z","updated_at":"2018-09-07T14:52:58Z","pushed_at":"2018-09-07T20:53:39Z","git_url":"git://github.com/DataDog/integrations-core.git","ssh_url":"git@github.com:DataDog/integrations-core.git","clone_url":"https://github.com/DataDog/integrations-core.git","svn_url":"https://github.com/DataDog/integrations-core","homepage":null,"size":29124,"stargazers_count":142,"watchers_count":142,"language":"Python","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":312,"mirror_url":null,"archived":false,"open_issues_count":61,"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","node_id":"MDc6TGljZW5zZTU="},"forks":312,"open_issues":61,"watchers":142,"default_branch":"master"}},"base":{"label":"DataDog:master","ref":"master","sha":"fa02fa424cad3d20aac0f5a070076779e177c5b0","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":47203045,"node_id":"MDEwOlJlcG9zaXRvcnk0NzIwMzA0NQ==","name":"integrations-core","full_name":"DataDog/integrations-core","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/integrations-core","description":"Core integrations of the datadog agent","fork":false,"url":"https://api.github.com/repos/DataDog/integrations-core","forks_url":"https://api.github.com/repos/DataDog/integrations-core/forks","keys_url":"https://api.github.com/repos/DataDog/integrations-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DataDog/integrations-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DataDog/integrations-core/teams","hooks_url":"https://api.github.com/repos/DataDog/integrations-core/hooks","issue_events_url":"https://api.github.com/repos/DataDog/integrations-core/issues/events{/number}","events_url":"https://api.github.com/repos/DataDog/integrations-core/events","assignees_url":"https://api.github.com/repos/DataDog/integrations-core/assignees{/user}","branches_url":"https://api.github.com/repos/DataDog/integrations-core/branches{/branch}","tags_url":"https://api.github.com/repos/DataDog/integrations-core/tags","blobs_url":"https://api.github.com/repos/DataDog/integrations-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DataDog/integrations-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DataDog/integrations-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/DataDog/integrations-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DataDog/integrations-core/statuses/{sha}","languages_url":"https://api.github.com/repos/DataDog/integrations-core/languages","stargazers_url":"https://api.github.com/repos/DataDog/integrations-core/stargazers","contributors_url":"https://api.github.com/repos/DataDog/integrations-core/contributors","subscribers_url":"https://api.github.com/repos/DataDog/integrations-core/subscribers","subscription_url":"https://api.github.com/repos/DataDog/integrations-core/subscription","commits_url":"https://api.github.com/repos/DataDog/integrations-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/DataDog/integrations-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/DataDog/integrations-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/DataDog/integrations-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/DataDog/integrations-core/contents/{+path}","compare_url":"https://api.github.com/repos/DataDog/integrations-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DataDog/integrations-core/merges","archive_url":"https://api.github.com/repos/DataDog/integrations-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DataDog/integrations-core/downloads","issues_url":"https://api.github.com/repos/DataDog/integrations-core/issues{/number}","pulls_url":"https://api.github.com/repos/DataDog/integrations-core/pulls{/number}","milestones_url":"https://api.github.com/repos/DataDog/integrations-core/milestones{/number}","notifications_url":"https://api.github.com/repos/DataDog/integrations-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DataDog/integrations-core/labels{/name}","releases_url":"https://api.github.com/repos/DataDog/integrations-core/releases{/id}","deployments_url":"https://api.github.com/repos/DataDog/integrations-core/deployments","created_at":"2015-12-01T16:41:45Z","updated_at":"2018-09-07T14:52:58Z","pushed_at":"2018-09-07T20:53:39Z","git_url":"git://github.com/DataDog/integrations-core.git","ssh_url":"git@github.com:DataDog/integrations-core.git","clone_url":"https://github.com/DataDog/integrations-core.git","svn_url":"https://github.com/DataDog/integrations-core","homepage":null,"size":29124,"stargazers_count":142,"watchers_count":142,"language":"Python","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":312,"mirror_url":null,"archived":false,"open_issues_count":61,"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","node_id":"MDc6TGljZW5zZTU="},"forks":312,"open_issues":61,"watchers":142,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/DataDog/integrations-core/pulls/2079"},"html":{"href":"https://github.com/DataDog/integrations-core/pull/2079"},"issue":{"href":"https://api.github.com/repos/DataDog/integrations-core/issues/2079"},"comments":{"href":"https://api.github.com/repos/DataDog/integrations-core/issues/2079/comments"},"review_comments":{"href":"https://api.github.com/repos/DataDog/integrations-core/pulls/2079/comments"},"review_comment":{"href":"https://api.github.com/repos/DataDog/integrations-core/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/DataDog/integrations-core/pulls/2079/commits"},"statuses":{"href":"https://api.github.com/repos/DataDog/integrations-core/statuses/5dc1d65686a3968e8fb17271265597a2c621489c"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"nmuesch"}}