{ "info": { "author": "onefinestay", "author_email": "engineering@onefinestay.com", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "Operating System :: MacOS :: MacOS X", "Operating System :: POSIX", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Topic :: Internet", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "# sentry-nameko\n\nThis library provides an custom Data Interface for Sentry allowing you to better\nintegrate [Nameko](https://github.com/onefinestay/nameko) Call ID Stacks in your\nlogged events.\n\n## Installing and Prerequisites\n\nYou need Sentry installed. Instructions can be found\n[here](http://sentry.readthedocs.org/en/latest/quickstart/index.html).\n\nInstall sentry-nameko into the virtualenv that your Sentry instance is installed\nin:\n\n```bash\npip install sentry-nameko\n```\n\nIn your sentry config (by default, at `~/.sentry/sentry.conf.py`), you need to\nextend the `SENTRY_ALLOWED_INTERFACES` setting to include our custom interface.\nYou'll probably want something like this:\n\n```python\nSENTRY_ALLOWED_INTERFACES = SENTRY_ALLOWED_INTERFACES.union(\n ['sentry_nameko.CallIdStack',]\n)\n```\n\n## Logging events example\n\nPresuming you're using built-in `logging`, and you've set up handlers to hit\nsentry, you can provide Call ID data to Sentry like so:\n\n```python\n\n# worker_ctx is a WorkerContext instance\n\nlogger.log(\n log_level,\n message,\n extra={\n 'tags': {\n 'call_id': worker_ctx.call_id,\n 'parent_call_id': worker_ctx.immediate_parent_call_id,\n },\n 'sentry_nameko.CallIdStack': {\n 'call_id_stack': worker_ctx.call_id_stack,\n },\n },\n)\n\n```\n\nThe tagging of the `call_id` and `parent_call_id` fields enables searches to be\nperformed on events accordingly. The use of `sentry_call_id_stack.CallIdStack`\ntriggers the custom data interface.\n\nThe `WorkerContext` class provides an `extra_for_logging` property where you \ncan provide a default value for the `extra` parameters of log statements. It's \nrecommended that you create an application specific sub-class where you return\nthe extra data above, as well as anything else you'd like logged. Nameko's \nbuilt-in log statements will automatically take advantage of this:\n\n```python\n\nclass MyApplicationWorkerContext(WorkerContext):\n @property\n def extra_for_logging(self):\n return {\n 'tags': {\n 'call_id': worker_ctx.call_id,\n 'parent_call_id': worker_ctx.immediate_parent_call_id,\n 'my_custom_tag': 'tag value',\n },\n 'sentry_nameko.CallIdStack': {\n 'call_id_stack': worker_ctx.call_id_stack,\n },\n }\n \nlogger.log(log_level, message, extra=worker_ctx.extra_for_logging)\n\n```\n\n## Contributing\n\n`sentry-nameko` is developed on GitHub, primarily by the development team at\n[onefinestay](http://www.onefinestay.com). The GitHub repository is\nhttps://github.com/onefinestay/sentry-nameko.\n\nYou are welcome and encouraged to contribute comments, suggestions, patches\nand feature requests.\n\n## License\n\nApache 2.0. See LICENSE for details.\n", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/onefinestay/sentry-nameko", "keywords": null, "license": "Apache License, Version 2.0", "maintainer": null, "maintainer_email": null, "name": "sentry-nameko", "package_url": "https://pypi.org/project/sentry-nameko/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/sentry-nameko/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://github.com/onefinestay/sentry-nameko" }, "release_url": "https://pypi.org/project/sentry-nameko/0.1.2/", "requires_dist": null, "requires_python": null, "summary": "Integration helpers for Sentry and Nameko", "version": "0.1.2" }, "last_serial": 972292, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "23730dd388a40aac4e4e50f0f2b2609d", "sha256": "67c1e3ffa12d7c527ea7ee6528de815321e408d9c3c520073b57d0585e7993e4" }, "downloads": -1, "filename": "sentry-nameko-0.1.0.tar.gz", "has_sig": false, "md5_digest": "23730dd388a40aac4e4e50f0f2b2609d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1574, "upload_time": "2014-01-14T10:53:37", "url": "https://files.pythonhosted.org/packages/9d/58/4149e96a7457a8df8a427665992c969884e8235f31973f4cbc5f31a61489/sentry-nameko-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "211498c63bb814a967441c04e3622d44", "sha256": "7d371e9d3ba9f49e539146e3394a55c63f92574a83fcb554b25f542e0e7862b4" }, "downloads": -1, "filename": "sentry-nameko-0.1.1.tar.gz", "has_sig": false, "md5_digest": "211498c63bb814a967441c04e3622d44", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3152, "upload_time": "2014-01-16T13:10:22", "url": "https://files.pythonhosted.org/packages/83/bf/963a3069935210084ae5aa3958f58ee2b6505b6671631c37d0dc7096ced2/sentry-nameko-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "56810d3c14f84a942e2f7a58184f975a", "sha256": "fda20941f2a6f124c3f0844e3f963418d39502c0c5ac88761166302f5bf9c528" }, "downloads": -1, "filename": "sentry-nameko-0.1.2.tar.gz", "has_sig": false, "md5_digest": "56810d3c14f84a942e2f7a58184f975a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3206, "upload_time": "2014-01-17T09:33:58", "url": "https://files.pythonhosted.org/packages/40/da/9d27816e2fa065c3500c9e5b8486f4a5f01e3d2a5919158bd0c0f3cb66d3/sentry-nameko-0.1.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "56810d3c14f84a942e2f7a58184f975a", "sha256": "fda20941f2a6f124c3f0844e3f963418d39502c0c5ac88761166302f5bf9c528" }, "downloads": -1, "filename": "sentry-nameko-0.1.2.tar.gz", "has_sig": false, "md5_digest": "56810d3c14f84a942e2f7a58184f975a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3206, "upload_time": "2014-01-17T09:33:58", "url": "https://files.pythonhosted.org/packages/40/da/9d27816e2fa065c3500c9e5b8486f4a5f01e3d2a5919158bd0c0f3cb66d3/sentry-nameko-0.1.2.tar.gz" } ] }