{ "info": { "author": "Arne Welzel", "author_email": "arne.welzel@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: BSD License", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3" ], "description": "# ``influxpy``\n\n[![Coverage Status](https://coveralls.io/repos/github/awelzel/influxpy/badge.svg?branch=master)](https://coveralls.io/github/awelzel/influxpy?branch=master) [![Build Status](https://travis-ci.org/awelzel/influxpy.svg?branch=master)](https://travis-ci.org/awelzel/influxpy)\n\n# About\nPython logging handler that sends messages to InfluxDB via UDP using\nthe line protocol. There is decidedly no support for the HTTP input.\n\nThe code was heavily inspired by and based on [graypy][1].\n\n# Usage\n\n## Example\n\n import logging\n import influxpy\n\n my_logger = logging.getLogger(\"test_logger\")\n my_logger.setLevel(logging.DEBUG)\n\n handler = influxpy.UDPHandler(\"localhost\", 8089, \"influxpy_logs\",\n global_tags={\"app\": \"example\"})\n my_logger.addHandler(handler)\n\n my_logger.debug(\"Hello InfluxDB.\")\n\n\nTracebacks are added as full messages::\n\n try:\n puff_the_magic_dragon()\n except NameError:\n my_logger.debug(\"No dragons here.\", exc_info=1)\n\n\n## InfluxDB Configuration\n\nThe UDP Input for InfluxDB has to be enabled in order to make use of this\nlibrary.\n\n # influxdb.conf:\n ...\n [[udp]]\n enabled = true\n bind-address = \":8089\"\n database = \"udp\"\n\nAlso take note of the [InfluxDB UDP documentation][2].\n\n\n## Configuration parameters\n\n``influxpy.UDPHandler``:\n\n * **host** - The host of the InfluxDB server.\n * **port** - The UDP port of the InfluxDB server.\n * **measurement** - The name of the measurement/table in InfluxDB.\n * **debugging_fields** - Send debugging fields if set to True. Defaults is to not include debugging fields.\n * **extra_fields** - send extra fields on the log record to InfluxDB if true (the default).\n * **fqdn** - Use ``socket.getfqdn()`` instead of ``socket.gethostname()`` to set the source host.\n * **localname** - Use the specified hostname as source host.\n * **global_tags** - optional dict of tags to add to every message.\n\n\n# Schema\n\n## Tags\n\nThe following tags will be added to every message:\n\n host, level, level_name, logger\n\nThe ``host`` is set to ``socket.gethostname()``, but can be changed\nby setting ``fqdn``, or overriding it completly by providing ``localname``.\n``level`` is the syslog level mapped to this message. ``level_name`` is\nthe respective Python logging level name (``INFO``, ``ERROR``, etc.).\nThe ``logger`` tag is simply the name of the Python logger.\n\nIt is possible to pass ``global_tags`` and thereby configure a set of\nstatic tags that are added to every message. For example, the following\nwill put ``datacenter=us-west`` and ``app=snakeoil`` as global tags.\n\n handler = influxpy.UDPHandler(\"127.0.0.1\", 8089, \"\",\n global_tags={\n \"datacenter\": \"us-west\",\n \"app\": \"snakeoil\"})\n\n## Fields\n\n message, full_message\n\nThe ``full_message`` field is added only to messages for which an exception\ntraceback is available. That is, when using ``logger.exception()``\nor setting ``exec_info=1`` explicitly.\n\nWhen ``debugging_fields`` is set to True, the following fields are added\nadditionally:\n\n file, function, line, pid, process_name, thread_name\n\nWhen ``extra_fields`` is set to True, any extra fields on the ``LogRecord``\ninstance are sent to InfluxDB. Adding extra fields can be achieved by\npassing the ``extra`` keyword argument to a logger call, or using\n``logging.LoggerAdapter``. See the Python logging documentation for\nmore information.\n\n my_logger.debug(\"Login successful.\", extra={\"username\": \"John\"})\n my_logger.info(\"It is warm.\", extra={\"temperature\": 26.3})\n my_logger.warn(\"Disk Report.\", extra={\"disk_utilization\": 73.4,\n \"disk_free_space_mb\": 63129})\n\nThis allows to conveniently add timeseries information that can be\nvisualized using Grafana.\n\n\n# Using with Django\n\nIt should be easy to integrate ``influxpy`` with Django's logging settings.\n\n\n# Credits:\n * [graypy][1] / Sever Banesiu\n\n\n[1]: https://github.com/severb/graypy\n[2]: https://docs.influxdata.com/influxdb/v1.6/supported_protocols/udp/", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/awelzel/influxpy", "keywords": "influxdb grafana logger logging udp", "license": "BSD License", "maintainer": "", "maintainer_email": "", "name": "influxpy", "package_url": "https://pypi.org/project/influxpy/", "platform": "", "project_url": "https://pypi.org/project/influxpy/", "project_urls": { "Homepage": "https://github.com/awelzel/influxpy" }, "release_url": "https://pypi.org/project/influxpy/0.2.1/", "requires_dist": null, "requires_python": "", "summary": "Python logging handler for sending messages to InfluxDB using the line protocol over UDP.", "version": "0.2.1" }, "last_serial": 4138524, "releases": { "0.0.2": [ { "comment_text": "", "digests": { "md5": "9bfdcfa10eb7bcaa804da9068a9e34e4", "sha256": "38036373c4a82056389620871c7182f0acc0310d1135b38a861e009c1f02714c" }, "downloads": -1, "filename": "influxpy-0.0.2.tar.gz", "has_sig": false, "md5_digest": "9bfdcfa10eb7bcaa804da9068a9e34e4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5175, "upload_time": "2018-08-05T01:07:55", "url": "https://files.pythonhosted.org/packages/77/a9/24234b5d36147d2e4d9208621853b54a4545d1fbc2bfae9797ae2a40d0df/influxpy-0.0.2.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "1751ca8185d3ca51de682995de5e1f0c", "sha256": "e9143605398ea15b50bac8c8809bca90d3242973972bd05f3791b01f7c90ef3c" }, "downloads": -1, "filename": "influxpy-0.1.1.tar.gz", "has_sig": false, "md5_digest": "1751ca8185d3ca51de682995de5e1f0c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5274, "upload_time": "2018-08-05T01:23:08", "url": "https://files.pythonhosted.org/packages/62/fd/99467bd8c62a54353914914804665c9605d6b8c718c3444e7e134694176b/influxpy-0.1.1.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "5a4e6f931f049c9b86aa964eb513df0c", "sha256": "b8099a74484a0307b6229ad7611d98cb3ac2f657b929e0553355c0fc3682c97e" }, "downloads": -1, "filename": "influxpy-0.2.0.tar.gz", "has_sig": false, "md5_digest": "5a4e6f931f049c9b86aa964eb513df0c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5431, "upload_time": "2018-08-05T21:46:41", "url": "https://files.pythonhosted.org/packages/17/7f/d959ed604f636211fabc0248a103b374c121940c17b4a035984521de9eb4/influxpy-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "33ed944bdf145ccca9a0a0579d02056b", "sha256": "b8a5398138288507f7c41bd9324ffc0b2cc7d59e7d7d5829742ab575ea132457" }, "downloads": -1, "filename": "influxpy-0.2.1.tar.gz", "has_sig": false, "md5_digest": "33ed944bdf145ccca9a0a0579d02056b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5516, "upload_time": "2018-08-05T22:09:03", "url": "https://files.pythonhosted.org/packages/42/c1/6f58f1ccdd89b09bb9b6f48f9c507c836f8982c885401275f55aca841759/influxpy-0.2.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "33ed944bdf145ccca9a0a0579d02056b", "sha256": "b8a5398138288507f7c41bd9324ffc0b2cc7d59e7d7d5829742ab575ea132457" }, "downloads": -1, "filename": "influxpy-0.2.1.tar.gz", "has_sig": false, "md5_digest": "33ed944bdf145ccca9a0a0579d02056b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5516, "upload_time": "2018-08-05T22:09:03", "url": "https://files.pythonhosted.org/packages/42/c1/6f58f1ccdd89b09bb9b6f48f9c507c836f8982c885401275f55aca841759/influxpy-0.2.1.tar.gz" } ] }