{ "info": { "author": "David Reid", "author_email": "david.reid@rackspace.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Framework :: Twisted", "License :: OSI Approved :: Apache Software License", "Programming Language :: Python :: 2.7" ], "description": "tryfer: A Twisted Zipkin Tracer Library\n=======================================\n\nZipkin_ is a Distributed Tracing system, tryfer is a Python/Twisted_ client\nlibrary for Zipkin.\n\nIt's design is heavily influenced by Finagle_'s tracing libraries.\n\nHTTP Tracing\n------------\n\nTryfer natively supports tracing of HTTP requests on both the client and the\nserver, and relates these requests by passing a series of HTTP headers along\nwith the request.\n\nClient\n~~~~~~\n\nThe client side of this conversation is the ``TracingAgent`` which uses\nTwisted's composable HTTP/1.1 client architecture to record ``CLIENT_SEND`` and\n``CLIENT_RECV`` annotations for your request. In addition it'll record\nthe full requested URL as a string annotation named ``http.uri``.\n\nServer\n~~~~~~\n\nOn the server you can wrap the root resource of your application in a\n``TracingWrapperResource`` and it will automatically record ``SERVER_RECV`` and\n``SERVER_SEND`` annotations. It also provides access to the trace via the\nrequest argument, so you can record extra annotations.\n\n::\n\n def render(self, request):\n trace = request.getComponent(ITrace)\n trace.record(Annotation.string('name', 'value'))\n\n\nHeaders\n~~~~~~~\n\n``TracingAgent`` and ``TracingWrapperResource`` support a subset of headers defined by Finagle_.\n\n* ``X-B3-TraceId`` - hex encoded trace id.\n* ``X-B3-SpanId`` - hex encoded span id.\n* ``X-B3-ParentSpanId`` - hex encoded span id of parent span.\n\nExamples\n~~~~~~~~\n\nIn the ``examples/`` subdirectory you'll find two python scripts (one client and\none server) which demonstrate the usage and expected output.\n\nStart by opening two terminals and going to the tryfer source directory.\n\nIn terminal #1 we can start the server using `twistd`::\n\n tryfer> twistd -n -y examples/tracing-server.tac\n 2012-09-05 13:22:02-0700 [-] Log opened.\n 2012-09-05 13:22:02-0700 [-] twistd 12.1.0 (/Users/dreid/.virtualenvs/tracing/bin/python 2.7.2) starting up.\n 2012-09-05 13:22:02-0700 [-] reactor class: twisted.internet.selectreactor.SelectReactor.\n 2012-09-05 13:22:02-0700 [-] Site starting on 8080\n 2012-09-05 13:22:02-0700 [-] Starting factory \n\nIn terminal #2 we will run the client which will make a single HTTP request to\nthe server::\n\n tryfer> python examples/tracing-client.py\n [\n {\n \"annotations\": [\n {\n \"type\": \"string\",\n \"value\": \"http://localhost:8080/README.rst\",\n \"key\": \"http.uri\"\n },\n {\n \"type\": \"timestamp\",\n \"value\": 1346876525257644,\n \"key\": \"cs\"\n },\n {\n \"type\": \"timestamp\",\n \"value\": 1346876525270536,\n \"key\": \"cr\"\n }\n ],\n \"trace_id\": \"00e5f721d19e25fa\",\n \"name\": \"GET\",\n \"span_id\": \"007fe79f2c63db97\"\n }\n ]\n Received 200 response.\n\n\nHere we see some output from the DebugTracer which simply prints all\nannotations it's asked to trace to stdout in json format. Here we've included\nour first annotation which is the http.uri we are requesting.\n\nNow in terminal #1 we should see the following::\n\n 2012-09-05 13:22:05-0700 [HTTPChannel,0,127.0.0.1] 127.0.0.1 - - [05/Sep/2012:20:22:05 +0000] \"GET /README.rst HTTP/1.1\" 200 4829 \"-\" \"-\"\n 2012-09-05 13:22:05-0700 [EndAnnotationTracer] Sending trace: (64729494289524218, 36001992872811415) w/ (,)\n [\n {\n \"annotations\": [\n {\n \"host\": {\n \"service_name\": \"tracing-server-example\",\n \"ipv4\": \"127.0.0.1\",\n \"port\": 8080\n },\n \"type\": \"timestamp\",\n \"value\": 1346876525268525,\n \"key\": \"sr\"\n },\n {\n \"host\": {\n \"service_name\": \"tracing-server-example\",\n \"ipv4\": \"127.0.0.1\",\n \"port\": 8080\n },\n \"type\": \"timestamp\",\n \"value\": 1346876525270173,\n \"key\": \"ss\"\n }\n ],\n \"trace_id\": \"00e5f721d19e25fa\",\n \"name\": \"GET\",\n \"span_id\": \"007fe79f2c63db97\"\n }\n ]\n\n\nLicense\n-------\n::\n\n Copyright (C) 2012 Rackspace Hosting, Inc\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.. _Zipkin: https://github.com/twitter/zipkin\n.. _Twisted: http://twistedmatrix.com/\n.. _Finagle: https://github.com/twitter/finagle/tree/master/finagle-zipkin", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/racker/tryfer", "keywords": null, "license": "APL2", "maintainer": null, "maintainer_email": null, "name": "tryfer", "package_url": "https://pypi.org/project/tryfer/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/tryfer/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/racker/tryfer" }, "release_url": "https://pypi.org/project/tryfer/0.2.2/", "requires_dist": null, "requires_python": null, "summary": "Twisted Zipkin Tracing Library", "version": "0.2.2" }, "last_serial": 749521, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "33e564810cbad03cdca72f0f75f1b197", "sha256": "299f65db866f159e6fee8e526840deb9850120f4166515fcbb2ab97844b68c21" }, "downloads": -1, "filename": "tryfer-0.1.tar.gz", "has_sig": false, "md5_digest": "33e564810cbad03cdca72f0f75f1b197", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21493, "upload_time": "2012-09-07T17:30:14", "url": "https://files.pythonhosted.org/packages/ed/bd/598a6d3a5aa2ad0cf0c30eb5f59c928c3823814b36d8d8ac960cb1f36dff/tryfer-0.1.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "74b8acc471cde071dddc10cb32a8fa3d", "sha256": "5dd2befe2db56c388ae5e7a0b7b5a3a6f6b1382fef67926de8174112f556d950" }, "downloads": -1, "filename": "tryfer-0.2.0.tar.gz", "has_sig": false, "md5_digest": "74b8acc471cde071dddc10cb32a8fa3d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22862, "upload_time": "2012-09-17T20:24:32", "url": "https://files.pythonhosted.org/packages/37/8f/51863b2882cb28b37c89e82826241cb3da7dfc559811726570614d8cd82d/tryfer-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "6ef97d17ff1f1a87861e585e7ad810e6", "sha256": "27f778e51f2f0c09a21520a12cddf450d492d654f447229ce90241d5d35c4ce1" }, "downloads": -1, "filename": "tryfer-0.2.1.tar.gz", "has_sig": false, "md5_digest": "6ef97d17ff1f1a87861e585e7ad810e6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23272, "upload_time": "2012-09-21T18:09:30", "url": "https://files.pythonhosted.org/packages/d7/de/513a128028335170c31caf0d745b11cc4f78cd4195ead4d573725c66dfb9/tryfer-0.2.1.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "432b0b59aad58cf210dc97845f3449f2", "sha256": "29d9fed69e5be815095d3e0ea329602618844dcf505db6b7a932e389cbb8a2cc" }, "downloads": -1, "filename": "tryfer-0.2.2.tar.gz", "has_sig": false, "md5_digest": "432b0b59aad58cf210dc97845f3449f2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23772, "upload_time": "2012-09-24T17:37:21", "url": "https://files.pythonhosted.org/packages/d3/e4/a9219659904046f0cdd7d47f62e55fabbb0f311d45d2a99456fa934d0c36/tryfer-0.2.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "432b0b59aad58cf210dc97845f3449f2", "sha256": "29d9fed69e5be815095d3e0ea329602618844dcf505db6b7a932e389cbb8a2cc" }, "downloads": -1, "filename": "tryfer-0.2.2.tar.gz", "has_sig": false, "md5_digest": "432b0b59aad58cf210dc97845f3449f2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23772, "upload_time": "2012-09-24T17:37:21", "url": "https://files.pythonhosted.org/packages/d3/e4/a9219659904046f0cdd7d47f62e55fabbb0f311d45d2a99456fa934d0c36/tryfer-0.2.2.tar.gz" } ] }