{"action":"created","comment":{"url":"https://api.github.com/repos/prometheus/client_python/pulls/comments/43580777","id":43580777,"diff_hunk":"@@ -0,0 +1,18 @@\n+from __future__ import absolute_import\n+from . import REGISTRY, generate_latest, CONTENT_TYPE_LATEST\n+\n+from twisted.web.resource import Resource\n+\n+\n+class MetricsResource(Resource):\n+    \"\"\"\n+    Twisted ``Resource`` that serves prometheus metrics.\n+    \"\"\"\n+    isLeaf = True\n+\n+    def __init__(self, registry=REGISTRY):\n+        self.registry = registry\n+\n+    def render_GET(self, request):\n+        request.setHeader('Content-Type', CONTENT_TYPE_LATEST.encode('ascii'))\n+        return generate_latest(self.registry).encode('ascii')","path":"prometheus_client/twisted/_exposition.py","position":18,"original_position":18,"commit_id":"8f5e62f9a60afdc51b5b2359a85310d783cc77d2","original_commit_id":"8f5e62f9a60afdc51b5b2359a85310d783cc77d2","user":{"login":"brian-brazil","id":7115638,"avatar_url":"https://avatars.githubusercontent.com/u/7115638?v=3","gravatar_id":"","url":"https://api.github.com/users/brian-brazil","html_url":"https://github.com/brian-brazil","followers_url":"https://api.github.com/users/brian-brazil/followers","following_url":"https://api.github.com/users/brian-brazil/following{/other_user}","gists_url":"https://api.github.com/users/brian-brazil/gists{/gist_id}","starred_url":"https://api.github.com/users/brian-brazil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brian-brazil/subscriptions","organizations_url":"https://api.github.com/users/brian-brazil/orgs","repos_url":"https://api.github.com/users/brian-brazil/repos","events_url":"https://api.github.com/users/brian-brazil/events{/privacy}","received_events_url":"https://api.github.com/users/brian-brazil/received_events","type":"User","site_admin":false},"body":"You're still reecnoding this here. Have you tested this on python3?","created_at":"2015-11-01T09:48:23Z","updated_at":"2015-11-01T09:48:23Z","html_url":"https://github.com/prometheus/client_python/pull/59#discussion_r43580777","pull_request_url":"https://api.github.com/repos/prometheus/client_python/pulls/59","_links":{"self":{"href":"https://api.github.com/repos/prometheus/client_python/pulls/comments/43580777"},"html":{"href":"https://github.com/prometheus/client_python/pull/59#discussion_r43580777"},"pull_request":{"href":"https://api.github.com/repos/prometheus/client_python/pulls/59"}}},"pull_request":{"url":"https://api.github.com/repos/prometheus/client_python/pulls/59","id":47651030,"html_url":"https://github.com/prometheus/client_python/pull/59","diff_url":"https://github.com/prometheus/client_python/pull/59.diff","patch_url":"https://github.com/prometheus/client_python/pull/59.patch","issue_url":"https://api.github.com/repos/prometheus/client_python/issues/59","number":59,"state":"open","locked":false,"title":"Add a twisted resource for exposing metrics via twisted.web.","user":{"login":"tomprince","id":283816,"avatar_url":"https://avatars.githubusercontent.com/u/283816?v=3","gravatar_id":"","url":"https://api.github.com/users/tomprince","html_url":"https://github.com/tomprince","followers_url":"https://api.github.com/users/tomprince/followers","following_url":"https://api.github.com/users/tomprince/following{/other_user}","gists_url":"https://api.github.com/users/tomprince/gists{/gist_id}","starred_url":"https://api.github.com/users/tomprince/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomprince/subscriptions","organizations_url":"https://api.github.com/users/tomprince/orgs","repos_url":"https://api.github.com/users/tomprince/repos","events_url":"https://api.github.com/users/tomprince/events{/privacy}","received_events_url":"https://api.github.com/users/tomprince/received_events","type":"User","site_admin":false},"body":"I'm not sure if this belongs as part of the client, or should be an external package that depends on this.","created_at":"2015-10-14T12:13:16Z","updated_at":"2015-11-01T09:48:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fb79037cdf871c4a6c5d4982152deab2da9723d8","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/prometheus/client_python/pulls/59/commits","review_comments_url":"https://api.github.com/repos/prometheus/client_python/pulls/59/comments","review_comment_url":"https://api.github.com/repos/prometheus/client_python/pulls/comments{/number}","comments_url":"https://api.github.com/repos/prometheus/client_python/issues/59/comments","statuses_url":"https://api.github.com/repos/prometheus/client_python/statuses/8f5e62f9a60afdc51b5b2359a85310d783cc77d2","head":{"label":"ClusterHQ:twisted-resource","ref":"twisted-resource","sha":"8f5e62f9a60afdc51b5b2359a85310d783cc77d2","user":{"login":"ClusterHQ","id":7913449,"avatar_url":"https://avatars.githubusercontent.com/u/7913449?v=3","gravatar_id":"","url":"https://api.github.com/users/ClusterHQ","html_url":"https://github.com/ClusterHQ","followers_url":"https://api.github.com/users/ClusterHQ/followers","following_url":"https://api.github.com/users/ClusterHQ/following{/other_user}","gists_url":"https://api.github.com/users/ClusterHQ/gists{/gist_id}","starred_url":"https://api.github.com/users/ClusterHQ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ClusterHQ/subscriptions","organizations_url":"https://api.github.com/users/ClusterHQ/orgs","repos_url":"https://api.github.com/users/ClusterHQ/repos","events_url":"https://api.github.com/users/ClusterHQ/events{/privacy}","received_events_url":"https://api.github.com/users/ClusterHQ/received_events","type":"Organization","site_admin":false},"repo":{"id":44160404,"name":"client_python","full_name":"ClusterHQ/client_python","owner":{"login":"ClusterHQ","id":7913449,"avatar_url":"https://avatars.githubusercontent.com/u/7913449?v=3","gravatar_id":"","url":"https://api.github.com/users/ClusterHQ","html_url":"https://github.com/ClusterHQ","followers_url":"https://api.github.com/users/ClusterHQ/followers","following_url":"https://api.github.com/users/ClusterHQ/following{/other_user}","gists_url":"https://api.github.com/users/ClusterHQ/gists{/gist_id}","starred_url":"https://api.github.com/users/ClusterHQ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ClusterHQ/subscriptions","organizations_url":"https://api.github.com/users/ClusterHQ/orgs","repos_url":"https://api.github.com/users/ClusterHQ/repos","events_url":"https://api.github.com/users/ClusterHQ/events{/privacy}","received_events_url":"https://api.github.com/users/ClusterHQ/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ClusterHQ/client_python","description":"Prometheus instrumentation library for Python applications","fork":true,"url":"https://api.github.com/repos/ClusterHQ/client_python","forks_url":"https://api.github.com/repos/ClusterHQ/client_python/forks","keys_url":"https://api.github.com/repos/ClusterHQ/client_python/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ClusterHQ/client_python/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ClusterHQ/client_python/teams","hooks_url":"https://api.github.com/repos/ClusterHQ/client_python/hooks","issue_events_url":"https://api.github.com/repos/ClusterHQ/client_python/issues/events{/number}","events_url":"https://api.github.com/repos/ClusterHQ/client_python/events","assignees_url":"https://api.github.com/repos/ClusterHQ/client_python/assignees{/user}","branches_url":"https://api.github.com/repos/ClusterHQ/client_python/branches{/branch}","tags_url":"https://api.github.com/repos/ClusterHQ/client_python/tags","blobs_url":"https://api.github.com/repos/ClusterHQ/client_python/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ClusterHQ/client_python/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ClusterHQ/client_python/git/refs{/sha}","trees_url":"https://api.github.com/repos/ClusterHQ/client_python/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ClusterHQ/client_python/statuses/{sha}","languages_url":"https://api.github.com/repos/ClusterHQ/client_python/languages","stargazers_url":"https://api.github.com/repos/ClusterHQ/client_python/stargazers","contributors_url":"https://api.github.com/repos/ClusterHQ/client_python/contributors","subscribers_url":"https://api.github.com/repos/ClusterHQ/client_python/subscribers","subscription_url":"https://api.github.com/repos/ClusterHQ/client_python/subscription","commits_url":"https://api.github.com/repos/ClusterHQ/client_python/commits{/sha}","git_commits_url":"https://api.github.com/repos/ClusterHQ/client_python/git/commits{/sha}","comments_url":"https://api.github.com/repos/ClusterHQ/client_python/comments{/number}","issue_comment_url":"https://api.github.com/repos/ClusterHQ/client_python/issues/comments{/number}","contents_url":"https://api.github.com/repos/ClusterHQ/client_python/contents/{+path}","compare_url":"https://api.github.com/repos/ClusterHQ/client_python/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ClusterHQ/client_python/merges","archive_url":"https://api.github.com/repos/ClusterHQ/client_python/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ClusterHQ/client_python/downloads","issues_url":"https://api.github.com/repos/ClusterHQ/client_python/issues{/number}","pulls_url":"https://api.github.com/repos/ClusterHQ/client_python/pulls{/number}","milestones_url":"https://api.github.com/repos/ClusterHQ/client_python/milestones{/number}","notifications_url":"https://api.github.com/repos/ClusterHQ/client_python/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ClusterHQ/client_python/labels{/name}","releases_url":"https://api.github.com/repos/ClusterHQ/client_python/releases{/id}","created_at":"2015-10-13T07:46:05Z","updated_at":"2015-10-13T07:46:06Z","pushed_at":"2015-10-14T12:46:04Z","git_url":"git://github.com/ClusterHQ/client_python.git","ssh_url":"git@github.com:ClusterHQ/client_python.git","clone_url":"https://github.com/ClusterHQ/client_python.git","svn_url":"https://github.com/ClusterHQ/client_python","homepage":"","size":205,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"prometheus:master","ref":"master","sha":"25694aa9ddec95833beec21a12466864bbff1f21","user":{"login":"prometheus","id":3380462,"avatar_url":"https://avatars.githubusercontent.com/u/3380462?v=3","gravatar_id":"","url":"https://api.github.com/users/prometheus","html_url":"https://github.com/prometheus","followers_url":"https://api.github.com/users/prometheus/followers","following_url":"https://api.github.com/users/prometheus/following{/other_user}","gists_url":"https://api.github.com/users/prometheus/gists{/gist_id}","starred_url":"https://api.github.com/users/prometheus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prometheus/subscriptions","organizations_url":"https://api.github.com/users/prometheus/orgs","repos_url":"https://api.github.com/users/prometheus/repos","events_url":"https://api.github.com/users/prometheus/events{/privacy}","received_events_url":"https://api.github.com/users/prometheus/received_events","type":"Organization","site_admin":false},"repo":{"id":30618733,"name":"client_python","full_name":"prometheus/client_python","owner":{"login":"prometheus","id":3380462,"avatar_url":"https://avatars.githubusercontent.com/u/3380462?v=3","gravatar_id":"","url":"https://api.github.com/users/prometheus","html_url":"https://github.com/prometheus","followers_url":"https://api.github.com/users/prometheus/followers","following_url":"https://api.github.com/users/prometheus/following{/other_user}","gists_url":"https://api.github.com/users/prometheus/gists{/gist_id}","starred_url":"https://api.github.com/users/prometheus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prometheus/subscriptions","organizations_url":"https://api.github.com/users/prometheus/orgs","repos_url":"https://api.github.com/users/prometheus/repos","events_url":"https://api.github.com/users/prometheus/events{/privacy}","received_events_url":"https://api.github.com/users/prometheus/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/prometheus/client_python","description":"Prometheus instrumentation library for Python applications","fork":false,"url":"https://api.github.com/repos/prometheus/client_python","forks_url":"https://api.github.com/repos/prometheus/client_python/forks","keys_url":"https://api.github.com/repos/prometheus/client_python/keys{/key_id}","collaborators_url":"https://api.github.com/repos/prometheus/client_python/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/prometheus/client_python/teams","hooks_url":"https://api.github.com/repos/prometheus/client_python/hooks","issue_events_url":"https://api.github.com/repos/prometheus/client_python/issues/events{/number}","events_url":"https://api.github.com/repos/prometheus/client_python/events","assignees_url":"https://api.github.com/repos/prometheus/client_python/assignees{/user}","branches_url":"https://api.github.com/repos/prometheus/client_python/branches{/branch}","tags_url":"https://api.github.com/repos/prometheus/client_python/tags","blobs_url":"https://api.github.com/repos/prometheus/client_python/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/prometheus/client_python/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/prometheus/client_python/git/refs{/sha}","trees_url":"https://api.github.com/repos/prometheus/client_python/git/trees{/sha}","statuses_url":"https://api.github.com/repos/prometheus/client_python/statuses/{sha}","languages_url":"https://api.github.com/repos/prometheus/client_python/languages","stargazers_url":"https://api.github.com/repos/prometheus/client_python/stargazers","contributors_url":"https://api.github.com/repos/prometheus/client_python/contributors","subscribers_url":"https://api.github.com/repos/prometheus/client_python/subscribers","subscription_url":"https://api.github.com/repos/prometheus/client_python/subscription","commits_url":"https://api.github.com/repos/prometheus/client_python/commits{/sha}","git_commits_url":"https://api.github.com/repos/prometheus/client_python/git/commits{/sha}","comments_url":"https://api.github.com/repos/prometheus/client_python/comments{/number}","issue_comment_url":"https://api.github.com/repos/prometheus/client_python/issues/comments{/number}","contents_url":"https://api.github.com/repos/prometheus/client_python/contents/{+path}","compare_url":"https://api.github.com/repos/prometheus/client_python/compare/{base}...{head}","merges_url":"https://api.github.com/repos/prometheus/client_python/merges","archive_url":"https://api.github.com/repos/prometheus/client_python/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/prometheus/client_python/downloads","issues_url":"https://api.github.com/repos/prometheus/client_python/issues{/number}","pulls_url":"https://api.github.com/repos/prometheus/client_python/pulls{/number}","milestones_url":"https://api.github.com/repos/prometheus/client_python/milestones{/number}","notifications_url":"https://api.github.com/repos/prometheus/client_python/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/prometheus/client_python/labels{/name}","releases_url":"https://api.github.com/repos/prometheus/client_python/releases{/id}","created_at":"2015-02-10T22:47:25Z","updated_at":"2015-11-01T05:33:29Z","pushed_at":"2015-10-28T22:33:01Z","git_url":"git://github.com/prometheus/client_python.git","ssh_url":"git@github.com:prometheus/client_python.git","clone_url":"https://github.com/prometheus/client_python.git","svn_url":"https://github.com/prometheus/client_python","homepage":"","size":752,"stargazers_count":33,"watchers_count":33,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":26,"mirror_url":null,"open_issues_count":6,"forks":26,"open_issues":6,"watchers":33,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/prometheus/client_python/pulls/59"},"html":{"href":"https://github.com/prometheus/client_python/pull/59"},"issue":{"href":"https://api.github.com/repos/prometheus/client_python/issues/59"},"comments":{"href":"https://api.github.com/repos/prometheus/client_python/issues/59/comments"},"review_comments":{"href":"https://api.github.com/repos/prometheus/client_python/pulls/59/comments"},"review_comment":{"href":"https://api.github.com/repos/prometheus/client_python/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/prometheus/client_python/pulls/59/commits"},"statuses":{"href":"https://api.github.com/repos/prometheus/client_python/statuses/8f5e62f9a60afdc51b5b2359a85310d783cc77d2"}}}}