{ "info": { "author": "John Casey", "author_email": "jdcasey@commonjava.org", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License (GPL)", "Programming Language :: Python :: 2", "Topic :: Utilities" ], "description": "Carbon-to-Slack Relay Library for Python\n========================================\n\nThis library's main purpose is to relay metrics from a Slack channel to a Carbon daemon, for inclusion in a Graphite database. It also contains commands (and classes) used to send and receive metric messages to Carbon.\n\nConfiguration\n-------------\n\nYou can configure this library in two ways:\n\n`/etc/carbon-slack.yml` Configuration\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nThis is what the \"native\" YAML configuration file looks like::\n\n\ttoken: xoxp-1234567890-yadda-yadda # Application token from Slack\n\tcarbon-server: 127.0.0.1\n\tcarbon-port: 2023\n\tchannel: metrics\n\n**NOTE:** You can get a sample of this from the command line using::\n\n\t$ carbon-slack-init\n\nAny command provided in this library will expect to load the above configuration, by default using the ``/etc/carbon-slack.yml`` file (but you can also provide the configuration path using the ``--config | -c`` option).\n\nEmbedded in Your Configuration\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nIf you're using Carbon-Slack as a library, you can also load the necessary configuration elements from any ``dict`` using::\n\n\timport carbon_slack.config as conf\n\tconfig = conf.Config({\n\t\tconf.TOKEN: 'here is my Slack API token',\n\t\tconf.CHANNEL: 'metrics',\n\t\tconf.CARBON_SERVER: '127.0.0.1',\n\t\tconf.CARBON_PORT: 2023\n\t})\n\nThis is the same as::\n\n\timport carbon_slack.config as conf\n\tconfig = conf.Config({\n\t\t'token': 'here is my Slack API token',\n\t\t'channel': 'metrics',\n\t\t'carbon-server': 127.0.0.1,\n\t\t'carbon-port': 2023\n\t})\n\nAs you can see, you could initialize this directly from strings in a script, or by reading command line arguments, or from almost anywhere. You could even read in another YAML file that looked something like this::\n\n\tmy-app-id: 10\n\tmy-username: buildchimp\n\trelay:\n\t\ttoken: 'here is my Slack API token'\n\t\tchannel: metrics\n\t\tcarbon-server: 127.0.0.1\n\t\tcarbon-port: 2023\n\nThen, use something like the following to initialize your relay::\n\n\timport carbon_slack.config as conf\n\tfrom carbon_slack.relay import Relay\n\timport yaml\n\n\twith open('/path/to/app.yml') as f:\n\t\tdata = yaml.safe_load(f)\n\n\trelay = Relay(conf.Config(data['relay']))\n\nSending Manually\n----------------\n\nCarbon-Slack provides a command-line client for sending metrics, which can be used like this::\n\n\t$ carbon-slack-send test.metric 1234\n\nThe command-line version of the sender relies on the standard configuration file (see above), and will use the current time when sending the metric. It can only send one metric at a time currently.\n\nCarbon-Slack also provides a library-based approach, for sending metrics programmatically::\n\n\tfrom carbon_slack.slack import Sender\n\n\tsender = Sender(config)\n\tsender.send_metrics({'test.metric', 1234})\n\nRelaying to Carbon\n------------------\n\nRelaying is what Carbon-Slack is designed to do. It uses Slack as a more-or-less public message bus for sending metrics, which means neither the Graphite DB server nor any of the clients need to be exposed to the internet directly by opening holes in your firewalls. Both the client and the relay initiate connections to Slack and interact on a channel using plaintext.\n\nMetric messages in a Slack channel each contain one or more lines of the format::\n\n\tmetric.name value timestamp-in-seconds\n\nThis means you can send a group of metrics in a single message to save on protocol overhead. When the Relay client sees messages in this format, it parses them and sends them on to the Carbon daemon associated with your Graphite DB instance, then deletes the messages from the Slack channel.\n\nWhy delete the messages? It helps prevent duplicate processing.\n\nHere's an example of the Relay in action::\n\n\tfrom carbon_slack.relay import Relay\n\n\trelay = Relay(config)\n\n\twhile True:\n\t print \"Relayed %d metrics\" % relay.run()\n\nOf course, the relay is designed to work from the command line as well::\n\n\t$ carbon-slack-relay\n\nHowever, command-line usage will require you to use the normal configuration file format (either in the default location, or via the ``--config | -c`` command-line option).\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/jdcasey/carbon-slack", "keywords": "graphite carbon metrics monitoring slack", "license": "GPLv3+", "maintainer": "", "maintainer_email": "", "name": "carbon-slack", "package_url": "https://pypi.org/project/carbon-slack/", "platform": "", "project_url": "https://pypi.org/project/carbon-slack/", "project_urls": { "Homepage": "https://github.com/jdcasey/carbon-slack" }, "release_url": "https://pypi.org/project/carbon-slack/0.0.8/", "requires_dist": [ "slackclient", "click", "ruamel.yaml" ], "requires_python": "", "summary": "Use Slack as a bus for GraphiteDB / Carbon", "version": "0.0.8" }, "last_serial": 4126392, "releases": { "0.0.2": [ { "comment_text": "", "digests": { "md5": "8af3a79cf74ee7aff7081fd99775af8e", "sha256": "197e4ef320dd84849b7b0bed351f2c02dc5cc81dc12cd452876a16d80089a414" }, "downloads": -1, "filename": "carbon_slack-0.0.2-py2-none-any.whl", "has_sig": false, "md5_digest": "8af3a79cf74ee7aff7081fd99775af8e", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 10799, "upload_time": "2018-07-31T03:44:52", "url": "https://files.pythonhosted.org/packages/8b/60/f48c6bb198e7abedf31146012794fca4826e0bb1a86f1923615761048010/carbon_slack-0.0.2-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1db99c9c2990f5a7be1c10881c66d2e6", "sha256": "afe72946cae7fece74711b076b29201de305d3e9c899223158e8222e226a655c" }, "downloads": -1, "filename": "carbon-slack-0.0.2.tar.gz", "has_sig": false, "md5_digest": "1db99c9c2990f5a7be1c10881c66d2e6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19399, "upload_time": "2018-07-31T03:44:53", "url": "https://files.pythonhosted.org/packages/c7/76/26feba8a45ed6bc670dad58d46009cdf04ea6ca765e56d6f9811c2728995/carbon-slack-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "ee7e77b03dff551ed9972d5ffe1d93a9", "sha256": "3e8da800667b31b92ba209fa276ac66ab10f1e1e56822aba455c3fec826a9688" }, "downloads": -1, "filename": "carbon_slack-0.0.3-py2-none-any.whl", "has_sig": false, "md5_digest": "ee7e77b03dff551ed9972d5ffe1d93a9", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 10797, "upload_time": "2018-07-31T04:59:19", "url": "https://files.pythonhosted.org/packages/c8/54/4c2e1d1ce61a66741a28451b6b19fd5fb8b1e4262fdcdd71852ea4d165fc/carbon_slack-0.0.3-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2dade32cf331291b4423f29b4187b097", "sha256": "04122638163d7dd839faec55fe0550269522e42158cb6e8bc439aaa4748974ea" }, "downloads": -1, "filename": "carbon-slack-0.0.3.tar.gz", "has_sig": false, "md5_digest": "2dade32cf331291b4423f29b4187b097", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19390, "upload_time": "2018-07-31T04:59:20", "url": "https://files.pythonhosted.org/packages/25/ce/2a09bfe816fbf7f39391698ec734d20d6c4c184b2aedcbf42efeb0d94a0c/carbon-slack-0.0.3.tar.gz" } ], "0.0.5": [ { "comment_text": "", "digests": { "md5": "ca296a57add0fb42a07a965815efdc6d", "sha256": "000398a4fa2fd6f1119383fcf9d6e6c522024fa1247e808abf49dc4b3460a0fb" }, "downloads": -1, "filename": "carbon_slack-0.0.5-py2-none-any.whl", "has_sig": false, "md5_digest": "ca296a57add0fb42a07a965815efdc6d", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 10779, "upload_time": "2018-08-01T03:08:00", "url": "https://files.pythonhosted.org/packages/5c/89/5fe05967a9bc70ea067159d7afc331c57ab85d488160002b7b3edb897b98/carbon_slack-0.0.5-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "60f924afc56ef7e45d7673047afe46a0", "sha256": "ca8cbcc273805aba953cdddff358d13e450ed6c64dd54f3af54b2a5a99d3bb59" }, "downloads": -1, "filename": "carbon-slack-0.0.5.tar.gz", "has_sig": false, "md5_digest": "60f924afc56ef7e45d7673047afe46a0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19377, "upload_time": "2018-08-01T03:08:02", "url": "https://files.pythonhosted.org/packages/ad/54/8dcb8126ab74193ea2ee051d46dc2bde21b8b0ccd1f69d3ba0e352328ec9/carbon-slack-0.0.5.tar.gz" } ], "0.0.6": [ { "comment_text": "", "digests": { "md5": "08fb8d6e3476b7af460529fc0839817d", "sha256": "6efae6e15903b99092490bb068bab2b011602d3eedb5416fd496da6f240f2682" }, "downloads": -1, "filename": "carbon_slack-0.0.6-py2-none-any.whl", "has_sig": false, "md5_digest": "08fb8d6e3476b7af460529fc0839817d", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 10779, "upload_time": "2018-08-01T03:24:06", "url": "https://files.pythonhosted.org/packages/cc/99/fc1db9b43628b5563bb7202bface2138f4f997f643ad50802154b8fc3677/carbon_slack-0.0.6-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "cda5f0016961f86b1ce219278eec6ab8", "sha256": "4361d6d8a7e619395cfb6475416032f1247aa2a06a058ae545a5c3408abee133" }, "downloads": -1, "filename": "carbon-slack-0.0.6.tar.gz", "has_sig": false, "md5_digest": "cda5f0016961f86b1ce219278eec6ab8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19376, "upload_time": "2018-08-01T03:24:07", "url": "https://files.pythonhosted.org/packages/6a/e1/9d762810fda5c5113325d320efb560f2c17cc2339d941fdf918f4f3b7029/carbon-slack-0.0.6.tar.gz" } ], "0.0.7": [ { "comment_text": "", "digests": { "md5": "c92dead9045f5ebaa139b0fcdfb2fa46", "sha256": "a1dcbdc326b9ea6c0425fa3752cb9094a2e598e9561c752880b3a199f5f61d13" }, "downloads": -1, "filename": "carbon_slack-0.0.7-py2-none-any.whl", "has_sig": false, "md5_digest": "c92dead9045f5ebaa139b0fcdfb2fa46", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 10780, "upload_time": "2018-08-01T18:33:10", "url": "https://files.pythonhosted.org/packages/9d/da/f21a6d8bedee65ab279cadc5b0a3b5811cb8e488e2f8dc92184b0f511af6/carbon_slack-0.0.7-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "37c48b67a782e0b6a2f6911e285da71f", "sha256": "24f12a22ac6863dc2db74c35e66262b0d75e5b764f3872b9dd85561875cea687" }, "downloads": -1, "filename": "carbon-slack-0.0.7.tar.gz", "has_sig": false, "md5_digest": "37c48b67a782e0b6a2f6911e285da71f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19382, "upload_time": "2018-08-01T18:33:11", "url": "https://files.pythonhosted.org/packages/5c/32/a1279382d62dbc7e339cac41d27aea6950d1196147e1e0656db9a182ed5f/carbon-slack-0.0.7.tar.gz" } ], "0.0.8": [ { "comment_text": "", "digests": { "md5": "19fc9043e98a52bfab8940471b5cfdbf", "sha256": "b47dad3a821a47f6f2a23907966e5bc269f45aa9ce9d226af7f7c61dd14700f6" }, "downloads": -1, "filename": "carbon_slack-0.0.8-py2-none-any.whl", "has_sig": false, "md5_digest": "19fc9043e98a52bfab8940471b5cfdbf", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 10792, "upload_time": "2018-08-01T21:56:03", "url": "https://files.pythonhosted.org/packages/1b/3a/473bf5e35aec1e0c1318f9d12f8081276140e46598b0485698ef3da08be4/carbon_slack-0.0.8-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "04ccd6e821a54cd885a6d5fc8bb241fd", "sha256": "fb8bd9ecd7ae99602c824f0ede1efd0380d2a0b7c1a87bfe43b1ed24dfbf05c0" }, "downloads": -1, "filename": "carbon-slack-0.0.8.tar.gz", "has_sig": false, "md5_digest": "04ccd6e821a54cd885a6d5fc8bb241fd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19399, "upload_time": "2018-08-01T21:56:04", "url": "https://files.pythonhosted.org/packages/75/0f/88ff2cd407d3efc630b367d4b68405083f846eb5e563ad7d9dff801cc871/carbon-slack-0.0.8.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "19fc9043e98a52bfab8940471b5cfdbf", "sha256": "b47dad3a821a47f6f2a23907966e5bc269f45aa9ce9d226af7f7c61dd14700f6" }, "downloads": -1, "filename": "carbon_slack-0.0.8-py2-none-any.whl", "has_sig": false, "md5_digest": "19fc9043e98a52bfab8940471b5cfdbf", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 10792, "upload_time": "2018-08-01T21:56:03", "url": "https://files.pythonhosted.org/packages/1b/3a/473bf5e35aec1e0c1318f9d12f8081276140e46598b0485698ef3da08be4/carbon_slack-0.0.8-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "04ccd6e821a54cd885a6d5fc8bb241fd", "sha256": "fb8bd9ecd7ae99602c824f0ede1efd0380d2a0b7c1a87bfe43b1ed24dfbf05c0" }, "downloads": -1, "filename": "carbon-slack-0.0.8.tar.gz", "has_sig": false, "md5_digest": "04ccd6e821a54cd885a6d5fc8bb241fd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19399, "upload_time": "2018-08-01T21:56:04", "url": "https://files.pythonhosted.org/packages/75/0f/88ff2cd407d3efc630b367d4b68405083f846eb5e563ad7d9dff801cc871/carbon-slack-0.0.8.tar.gz" } ] }