{"action":"created","comment":{"url":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/pulls/comments/73085863","id":73085863,"diff_hunk":"@@ -63,15 +63,38 @@ def peer_tags(self):\n     redis.StrictRedis.peer_tags = peer_tags\n \n     old_execute_command = redis.StrictRedis.execute_command\n+    old_get = redis.StrictRedis.get\n+    old_set = redis.StrictRedis.set\n+    old_setex = redis.StrictRedis.setex\n+\n+    def get(self, key):\n+        self._extra_tags = [('redis.key', key)]\n+        return old_get(self, key)\n+\n+    def set(self, key, val):\n+        self._extra_tags = [('redis.key', key)]\n+        return old_set(self, key, val)\n+\n+    def setex(self, key, ttl, val):\n+        self._extra_tags = [('redis.key', key),\n+                            ('redis.ttl', ttl)]\n+        return old_setex(self, key, ttl, val)\n \n     def execute_command(self, cmd, *args, **kwargs):\n         operation_name = 'redis:%s' % (cmd,)\n         span = opentracing.tracer.start_span(\n             operation_name=operation_name, parent=get_current_span())\n         span.set_tag(ext_tags.SPAN_KIND, ext_tags.SPAN_KIND_RPC_CLIENT)\n         span.set_tag(ext_tags.PEER_SERVICE, 'redis')\n+\n+        # set the peer information (remote host/port)\n         for tag_key, tag_val in self.peer_tags():\n             span.set_tag(tag_key, tag_val)\n+\n+        # for certain commands we'll add extra attributes such as the redis key\n+        for tag_key, tag_val in getattr(self, '_extra_tags', []):\n+            span.set_tag(tag_key, tag_val)\n+\n         with span:\n             return old_execute_command(self, cmd, *args, **kwargs)","path":"opentracing_instrumentation/client_hooks/strict_redis.py","position":37,"original_position":37,"commit_id":"3432e29b4aa967e406b4f18eca4f1ee61fdde87a","original_commit_id":"3432e29b4aa967e406b4f18eca4f1ee61fdde87a","user":{"login":"yurishkuro","id":3523016,"avatar_url":"https://avatars.githubusercontent.com/u/3523016?v=3","gravatar_id":"","url":"https://api.github.com/users/yurishkuro","html_url":"https://github.com/yurishkuro","followers_url":"https://api.github.com/users/yurishkuro/followers","following_url":"https://api.github.com/users/yurishkuro/following{/other_user}","gists_url":"https://api.github.com/users/yurishkuro/gists{/gist_id}","starred_url":"https://api.github.com/users/yurishkuro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yurishkuro/subscriptions","organizations_url":"https://api.github.com/users/yurishkuro/orgs","repos_url":"https://api.github.com/users/yurishkuro/repos","events_url":"https://api.github.com/users/yurishkuro/events{/privacy}","received_events_url":"https://api.github.com/users/yurishkuro/received_events","type":"User","site_admin":false},"body":"I suppose this could be tested by monkey-patching the old execute command with `mock.patch`","created_at":"2016-08-02T02:35:05Z","updated_at":"2016-08-02T02:35:05Z","html_url":"https://github.com/uber-common/opentracing-python-instrumentation/pull/14#discussion_r73085863","pull_request_url":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/pulls/14","_links":{"self":{"href":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/pulls/comments/73085863"},"html":{"href":"https://github.com/uber-common/opentracing-python-instrumentation/pull/14#discussion_r73085863"},"pull_request":{"href":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/pulls/14"}}},"pull_request":{"url":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/pulls/14","id":79618334,"html_url":"https://github.com/uber-common/opentracing-python-instrumentation/pull/14","diff_url":"https://github.com/uber-common/opentracing-python-instrumentation/pull/14.diff","patch_url":"https://github.com/uber-common/opentracing-python-instrumentation/pull/14.patch","issue_url":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/issues/14","number":14,"state":"open","locked":false,"title":"add more redis tags","user":{"login":"eklitzke","id":2734,"avatar_url":"https://avatars.githubusercontent.com/u/2734?v=3","gravatar_id":"","url":"https://api.github.com/users/eklitzke","html_url":"https://github.com/eklitzke","followers_url":"https://api.github.com/users/eklitzke/followers","following_url":"https://api.github.com/users/eklitzke/following{/other_user}","gists_url":"https://api.github.com/users/eklitzke/gists{/gist_id}","starred_url":"https://api.github.com/users/eklitzke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eklitzke/subscriptions","organizations_url":"https://api.github.com/users/eklitzke/orgs","repos_url":"https://api.github.com/users/eklitzke/repos","events_url":"https://api.github.com/users/eklitzke/events{/privacy}","received_events_url":"https://api.github.com/users/eklitzke/received_events","type":"User","site_admin":false},"body":"This adds key information to the most commonly used redis commands.","created_at":"2016-08-01T19:00:50Z","updated_at":"2016-08-02T02:35:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"aa9cc60627fc13ed07967fbf4d11ac8514c07b5b","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/pulls/14/commits","review_comments_url":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/pulls/14/comments","review_comment_url":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/pulls/comments{/number}","comments_url":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/issues/14/comments","statuses_url":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/statuses/3432e29b4aa967e406b4f18eca4f1ee61fdde87a","head":{"label":"uber-common:more_redis","ref":"more_redis","sha":"3432e29b4aa967e406b4f18eca4f1ee61fdde87a","user":{"login":"uber-common","id":14812045,"avatar_url":"https://avatars.githubusercontent.com/u/14812045?v=3","gravatar_id":"","url":"https://api.github.com/users/uber-common","html_url":"https://github.com/uber-common","followers_url":"https://api.github.com/users/uber-common/followers","following_url":"https://api.github.com/users/uber-common/following{/other_user}","gists_url":"https://api.github.com/users/uber-common/gists{/gist_id}","starred_url":"https://api.github.com/users/uber-common/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uber-common/subscriptions","organizations_url":"https://api.github.com/users/uber-common/orgs","repos_url":"https://api.github.com/users/uber-common/repos","events_url":"https://api.github.com/users/uber-common/events{/privacy}","received_events_url":"https://api.github.com/users/uber-common/received_events","type":"Organization","site_admin":false},"repo":{"id":49710586,"name":"opentracing-python-instrumentation","full_name":"uber-common/opentracing-python-instrumentation","owner":{"login":"uber-common","id":14812045,"avatar_url":"https://avatars.githubusercontent.com/u/14812045?v=3","gravatar_id":"","url":"https://api.github.com/users/uber-common","html_url":"https://github.com/uber-common","followers_url":"https://api.github.com/users/uber-common/followers","following_url":"https://api.github.com/users/uber-common/following{/other_user}","gists_url":"https://api.github.com/users/uber-common/gists{/gist_id}","starred_url":"https://api.github.com/users/uber-common/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uber-common/subscriptions","organizations_url":"https://api.github.com/users/uber-common/orgs","repos_url":"https://api.github.com/users/uber-common/repos","events_url":"https://api.github.com/users/uber-common/events{/privacy}","received_events_url":"https://api.github.com/users/uber-common/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/uber-common/opentracing-python-instrumentation","description":"A collection of instrumentation tools for the OpenTracing API","fork":false,"url":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation","forks_url":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/forks","keys_url":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/keys{/key_id}","collaborators_url":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/teams","hooks_url":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/hooks","issue_events_url":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/issues/events{/number}","events_url":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/events","assignees_url":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/assignees{/user}","branches_url":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/branches{/branch}","tags_url":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/tags","blobs_url":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/git/refs{/sha}","trees_url":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/git/trees{/sha}","statuses_url":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/statuses/{sha}","languages_url":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/languages","stargazers_url":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/stargazers","contributors_url":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/contributors","subscribers_url":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/subscribers","subscription_url":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/subscription","commits_url":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/commits{/sha}","git_commits_url":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/git/commits{/sha}","comments_url":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/comments{/number}","issue_comment_url":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/issues/comments{/number}","contents_url":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/contents/{+path}","compare_url":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/compare/{base}...{head}","merges_url":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/merges","archive_url":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/downloads","issues_url":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/issues{/number}","pulls_url":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/pulls{/number}","milestones_url":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/milestones{/number}","notifications_url":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/labels{/name}","releases_url":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/releases{/id}","deployments_url":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/deployments","created_at":"2016-01-15T09:49:34Z","updated_at":"2016-08-01T08:17:42Z","pushed_at":"2016-08-01T23:26:40Z","git_url":"git://github.com/uber-common/opentracing-python-instrumentation.git","ssh_url":"git@github.com:uber-common/opentracing-python-instrumentation.git","clone_url":"https://github.com/uber-common/opentracing-python-instrumentation.git","svn_url":"https://github.com/uber-common/opentracing-python-instrumentation","homepage":"","size":104,"stargazers_count":4,"watchers_count":4,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":3,"forks":1,"open_issues":3,"watchers":4,"default_branch":"master"}},"base":{"label":"uber-common:master","ref":"master","sha":"84c0c6e9332ed582039e520f55e131eeed943699","user":{"login":"uber-common","id":14812045,"avatar_url":"https://avatars.githubusercontent.com/u/14812045?v=3","gravatar_id":"","url":"https://api.github.com/users/uber-common","html_url":"https://github.com/uber-common","followers_url":"https://api.github.com/users/uber-common/followers","following_url":"https://api.github.com/users/uber-common/following{/other_user}","gists_url":"https://api.github.com/users/uber-common/gists{/gist_id}","starred_url":"https://api.github.com/users/uber-common/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uber-common/subscriptions","organizations_url":"https://api.github.com/users/uber-common/orgs","repos_url":"https://api.github.com/users/uber-common/repos","events_url":"https://api.github.com/users/uber-common/events{/privacy}","received_events_url":"https://api.github.com/users/uber-common/received_events","type":"Organization","site_admin":false},"repo":{"id":49710586,"name":"opentracing-python-instrumentation","full_name":"uber-common/opentracing-python-instrumentation","owner":{"login":"uber-common","id":14812045,"avatar_url":"https://avatars.githubusercontent.com/u/14812045?v=3","gravatar_id":"","url":"https://api.github.com/users/uber-common","html_url":"https://github.com/uber-common","followers_url":"https://api.github.com/users/uber-common/followers","following_url":"https://api.github.com/users/uber-common/following{/other_user}","gists_url":"https://api.github.com/users/uber-common/gists{/gist_id}","starred_url":"https://api.github.com/users/uber-common/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uber-common/subscriptions","organizations_url":"https://api.github.com/users/uber-common/orgs","repos_url":"https://api.github.com/users/uber-common/repos","events_url":"https://api.github.com/users/uber-common/events{/privacy}","received_events_url":"https://api.github.com/users/uber-common/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/uber-common/opentracing-python-instrumentation","description":"A collection of instrumentation tools for the OpenTracing API","fork":false,"url":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation","forks_url":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/forks","keys_url":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/keys{/key_id}","collaborators_url":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/teams","hooks_url":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/hooks","issue_events_url":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/issues/events{/number}","events_url":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/events","assignees_url":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/assignees{/user}","branches_url":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/branches{/branch}","tags_url":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/tags","blobs_url":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/git/refs{/sha}","trees_url":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/git/trees{/sha}","statuses_url":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/statuses/{sha}","languages_url":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/languages","stargazers_url":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/stargazers","contributors_url":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/contributors","subscribers_url":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/subscribers","subscription_url":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/subscription","commits_url":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/commits{/sha}","git_commits_url":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/git/commits{/sha}","comments_url":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/comments{/number}","issue_comment_url":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/issues/comments{/number}","contents_url":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/contents/{+path}","compare_url":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/compare/{base}...{head}","merges_url":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/merges","archive_url":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/downloads","issues_url":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/issues{/number}","pulls_url":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/pulls{/number}","milestones_url":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/milestones{/number}","notifications_url":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/labels{/name}","releases_url":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/releases{/id}","deployments_url":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/deployments","created_at":"2016-01-15T09:49:34Z","updated_at":"2016-08-01T08:17:42Z","pushed_at":"2016-08-01T23:26:40Z","git_url":"git://github.com/uber-common/opentracing-python-instrumentation.git","ssh_url":"git@github.com:uber-common/opentracing-python-instrumentation.git","clone_url":"https://github.com/uber-common/opentracing-python-instrumentation.git","svn_url":"https://github.com/uber-common/opentracing-python-instrumentation","homepage":"","size":104,"stargazers_count":4,"watchers_count":4,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":3,"forks":1,"open_issues":3,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/pulls/14"},"html":{"href":"https://github.com/uber-common/opentracing-python-instrumentation/pull/14"},"issue":{"href":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/issues/14"},"comments":{"href":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/issues/14/comments"},"review_comments":{"href":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/pulls/14/comments"},"review_comment":{"href":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/pulls/14/commits"},"statuses":{"href":"https://api.github.com/repos/uber-common/opentracing-python-instrumentation/statuses/3432e29b4aa967e406b4f18eca4f1ee61fdde87a"}}}}
{"actor":{"display_login":"yurishkuro"}}