{
"info": {
"author": "Vasilii Novikov",
"author_email": "novikov.vz@gmail.com",
"bugtrack_url": null,
"classifiers": [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Topic :: Software Development :: Libraries :: Python Modules"
],
"description": ".. image:: https://img.shields.io/badge/OpenTracing-enabled-blue.svg\n :target: http://opentracing.io\n :alt: OpenTracing Badge\n\n\nSupporting fire & forget Tornado coroutines in python opentracing\n=================================================================\n\n`Opentracing python library `_ provides nice mechanism for tracing of `Tornado `_ code based on coroutines.\n\nCoroutine must be invoked with `tracer_stack_context` that allows to isolate context and using parent scope in child corutines. It works only when you yielding child coroutines inside, but doesn't work with fire & forget coroutine.\nIn this case such coroutine can lose parent scope while yielding or take scope of unrelated coroutine (e.g. concurrent coroutines).\n\nTo avoid it you have to wrap coroutine by `tracer_stack_context` manually, and activate parent scope that you need right inside coroutine:\n\n.. code-block::\n\n from tornado import gen\n from opentracing import global_tracer\n from opentracing.scope_managers.tornado import tracer_stack_context\n\n @gen.corotine\n def do_someting_in_background(parent):\n with global_tracer().scope_manager.activate(parent, False):\n with global_tracer.start_active_span('do something', True):\n yield gen.sleep(0.5)\n # do something\n\n ...\n\n\n with global_tracer().start_active_span('work in background') as root:\n with tracer_stack_context():\n do_someting_in_background(root.span)\n\n\nff_coroutine\n------------\n\nThis library provides `ff_coroutine` decorator that does it for you:\n\n.. code-block::\n\n from opentracing import global_tracer\n from tornado_coroutines_opentracing import ff_coroutine\n\n @ff_coroutine\n def do_someting_in_background():\n with global_tracer.start_active_span('do something', True):\n yield gen.sleep(0.5)\n # do something\n\n ...\n\n\n with global_tracer().start_active_span('work in background'):\n do_someting_in_background()\n\n\nIt also works with nested coroutines:\n\n.. code-block::\n\n from opentracing import global_tracer\n from tornado_coroutines_opentracing import ff_coroutine\n\n @ff_coroutine\n def bar():\n with global_tracer.start_active_span('bar', True):\n # do something\n\n @ff_coroutine\n def foo():\n with global_tracer.start_active_span('foo', True):\n yield gen.sleep(0.5)\n bar()\n\n\n ...\n\n with global_tracer().start_active_span('work in background'):\n foo()\n\n\n`ff_coroutine` yielded as well as Tornado coroutine (via `gen.coroutine`):\n\n.. code-block::\n\n from opentracing import global_tracer\n from tornado_coroutines_opentracing import ff_coroutine\n\n @ff_coroutine\n def bar():\n with global_tracer.start_active_span('bar', True):\n # do something\n\n @ff_coroutine\n def foo():\n with global_tracer.start_active_span('foo', True):\n yield bar()\n yield gen.sleep(0.5)\n\n\n ...\n\n with global_tracer().start_active_span('work in background'):\n yield foo()\n\n\nSometimes you want to disable tracing in your application. You can disable `ff_coroutine` too:\n\n.. code-block::\n\n from tornado_coroutines_opentracing import State\n ...\n\n State.enabled = False\n\n\n\n**0.1.0**\n\n- First release.",
"description_content_type": "",
"docs_url": null,
"download_url": "",
"downloads": {
"last_day": -1,
"last_month": -1,
"last_week": -1
},
"home_page": "https://github.com/condorcet/tornado-coroutines-opentracing",
"keywords": "opentracing,tornado",
"license": "MIT",
"maintainer": "",
"maintainer_email": "",
"name": "tornado-coroutines-opentracing",
"package_url": "https://pypi.org/project/tornado-coroutines-opentracing/",
"platform": "any",
"project_url": "https://pypi.org/project/tornado-coroutines-opentracing/",
"project_urls": {
"Homepage": "https://github.com/condorcet/tornado-coroutines-opentracing"
},
"release_url": "https://pypi.org/project/tornado-coroutines-opentracing/0.1.0/",
"requires_dist": null,
"requires_python": ">=2.7",
"summary": "Opentracing instrumentation for Tornado that allows correct parent scope propagation for fire & forget coroutines.",
"version": "0.1.0"
},
"last_serial": 5988601,
"releases": {
"0.1.0": [
{
"comment_text": "",
"digests": {
"md5": "94ee829f27f2392c0c6ff9a258dacdb0",
"sha256": "0f210f2e281cd0c9e6699e0b9e0f34a1b3c4e3ef205a65a05f5d0e1fdce77f8e"
},
"downloads": -1,
"filename": "tornado-coroutines-opentracing-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "94ee829f27f2392c0c6ff9a258dacdb0",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=2.7",
"size": 4022,
"upload_time": "2019-10-17T09:19:06",
"url": "https://files.pythonhosted.org/packages/f2/f6/612474829cade3f1a47e9c4381187b9b8b34392a984021f770f5729f89e8/tornado-coroutines-opentracing-0.1.0.tar.gz"
}
]
},
"urls": [
{
"comment_text": "",
"digests": {
"md5": "94ee829f27f2392c0c6ff9a258dacdb0",
"sha256": "0f210f2e281cd0c9e6699e0b9e0f34a1b3c4e3ef205a65a05f5d0e1fdce77f8e"
},
"downloads": -1,
"filename": "tornado-coroutines-opentracing-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "94ee829f27f2392c0c6ff9a258dacdb0",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=2.7",
"size": 4022,
"upload_time": "2019-10-17T09:19:06",
"url": "https://files.pythonhosted.org/packages/f2/f6/612474829cade3f1a47e9c4381187b9b8b34392a984021f770f5729f89e8/tornado-coroutines-opentracing-0.1.0.tar.gz"
}
]
}