{ "info": { "author": "Nicholas Amorim", "author_email": "nicholas@santos.ee", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "[![Build Status][ci-img]][ci] [![Coverage Status][cov-img]][cov]\n\n\n# opentracing-python-cassandra\n\nInstrumentation tools to enable tracing for [cassandra-driver](https://github.com/datastax/python-driver).\n\n```\npip install cassandra_opentracing\n```\n\n## Usage\n\n\n```python\n# set up your tracer\ncluster = Cluster()\nsession = cluster.connect('my_keyspace')\nQueryTracing(self.session)\n```\n\nThis will automatically trace all your queries (except for `BatchStatement`, see Known Issues). The default span operation name is `execute` for all queries. Operation name are meant to be low cardinality and there's a standard tag for the query statement: `db.statement`.\n\n\n### Using fixed span name\n\n```python\nQueryTracing(self.session, span_name='execute')\n```\n\nAll the spans will be sent to the tracer with the name `execute`. Note the query string will still be sent in the tag `db.statement`.\n\n### Using a prefix\n\n```python\nQueryTracing(self.session, prefix='Custom')\n```\n\nAll the spans will contain a prefix and it will looke like: \"Custom: SELECT * FROM...\"\n\n### Using query string as span name\n\n```python\n# set up your tracer\ncluster = Cluster()\nsession = cluster.connect('my_keyspace')\nQueryTracing(self.session, use_querystring_as_name=True)\n```\n\nIf you query contains parameters, the query will include the `%s` or `?`. The span will be the query string, e.g: `SELECT * FROM test_table WHERE name = %s`.\n\nWhen passing `use_querystring_as_name`, you can still use `prefix` but any value passed in `span_name` will be ignored.\n\n### Adding more span tags\n\nAll you have to is:\n\n```python\ncluster = Cluster()\nsession = cluster.connect('my_keyspace')\nQueryTracing(self.session, span_tags={'custom_tag': 'value'})\n```\n\nAll queries will contain the custom tags.\n\n### Using a custom tracer\n\nYou may pass a `tracer` argument to QueryTracing. If you don't, the default `opentracing.tracer` will be used.\n\n## Tags\n\nAll traces will contain the following tags:\n\n### OpenTracing standard tags:\n\n- `db.type`: cassandra\n- `component`: `cassandra-driver`\n- `db.instance`: The execution keyspace except when the keyspace is overriden on the query string (see Known Issues).\n- `db.statement`: The query string itself.\n- `consistency_level`: If the query specified a consistency level, this tag will be present.\n- `error`: In case of error, this will be set to True and a log will be issued with the error message.\n\n### Tags added by this library\n\n- `command`: This indicates the CQL operation, e.g: `SELECT`, `UPDATE`, `CREATE KEYSPACE`, etc.\n- `paginated`: If the query is pagined, this will be set to True.\n- `reported_duration`: The time taken to execute the query. Note that this time takes into account the network roundtrip as well.\n\n## Known Issues\n\n- BatchStatement are yet unsupported as there is no simple way to get the executed query strings.\n- Queries that override the keyspace (`SELECT * FROM keyspace.table`) won't have the overriden keyspace sent to the tracer.\n\n[ci-img]: https://travis-ci.org/opentracing-contrib/python-cassandra.svg?branch=master\n[ci]: https://travis-ci.org/opentracing-contrib/python-cassandra\n[cov-img]: https://codecov.io/gh/nicholasamorim/opentracing-python-cassandra/branch/master/graph/badge.svg\n[cov]: https://codecov.io/gh/nicholasamorim/opentracing-python-cassandra\n", "description_content_type": "", "docs_url": null, "download_url": "https://github.com/nicholasamorim/opentracing-python-cassandra/tarball/0.0.8\n", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "", "keywords": "", "license": "Apache License 2.0", "maintainer": "", "maintainer_email": "", "name": "cassandra_opentracing", "package_url": "https://pypi.org/project/cassandra_opentracing/", "platform": "any", "project_url": "https://pypi.org/project/cassandra_opentracing/", "project_urls": { "Download": "https://github.com/nicholasamorim/opentracing-python-cassandra/tarball/0.0.8\n" }, "release_url": "https://pypi.org/project/cassandra_opentracing/0.0.8/", "requires_dist": null, "requires_python": "", "summary": "OpenTracing support for Cassandra Driver", "version": "0.0.8" }, "last_serial": 5420189, "releases": { "0.0.4": [ { "comment_text": "", "digests": { "md5": "2c8f4c226b24b66e71d7658a1441a43a", "sha256": "724f44947d61670d00ef26d31487b4f0e11f4f10006c632ef0396d4e5ff2807a" }, "downloads": -1, "filename": "cassandra_opentracing-0.0.4.tar.gz", "has_sig": false, "md5_digest": "2c8f4c226b24b66e71d7658a1441a43a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8424, "upload_time": "2019-04-29T00:03:13", "url": "https://files.pythonhosted.org/packages/86/a8/ebd21abee712ea15e93b8ec6be206a11a677e74c2a677cb36271de38f941/cassandra_opentracing-0.0.4.tar.gz" } ], "0.0.5": [ { "comment_text": "", "digests": { "md5": "b6b08852cb053e8fff798d1258ffc08a", "sha256": "13f879a44b4a9245ca7f3578d672185e02c6335f2df53c23ee2e46a581a67969" }, "downloads": -1, "filename": "cassandra_opentracing-0.0.5.tar.gz", "has_sig": false, "md5_digest": "b6b08852cb053e8fff798d1258ffc08a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8279, "upload_time": "2019-04-29T08:34:22", "url": "https://files.pythonhosted.org/packages/c4/e0/52393763356a06d89465465a099e39e7af32579f5c9e7263f344c1f2227d/cassandra_opentracing-0.0.5.tar.gz" } ], "0.0.7": [ { "comment_text": "", "digests": { "md5": "731fd291fbe99d09a6adac5eecfaa278", "sha256": "07e2cad8e5598c6431c0a7472acaa2b894c85dd4a8877f3bcf1f7bdac5c72754" }, "downloads": -1, "filename": "cassandra_opentracing-0.0.7.tar.gz", "has_sig": false, "md5_digest": "731fd291fbe99d09a6adac5eecfaa278", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8320, "upload_time": "2019-06-19T13:01:53", "url": "https://files.pythonhosted.org/packages/fe/51/890ef61cae6514fcc3505a3f472b031fc499426a9731064b93044006a6b8/cassandra_opentracing-0.0.7.tar.gz" } ], "0.0.8": [ { "comment_text": "", "digests": { "md5": "da09a1d6f39bfef7f09f14baca21dc95", "sha256": "e79f33df07a8cf763fbaa8a453479a4643c55c4ab9bb8bce2ec463f173b3a8ee" }, "downloads": -1, "filename": "cassandra_opentracing-0.0.8.tar.gz", "has_sig": false, "md5_digest": "da09a1d6f39bfef7f09f14baca21dc95", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8310, "upload_time": "2019-06-19T13:08:45", "url": "https://files.pythonhosted.org/packages/4a/87/9cd81b0a4bc0199bd7b9e270ac369497babe725f872bc466538b27426c95/cassandra_opentracing-0.0.8.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "da09a1d6f39bfef7f09f14baca21dc95", "sha256": "e79f33df07a8cf763fbaa8a453479a4643c55c4ab9bb8bce2ec463f173b3a8ee" }, "downloads": -1, "filename": "cassandra_opentracing-0.0.8.tar.gz", "has_sig": false, "md5_digest": "da09a1d6f39bfef7f09f14baca21dc95", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8310, "upload_time": "2019-06-19T13:08:45", "url": "https://files.pythonhosted.org/packages/4a/87/9cd81b0a4bc0199bd7b9e270ac369497babe725f872bc466538b27426c95/cassandra_opentracing-0.0.8.tar.gz" } ] }