{ "info": { "author": "chaostoolkit Team", "author_email": "contact@chaostoolkit.org", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "License :: Freely Distributable", "License :: OSI Approved :: Apache Software License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: Implementation", "Programming Language :: Python :: Implementation :: CPython" ], "description": "# Chaos Toolkit Extension for Open Tracing\n\n[![Build Status](https://travis-ci.org/chaostoolkit-incubator/chaostoolkit-opentracing.svg?branch=master)](https://travis-ci.org/chaostoolkit-incubator/chaostoolkit-opentracing)\n[![Python versions](https://img.shields.io/pypi/pyversions/chaostoolkit-opentracing.svg)](https://www.python.org/)\n\nThis project is an extension for the Chaos Toolkit for [OpenTracing][].\n\n[opentracing]: https://opentracing.io/\n\nHere is an example of what it could look like with the Jaeger backend.\n\n![OpenTracing](https://github.com/chaostoolkit-incubator/chaostoolkit-opentracing/raw/master/example.png \"Open Tracing with Jaeger\")\n\n\n## Install\n\nThis package requires Python 3.5+\n\nTo be used from your experiment, this package must be installed in the Python\nenvironment where [chaostoolkit][] already lives.\n\n[chaostoolkit]: https://github.com/chaostoolkit/chaostoolkit\n\n```\n$ pip install -U chaostoolkit-opentracing\n```\n\n## Usage\n\nCurrently, this extension only provides control support to send traces to\nyour provider during the execution of the experiment. It does not yet expose\nany probes or actions per-se.\n\nTo use this control, add the following section to your experiment, at the\ntop-level:\n\n```json\n{\n \"configuration\": {\n \"tracing_provider\": \"jaeger\",\n \"tracing_host\": \"127.0.0.1\",\n \"tracing_port\": 6831\n },\n \"controls\": [\n {\n \"name\": \"opentracing\",\n \"provider\": {\n \"type\": \"python\",\n \"module\": \"chaostracing.control\"\n }\n }\n ]\n}\n```\n\nThis will automatically create a [Jaeger][] client to emit traces onto the\naddress `127.0.0.1:6831`.\n\n[jaeger]: https://www.jaegertracing.io/\n\n### Use from other extensions\n\nYou may also access the tracer from other extensions as follows:\n\n```python\nimport opentracing\n\ndef some_function(...):\n opentracing.tracer\n```\n\nAs not all Open Tracing providers support yet to fetch the active span from\nthe tracer (Open Tracing 2 specification), we attach the following attributes\nto the tracer instance:\n\n```python\ntracer.experiment_span # span during the lifetime of the experiment\ntracer.hypothesis_span # span during the lifetime of the hypothesis\ntracer.method_span # span during the lifetime of the method\ntracer.rollback_span # span during the lifetime of the rollback\ntracer.activity_span # span during the lifetime of an activity\n```\n\nFor instance, assuming you have an extension that makes a HTTP call you want\nto trace specifically, you could do this from your extension's code:\n\n```python\nimport opentracing\nimport requests\n\ndef my_activity(...):\n headers = {}\n\n tracer = opentracing.tracer\n parent_span = tracer.activity_span\n span = tracer.start_span(\"my-inner-span\", child_of=parent_span)\n span.set_tag('http.method','GET')\n span.set_tag('http.url', url)\n span.set_tag('span.kind', 'client')\n span.tracer.inject(span, 'http_headers', headers)\n\n r = requests.get(url, headers=headers)\n\n span.set_tag('http.status_code', r.status_code)\n span.finish()\n```\n\nBecause the opentracing exposes a noop tracer when non has been initialized,\nit should be safe to have that code in your extensions without having to\ndetermine if the extension has been enabled in the experiment.\n\n## Open Tracing Provider Support\n\nFor now, only the Jaeger tracer is supported but [other backends][backends]\nwill be added as need be in the future.\n\n[backends]: https://opentracing.io/docs/supported-tracers/\n\n### Jaeger tracer\n\nTo install the necessary dependencies for the Jaeger tracer, please run:\n\n```\n$ pip install chaostoolkit-opentracing[jaeger]\n```\n\nUnfortunately, the Jaeger client does not yet support Open Tracing 2.0.\n\n\n## Test\n\nTo run the tests for the project execute the following:\n\n```\n$ pytest\n```\n\n## Contribute\n\nIf you wish to contribute more functions to this package, you are more than\nwelcome to do so. Please, fork this project, make your changes following the\nusual [PEP 8][pep8] code style, sprinkling with tests and submit a PR for\nreview.\n\n[pep8]: https://pycodestyle.readthedocs.io/en/latest/\n\nThe Chaos Toolkit projects require all contributors must sign a\n[Developer Certificate of Origin][dco] on each commit they would like to merge\ninto the master branch of the repository. Please, make sure you can abide by\nthe rules of the DCO before submitting a PR.\n\n[dco]: https://github.com/probot/dco#how-it-works\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://chaostoolkit.org", "keywords": "", "license": "Apache License Version 2.0", "maintainer": "", "maintainer_email": "", "name": "chaostoolkit-opentracing", "package_url": "https://pypi.org/project/chaostoolkit-opentracing/", "platform": "", "project_url": "https://pypi.org/project/chaostoolkit-opentracing/", "project_urls": { "Homepage": "http://chaostoolkit.org" }, "release_url": "https://pypi.org/project/chaostoolkit-opentracing/0.1.2/", "requires_dist": [ "chaostoolkit-lib (>=1.0.0rc1)", "logzero", "opentracing", "opentracing (<2,>=1.2.2); extra == 'jaeger'", "jaeger-client (==3.10.0); extra == 'jaeger'" ], "requires_python": ">=3.5.*", "summary": "Chaos Toolkit OpenTracing Extension", "version": "0.1.2" }, "last_serial": 4567348, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "3c354718c5a100ece70410686f80b0ff", "sha256": "07f6f1f9be369316a3f8be4cd21b52d6e4285103432b850d94036df5211df367" }, "downloads": -1, "filename": "chaostoolkit_opentracing-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "3c354718c5a100ece70410686f80b0ff", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5.*", "size": 5192, "upload_time": "2018-12-03T21:43:24", "url": "https://files.pythonhosted.org/packages/d8/77/dba039b08d2c9ba8db1e9a8da6746ba85a55acf93a684881204a2f03261f/chaostoolkit_opentracing-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7357e9df78f626c59b7b9b5b0c60fcde", "sha256": "9a858ddb76ced374fca688f7bf84bfc9b7e79c989c5228431bb1707480fd1454" }, "downloads": -1, "filename": "chaostoolkit-opentracing-0.1.0.tar.gz", "has_sig": false, "md5_digest": "7357e9df78f626c59b7b9b5b0c60fcde", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5.*", "size": 5338, "upload_time": "2018-12-03T21:43:27", "url": "https://files.pythonhosted.org/packages/ff/48/4889e0ad438ccd0f8ca543629253cd2a85c5f2cffd252904c706d8484429/chaostoolkit-opentracing-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "5d09e9c2d8325691ab8f066534f71441", "sha256": "ca1c6f1877740127e67eb7186d5bab71428ea7669bf3345fc2bd3d808795d99b" }, "downloads": -1, "filename": "chaostoolkit_opentracing-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "5d09e9c2d8325691ab8f066534f71441", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5.*", "size": 5765, "upload_time": "2018-12-04T09:30:39", "url": "https://files.pythonhosted.org/packages/16/d3/a9451e977c9369597656e9045f3a6cbd9c2ebe1e2b5581c5db806145d04c/chaostoolkit_opentracing-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "74491f1524d661491da178a40b12fb44", "sha256": "b568d683e2c160df6324eb77b1493d06709f973a07abde51b145e467ba7c9809" }, "downloads": -1, "filename": "chaostoolkit-opentracing-0.1.1.tar.gz", "has_sig": false, "md5_digest": "74491f1524d661491da178a40b12fb44", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5.*", "size": 11522, "upload_time": "2018-12-04T09:30:40", "url": "https://files.pythonhosted.org/packages/88/7d/bec31b15ef63780b8c34e6cf563a94f94082640ef92a0c518ccf9b7db204/chaostoolkit-opentracing-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "8622c77486a81fa2784c6b634d89f9cd", "sha256": "b1603b0a220399b0ce3a42295c37e6e9053587953a529f250af2c564fcef1fab" }, "downloads": -1, "filename": "chaostoolkit_opentracing-0.1.2-py3-none-any.whl", "has_sig": false, "md5_digest": "8622c77486a81fa2784c6b634d89f9cd", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5.*", "size": 5942, "upload_time": "2018-12-06T10:30:26", "url": "https://files.pythonhosted.org/packages/44/0a/46f5bb3bee5e3aef84de0240321ccedc9be6f59f1cace6e78363cc995f68/chaostoolkit_opentracing-0.1.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a26cecae9d1bc8241c5b47ec42566b5a", "sha256": "ba049cfd2745b50f9e4942356f1d4a84cb068439b428e75af60be10c5e0053bd" }, "downloads": -1, "filename": "chaostoolkit-opentracing-0.1.2.tar.gz", "has_sig": false, "md5_digest": "a26cecae9d1bc8241c5b47ec42566b5a", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5.*", "size": 11799, "upload_time": "2018-12-06T10:30:27", "url": "https://files.pythonhosted.org/packages/6a/c2/09acb125621854edf8053c6defee2b7540e964ebd12f8a3fb0edb514fe69/chaostoolkit-opentracing-0.1.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "8622c77486a81fa2784c6b634d89f9cd", "sha256": "b1603b0a220399b0ce3a42295c37e6e9053587953a529f250af2c564fcef1fab" }, "downloads": -1, "filename": "chaostoolkit_opentracing-0.1.2-py3-none-any.whl", "has_sig": false, "md5_digest": "8622c77486a81fa2784c6b634d89f9cd", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5.*", "size": 5942, "upload_time": "2018-12-06T10:30:26", "url": "https://files.pythonhosted.org/packages/44/0a/46f5bb3bee5e3aef84de0240321ccedc9be6f59f1cace6e78363cc995f68/chaostoolkit_opentracing-0.1.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a26cecae9d1bc8241c5b47ec42566b5a", "sha256": "ba049cfd2745b50f9e4942356f1d4a84cb068439b428e75af60be10c5e0053bd" }, "downloads": -1, "filename": "chaostoolkit-opentracing-0.1.2.tar.gz", "has_sig": false, "md5_digest": "a26cecae9d1bc8241c5b47ec42566b5a", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5.*", "size": 11799, "upload_time": "2018-12-06T10:30:27", "url": "https://files.pythonhosted.org/packages/6a/c2/09acb125621854edf8053c6defee2b7540e964ebd12f8a3fb0edb514fe69/chaostoolkit-opentracing-0.1.2.tar.gz" } ] }