{ "info": { "author": "Alberto Donato", "author_email": "alberto.donato@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "Intended Audience :: System Administrators", "License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)", "Operating System :: POSIX :: Linux", "Programming Language :: Python :: 3 :: Only", "Topic :: Software Development :: Libraries", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Utilities" ], "description": "prometheus-aioexporter - Asyncio library for creating Prometheus exporters\n==========================================================================\n\n|Latest Version| |Build Status| |Coverage Status|\n\nprometheus-aioexporter is an aysncio-powered library to simplify writing\nPrometheus_ exporters.\n\nExporters are usually implemented as small daemons that expose metrics\nin text format through a web endpoint (usually ``/metrics``).\n\n\nUsage\n-----\n\nThe library provides a ``PrometheusExporterScript`` class that serves as an\nentry point to create services that export Prometheus metrics via an HTTP\nendpoint.\n\nCreating a new exporter is just a matter of subclassing\n``PrometheusExporterScript`` and implementing a few methods as needed.\n\nAn example usage is the following:\n\n.. code:: python\n\n from prometheus_aioexporter import PrometheusExporterScript\n\n\n class MyExporter(PrometheusExporterScript):\n \"\"\"My Prometheus exporter.\"\"\"\n\n def configure_argument_parser(self, parser):\n # Additional arguments to the script\n parser.add_argument('an-option', help='an option')\n # ...\n\n def configure(self, args):\n # Save attributes that are needed for later\n self.data = do_stuff()\n # ...\n\n async def on_application_startup(self, application):\n # Start other asyncio tasks at application startup\n use(self.data)\n # ...\n\n async def on_application_shutdown(self, application):\n # Stop other asyncio tasks at application shutdown\n use(self.data)\n # ...\n\n\n script = MyExporter()\n\n\nExporter command-line\n~~~~~~~~~~~~~~~~~~~~~\n\n``PrometheusExporterScript`` provides a few command-line arguments by default:\n\n.. code::\n\n optional arguments:\n -h, --help show this help message and exit\n -H HOST [HOST ...], --host HOST [HOST ...]\n host addresses to bind (default: localhost)\n -p PORT, --port PORT port to run the webserver on (default: 9090)\n -L {CRITICAL,ERROR,WARNING,INFO,DEBUG}, --log-level {CRITICAL,ERROR,WARNING,INFO,DEBUG}\n minimum level for log messages (default: WARNING)\n --process-stats include process stats in metrics (default: False)\n\nFurther options can be added by implementing ``configure_argument_parser()``,\nwhich receives the ``argparse.ArgumentParser`` instance used by the script.\n\nThe ``script`` variable from the example above can be referenced in\n``setup.py`` to generate the script, like\n\n.. code:: python\n\n setup(\n ...,\n entry_points={'console_scripts': ['script = path.to.script:script']},\n ...)\n\nThe ``name`` and ``description`` of the exporter can be customized by\nsetting the respective attributes in the script class.\n\n\nStartup configuration\n~~~~~~~~~~~~~~~~~~~~~\n\nAdditional initial setup (e.g. config file parsing) can be performed by the\nscript by implementing the ``configure()``. This is called at startup with the\nparsed argument (an ``argparse.Namespace`` instance).\n\n\nMetrics configuration\n~~~~~~~~~~~~~~~~~~~~~\n\nThe metrics exported by the script can be set up by calling ``create_metrics``\nwith a list of ``MetricConfig``\\s. This is typically done in ``configure()``:\n\n.. code:: python\n\n def configure(self, args):\n # ...\n self.create_metrics(\n [MetricConfig('metric1', 'a metric', 'gauge', {}),\n MetricConfig('metric2', 'another metric', 'counter', {})])\n\n\nWeb application setup\n~~~~~~~~~~~~~~~~~~~~~\n\nOn startup, ``PrometheusExporterScript`` creates a ``PrometheusExporter`` which\nincludes a web application that exposes metrics.\n\nIt's possible to customize and perform additional startup/shutdown tasks by\nimplementing the ``on_application_startup`` and ``on_application_shutdown``\ncoroutine methods, which are called with the application as parameter.\n\nThe ``PrometheusExporter`` instance is accessible via\n``application['exporter']``), and provides a ``set_metric_update_handler``\nmethod to register a hook to update metrics on each request, before the\nresponse is returned to the client. The registered function must return a\ncoroutine and is called with a dict mapping metric names to metric objects:\n\n.. code:: python\n\n async def on_application_startup(self, application):\n # ...\n application['exporter'].set_metric_update_handler(self._update_handler)\n\n async def _update_handler(self, metrics):\n for name, metric in metrics.items():\n metric.set(...)\n\n\n.. _Prometheus: https://prometheus.io/\n\n.. |Latest Version| image:: https://img.shields.io/pypi/v/prometheus-aioexporter.svg\n :target: https://pypi.python.org/pypi/prometheus-aioexporter\n.. |Build Status| image:: https://img.shields.io/travis/albertodonato/prometheus-aioexporter.svg\n :target: https://travis-ci.org/albertodonato/prometheus-aioexporter\n.. |Coverage Status| image:: https://img.shields.io/codecov/c/github/albertodonato/prometheus-aioexporter/master.svg\n :target: https://codecov.io/gh/albertodonato/prometheus-aioexporter", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/albertodonato/prometheus-aioexporter", "keywords": "prometheus exporter library", "license": "LGPLv3+", "maintainer": "Alberto Donato", "maintainer_email": "alberto.donato@gmail.com", "name": "prometheus-aioexporter", "package_url": "https://pypi.org/project/prometheus-aioexporter/", "platform": "", "project_url": "https://pypi.org/project/prometheus-aioexporter/", "project_urls": { "Homepage": "https://github.com/albertodonato/prometheus-aioexporter" }, "release_url": "https://pypi.org/project/prometheus-aioexporter/1.6.1/", "requires_dist": null, "requires_python": "", "summary": "Asyncio library for creating Prometheus exporters.", "version": "1.6.1" }, "last_serial": 5844217, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "bee5b6a200e1c1850503aa1765dea26e", "sha256": "b627fc5f2b02d9e3d6dc635f3391f2d1b992fe28bc723c1d2b472a39d226023a" }, "downloads": -1, "filename": "prometheus-aioexporter-0.1.0.tar.gz", "has_sig": false, "md5_digest": "bee5b6a200e1c1850503aa1765dea26e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9031, "upload_time": "2017-02-26T19:50:00", "url": "https://files.pythonhosted.org/packages/af/cb/b07d751cd523e00ce7602d68f8f337ec163205c51ebf9dbebaf7ad48c7b8/prometheus-aioexporter-0.1.0.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "8c38e9fdd2a073d8b4827d48c3178f82", "sha256": "7a29008d910489415a5fc540b92de4f5b9512ed60f1c81e7492ef2d1bdaf1217" }, "downloads": -1, "filename": "prometheus-aioexporter-0.2.0.tar.gz", "has_sig": false, "md5_digest": "8c38e9fdd2a073d8b4827d48c3178f82", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9153, "upload_time": "2017-02-28T00:14:49", "url": "https://files.pythonhosted.org/packages/3c/11/8fd678eb1897d0edb129aa4a4db09dda5a1435b05c5776eea583f1f7667a/prometheus-aioexporter-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "b41c2074a93c8428c0764b1e8d17b48d", "sha256": "a68c9ac45643251fc9ada74bb486fcf77cd1672a00a15ba91b7581f7f3fc48cf" }, "downloads": -1, "filename": "prometheus-aioexporter-0.2.1.tar.gz", "has_sig": false, "md5_digest": "b41c2074a93c8428c0764b1e8d17b48d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9209, "upload_time": "2017-02-28T00:27:35", "url": "https://files.pythonhosted.org/packages/66/d7/8283bd45a5e5bf4b768ae7eda5b4fbd7627b06c6d67c0bc6486faac375fa/prometheus-aioexporter-0.2.1.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "8afb0185711ea0a4a697f58c05b68eaf", "sha256": "b4b438c891dd0002f72c9834f2b7d98135a87e4d4f6917fb83afc66738654872" }, "downloads": -1, "filename": "prometheus-aioexporter-0.2.2.tar.gz", "has_sig": false, "md5_digest": "8afb0185711ea0a4a697f58c05b68eaf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9618, "upload_time": "2017-03-04T09:28:48", "url": "https://files.pythonhosted.org/packages/31/ae/0ec3d39677ecb03cc25b3fe0a10299da112835c09cfd3c68295153ec7a71/prometheus-aioexporter-0.2.2.tar.gz" } ], "1.0.0": [ { "comment_text": "", "digests": { "md5": "24400c556ef3dfcb3a62902936765e61", "sha256": "174f0459f9731e9a37c32d5a31290111da242c53351db735ef2bcb808269f37c" }, "downloads": -1, "filename": "prometheus-aioexporter-1.0.0.tar.gz", "has_sig": false, "md5_digest": "24400c556ef3dfcb3a62902936765e61", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9833, "upload_time": "2017-05-07T16:53:33", "url": "https://files.pythonhosted.org/packages/01/8a/546644d2a7185a18a4963f8708671e22ddda7853bf18a977e605d852f6e5/prometheus-aioexporter-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "e03531b5f8711e94f06bd24c0ad9330c", "sha256": "7e2bf03e9f7f645f5e61ca7b27fdac17b1b6a5c5e9753a23e0c01402a30bff2d" }, "downloads": -1, "filename": "prometheus-aioexporter-1.0.1.tar.gz", "has_sig": false, "md5_digest": "e03531b5f8711e94f06bd24c0ad9330c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9859, "upload_time": "2017-05-20T18:45:33", "url": "https://files.pythonhosted.org/packages/4f/85/9eb77740de06216becd711c6ce0cbfc5cde4c500626ae6f74466f90044a1/prometheus-aioexporter-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "5965c5989e8940fda2ed60529bb361c1", "sha256": "c99b1b8e38b34980a5c93c560e6ebf2f263019aac9efa242435e9b19d1923a13" }, "downloads": -1, "filename": "prometheus_aioexporter-1.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "5965c5989e8940fda2ed60529bb361c1", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 11914, "upload_time": "2017-10-14T22:41:56", "url": "https://files.pythonhosted.org/packages/8d/63/6bd2febd7e609c2dc282a974eed0ee25489cb1681eb40d3b3db5c64237cb/prometheus_aioexporter-1.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "fd5b9c6d3932ae23ee4248a4e743e4b9", "sha256": "397f6fc3758a9a4196981f0983a50f98ce56490510bff24a28ef17720909aaa3" }, "downloads": -1, "filename": "prometheus-aioexporter-1.0.2.tar.gz", "has_sig": false, "md5_digest": "fd5b9c6d3932ae23ee4248a4e743e4b9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10027, "upload_time": "2017-10-14T22:41:58", "url": "https://files.pythonhosted.org/packages/cf/a6/2e687c96a263662fa08e6f7b84e51661c2c1d47e8722b2598ef09aebf20f/prometheus-aioexporter-1.0.2.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "b7eeac4474c35d15058877c4f3e72939", "sha256": "31d8e00fc90499bd2e4a0e3ae9da9fd488701d3898ca9b45b72a5ece7007b915" }, "downloads": -1, "filename": "prometheus_aioexporter-1.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "b7eeac4474c35d15058877c4f3e72939", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 13333, "upload_time": "2017-10-24T23:36:40", "url": "https://files.pythonhosted.org/packages/36/b4/f71c4a90a19b6ddef701d0672ec4af0b02d1d1dc59abf0d682d2ed094eca/prometheus_aioexporter-1.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "76e9997dd4c8075aece7252cce3b8d75", "sha256": "ca5777891d7d27625827ccbd631cae906471d2fe3ea24ae0e81b6344184b91d7" }, "downloads": -1, "filename": "prometheus-aioexporter-1.1.0.tar.gz", "has_sig": false, "md5_digest": "76e9997dd4c8075aece7252cce3b8d75", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10860, "upload_time": "2017-10-24T23:36:41", "url": "https://files.pythonhosted.org/packages/5e/4a/0fa19fb589ffe56ec9f9a2dbb051ae37c79277326fa0e3e72626eceb3e83/prometheus-aioexporter-1.1.0.tar.gz" } ], "1.2.0": [ { "comment_text": "", "digests": { "md5": "433a346a582e820e8625a3093e7f6b8b", "sha256": "2f52b47bdd5c864ade4d3c0859cacc963a2217bcbcdbe333831dd5f783cde4e3" }, "downloads": -1, "filename": "prometheus_aioexporter-1.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "433a346a582e820e8625a3093e7f6b8b", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 13497, "upload_time": "2017-10-28T15:44:37", "url": "https://files.pythonhosted.org/packages/ba/a2/e29b0964f5a6f1b8f58cafaee817af762e39c84b61a5c16e2a5e4b1ab3da/prometheus_aioexporter-1.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6e8d14c1ef8dcfc0fcfd5e40453726cb", "sha256": "321c33e7b3178599ccfa1202dad1d6ec761fc17356ce9ba76b9af67bce1d1b4d" }, "downloads": -1, "filename": "prometheus-aioexporter-1.2.0.tar.gz", "has_sig": false, "md5_digest": "6e8d14c1ef8dcfc0fcfd5e40453726cb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11038, "upload_time": "2017-10-28T15:42:22", "url": "https://files.pythonhosted.org/packages/ef/0e/9799f08863aaab57b271d2f3d54613249fba5ee1092a6ff8afa7b6589685/prometheus-aioexporter-1.2.0.tar.gz" } ], "1.3.0": [ { "comment_text": "", "digests": { "md5": "9844f41be07e2522f4927a32db95d58f", "sha256": "04de0efc33cbcb093589c2d2f59f127d868d881996c92f3779a2d3e9054ab555" }, "downloads": -1, "filename": "prometheus_aioexporter-1.3.0-py3-none-any.whl", "has_sig": false, "md5_digest": "9844f41be07e2522f4927a32db95d58f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 13638, "upload_time": "2018-01-20T19:56:16", "url": "https://files.pythonhosted.org/packages/ba/50/50dd38b2c2593921916e30f69718fef6fe4e26ee6ec96ba15027eabc76b0/prometheus_aioexporter-1.3.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a84636745405961c1f01b9e107eddf91", "sha256": "836a699bbb941e341be28fe8bf81e1e892a56a706bbaffaf3d4b9ecd6647988d" }, "downloads": -1, "filename": "prometheus-aioexporter-1.3.0.tar.gz", "has_sig": false, "md5_digest": "a84636745405961c1f01b9e107eddf91", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11175, "upload_time": "2018-01-20T19:56:18", "url": "https://files.pythonhosted.org/packages/7f/7e/76d394f503e62a39242ebc4be2c6d8778e9c6bca6553332c1718b18b21ab/prometheus-aioexporter-1.3.0.tar.gz" } ], "1.4.0": [ { "comment_text": "", "digests": { "md5": "a005e9ed31e062c402ffd24c632bde0f", "sha256": "6ed9c45ab3946864fe675af3aabdc6ca149357c5045c534ed5cf3233a08b86d3" }, "downloads": -1, "filename": "prometheus_aioexporter-1.4.0-py3-none-any.whl", "has_sig": false, "md5_digest": "a005e9ed31e062c402ffd24c632bde0f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 13944, "upload_time": "2018-02-19T23:27:13", "url": "https://files.pythonhosted.org/packages/4f/7a/d8ce3710efb202fb363e377c03a5112e9c75d79a23f2d709c13a50b9d0c5/prometheus_aioexporter-1.4.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1519d0e466e066b7668ae7bae6678338", "sha256": "9dce4bc9b937cfb661cfa59e96f6d07c95d5968f3ba2b79adcec1c6fdbd55aee" }, "downloads": -1, "filename": "prometheus-aioexporter-1.4.0.tar.gz", "has_sig": false, "md5_digest": "1519d0e466e066b7668ae7bae6678338", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11352, "upload_time": "2018-02-19T23:27:15", "url": "https://files.pythonhosted.org/packages/97/c6/8930036cb80f14bc4a63e52aa9c19d814e21a86976529cc5d64886963221/prometheus-aioexporter-1.4.0.tar.gz" } ], "1.5.0": [ { "comment_text": "", "digests": { "md5": "09ed23af2c13760e9f1211fe91077eac", "sha256": "4b12aeab9542e3db997eff76a951d5a264545b7211811377b18fe45fff0e6585" }, "downloads": -1, "filename": "prometheus-aioexporter-1.5.0.tar.gz", "has_sig": false, "md5_digest": "09ed23af2c13760e9f1211fe91077eac", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12304, "upload_time": "2018-12-17T23:01:42", "url": "https://files.pythonhosted.org/packages/bb/f8/e40939fb3e3b84e13ad2d974e38505ae044c68ca996aa8072f72e05874fa/prometheus-aioexporter-1.5.0.tar.gz" } ], "1.5.1": [ { "comment_text": "", "digests": { "md5": "916ea8538b27eca07abeec057978556f", "sha256": "902a52eea83ee0980d6afd90461700a2f3f78d38e14fb5ce9162fbacd8af385a" }, "downloads": -1, "filename": "prometheus_aioexporter-1.5.1-py3-none-any.whl", "has_sig": false, "md5_digest": "916ea8538b27eca07abeec057978556f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 14827, "upload_time": "2018-12-28T13:52:29", "url": "https://files.pythonhosted.org/packages/7f/53/4e7b57dc128bdf735de777c5e1faefed26962b16c506f5f522fb2039ea6b/prometheus_aioexporter-1.5.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3ab6abd99cd1659de1fed94e9e268d11", "sha256": "8f7b7dbcdcea026820f0b82ec92be8d28374c8a899193d0487ab848a5754f5b9" }, "downloads": -1, "filename": "prometheus-aioexporter-1.5.1.tar.gz", "has_sig": false, "md5_digest": "3ab6abd99cd1659de1fed94e9e268d11", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12902, "upload_time": "2018-12-28T13:52:30", "url": "https://files.pythonhosted.org/packages/ec/70/e3f94087b53c46a7d06bbdb2d83eafb741ac46fea767abc12591e7fbf586/prometheus-aioexporter-1.5.1.tar.gz" } ], "1.6.0": [ { "comment_text": "", "digests": { "md5": "a65648c8cecfd57fddaab0eff1cfda39", "sha256": "05b53b30fee6ac15f735a8b6d927d0e4a4d19b0f784994c1d1523cc74729a9e2" }, "downloads": -1, "filename": "prometheus-aioexporter-1.6.0.tar.gz", "has_sig": false, "md5_digest": "a65648c8cecfd57fddaab0eff1cfda39", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13014, "upload_time": "2019-03-26T13:32:45", "url": "https://files.pythonhosted.org/packages/af/d3/5a888bce07ffec485c1d0e49a004dd77ab35292b560d13117d029670a839/prometheus-aioexporter-1.6.0.tar.gz" } ], "1.6.1": [ { "comment_text": "", "digests": { "md5": "f6b216fd19dd294247311f1bec6c16ed", "sha256": "4bbc047309fc5ca98b7325025f9ed431ec3a2ba89aac00feebe80764fc7ece42" }, "downloads": -1, "filename": "prometheus-aioexporter-1.6.1.tar.gz", "has_sig": false, "md5_digest": "f6b216fd19dd294247311f1bec6c16ed", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14477, "upload_time": "2019-09-17T21:45:22", "url": "https://files.pythonhosted.org/packages/13/e0/baea26ce206171b1093ca14bc116222aa5f9ee6d5be00822db37474a042d/prometheus-aioexporter-1.6.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f6b216fd19dd294247311f1bec6c16ed", "sha256": "4bbc047309fc5ca98b7325025f9ed431ec3a2ba89aac00feebe80764fc7ece42" }, "downloads": -1, "filename": "prometheus-aioexporter-1.6.1.tar.gz", "has_sig": false, "md5_digest": "f6b216fd19dd294247311f1bec6c16ed", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14477, "upload_time": "2019-09-17T21:45:22", "url": "https://files.pythonhosted.org/packages/13/e0/baea26ce206171b1093ca14bc116222aa5f9ee6d5be00822db37474a042d/prometheus-aioexporter-1.6.1.tar.gz" } ] }