{ "info": { "author": "Ale\u0161 Kom\u00e1rek", "author_email": "ales.komarek@newt.cz", "bugtrack_url": null, "classifiers": [], "description": "================\npython-libmetric\n================\n\nPython library for querying metrics from several time-series databases into\nPandas DataFrames.\n\nIt support two types of metric queries, the first is ``instant`` metric,\nreturning the value in precise moment in time. The second is the ``range``\nmetric, giving you the series of values for given time range and step.\n\n\nInstallation\n============\n\nInstall the required dependencies on Debian based systems.\n\n.. code-block:: bash\n\n apt-get -y install librrd-dev libpython-dev\n\nInstall library from ``pip`` package.\n\n.. code-block:: bash\n\n pip install libmetric\n\nInstall library from source.\n\n.. code-block:: bash\n\n git clone https://github.com/cznewt/python-libmetric.git\n cd python-libmetric\n python setup.py install\n\n\nInput Parameters\n================\n\nParameters can be either set by environmental parameters or passed as command\narguments.\n\nFor example passing the parameters as environmental parameters.\n\n.. code-block:: bash\n\n export LIBMETRIC_ENGINE='prometheus'\n export LIBMETRIC_URL='https://metric01:9090'\n export LIBMETRIC_QUERY='alertmanager_notifications_total'\n\n export LIBMETRIC_START='2017-11-12T00:00:00Z'\n export LIBMETRIC_END='2017-11-16T00:00:00Z'\n export LIBMETRIC_STEP='3600s'\n\n range_metric\n\nAnd the example of passing parameters as command arguments.\n\n.. code-block:: bash\n\n range_metric --engine prometheus --url 'https://metric01:9090' --query '...'\n\n\nCommon Parameters\n-----------------\n\n**LIBMETRIC_ENGINE**\n Type of the endpoint to make query.\n\n**LIBMETRIC_URL**\n URL of the endpoint service.\n\n**LIBMETRIC_PARTITION**\n Data partition on target service endopoint.\n\n**LIBMETRIC_QUERY**\n Query to get the metric time-series or value.\n\n\nRange Parameters\n----------------\n\nParameters that apply only for the ``range`` meters.\n\n**LIBMETRIC_START**\n Time range start.\n\n**LIBMETRIC_END**\n Time range end.\n\n**LIBMETRIC_STEP**\n Query resolution step width.\n\n\nInstant Parameters\n------------------\n\nParameters that apply only for the ``intant`` meters.\n\n**LIBMETRIC_MOMENT**\n Single moment in time.\n\n\nAlarm Parameters\n----------------\n\nParameters that apply only for the all meters/alarms. Except the\n``LIBMETRIC_AGGREGATION`` is applicable only for ``range`` meters.\n\n**LIBMETRIC_ALARM_THRESHOLD**\n Threshold for the alarms.\n\n**LIBMETRIC_ALARM_OPERATOR**\n Arithmetic operator for alarm evaluation. [gt, lt, gte, lte, eq]\n\n**LIBMETRIC_AGGREGATION**\n Aggregation function for the given time-series [min, max, sum, avg]\n\n\nSupported Endpoints\n===================\n\nThe ``libmetric`` supports several major time-series databases to get the\nresults in normalised way. The endpoints are queried thru HTTP API calls.\n\n\nGraphite\n--------\n\nExample configuration to query the Graphite server.\n\n.. code-block:: bash\n\n export LIBMETRIC_ENGINE='graphite'\n export LIBMETRIC_URL='http://graphite.host:80'\n export LIBMETRIC_QUERY='averageSeries(server.web*.load)'\n ...\n\n\nInfluxDb\n--------\n\nExample configuration to query the InfluxDb server.\n\n.. code-block:: bash\n\n export LIBMETRIC_ENGINE='influxdb'\n export LIBMETRIC_URL='http://influxdb.host:8086'\n export LIBMETRIC_USER='user'\n export LIBMETRIC_PASSWORD='password'\n export LIBMETRIC_PARTITION='prometheus'\n export LIBMETRIC_QUERY='SELECT mean(\"value\") FROM \"alertmanager_notifications_total\"'\n ...\n\n\nPrometheus\n----------\n\nExample configuration to query the Prometheus server.\n\n.. code-block:: bash\n\n export LIBMETRIC_ENGINE='prometheus'\n export LIBMETRIC_URL='https://prometheus.host:9090'\n export LIBMETRIC_QUERY='alertmanager_notifications_total'\n ...\n\n\nRound-Robin Database\n--------------------\n\nExample configuration to query the RRD file. The query is the ``consolidation\nfunction`` and the partition is the ``data set``.\n\n.. code-block:: bash\n\n export LIBMETRIC_ENGINE='rrd'\n export LIBMETRIC_URL='file:///tmp/port.rrd'\n export LIBMETRIC_PARTITION='INOCTETS'\n export LIBMETRIC_QUERY='AVERAGE'\n ...\n\n\nAlarm Options\n=============\n\nFollowing lists show allowed values for alarm functions, the alarm arithmetic\noperators and aggregation function for ``range`` meters.\n\n\nSupported Alarm Operators\n-------------------------\n\n**gt**\n Greater than ``>``.\n\n**gte**\n Greater or equal than ``>=``.\n\n**lt**\n Lower than ``<``.\n\n**lte**\n Lower or equal than ``<=``.\n\n**eq**\n Equals to ``==``.\n\n\nSupported Time-series Aggregations\n----------------------------------\n\n**avg**\n Arithmetic average of the series values.\n\n**min**\n Use the minimal value from series.\n\n**max**\n Use the maximal value from series.\n\n**sum**\n Sum the values together.\n\n\nMore Information\n================\n\n* https://prometheus.io/docs/prometheus/latest/querying/api/\n* http://graphite.readthedocs.io/en/latest/render_api.html\n* https://docs.influxdata.com/influxdb/v1.3/guides/querying_data/\n* https://oss.oetiker.ch/rrdtool/doc/rrdtool.en.html", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/cznewt/python-libmetric", "keywords": "", "license": "Apache License, Version 2.0", "maintainer": "", "maintainer_email": "", "name": "libmetric", "package_url": "https://pypi.org/project/libmetric/", "platform": "", "project_url": "https://pypi.org/project/libmetric/", "project_urls": { "Homepage": "https://github.com/cznewt/python-libmetric" }, "release_url": "https://pypi.org/project/libmetric/0.6.0/", "requires_dist": null, "requires_python": "", "summary": "Python library for querying metrics into Pandas DataFrames", "version": "0.6.0" }, "last_serial": 3348791, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "1abacd34e4fd85cd842f0d55f28c7687", "sha256": "cb060c7df9a43add6be21a2ece59b4332b74f7f276e28175138e32215819b6d0" }, "downloads": -1, "filename": "libmetric-0.1.0.tar.gz", "has_sig": false, "md5_digest": "1abacd34e4fd85cd842f0d55f28c7687", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3286, "upload_time": "2017-11-16T12:40:03", "url": "https://files.pythonhosted.org/packages/c7/ad/8e9d515bfe1c2f3d3a514ee5d3d0bc708c76bdec29a3637973949c74472d/libmetric-0.1.0.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "b1dc8c04e3c0b6b7c08b6b1fd164cdc8", "sha256": "c4ca053c77df0f9e3ff6d86b90f37be06f899aa219781a62cb42bbcad8051cf1" }, "downloads": -1, "filename": "libmetric-0.3.0.linux-x86_64.tar.gz", "has_sig": false, "md5_digest": "b1dc8c04e3c0b6b7c08b6b1fd164cdc8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7633, "upload_time": "2017-11-16T14:33:30", "url": "https://files.pythonhosted.org/packages/59/f2/ad5b4355d9586c2b71a9e82cd5cae76329c70b37c114cd83a031e8d75af4/libmetric-0.3.0.linux-x86_64.tar.gz" } ], "0.5.0": [ { "comment_text": "", "digests": { "md5": "90c91330b3fdd8889c1a554384db19be", "sha256": "56e25bae4c39d163837911b863ee534f2faa63865c6f6d4772333cddfc020e83" }, "downloads": -1, "filename": "libmetric-0.5.0.linux-x86_64.tar.gz", "has_sig": false, "md5_digest": "90c91330b3fdd8889c1a554384db19be", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12394, "upload_time": "2017-11-19T08:39:18", "url": "https://files.pythonhosted.org/packages/5f/94/b22a663b1462b7ada07c754ccbd220429285eecec9823c8d55ef1348d8ce/libmetric-0.5.0.linux-x86_64.tar.gz" } ], "0.6.0": [ { "comment_text": "", "digests": { "md5": "683e6998a1b2b23bddafdcf056148c80", "sha256": "80682f28358b59e6fbe38e5557c203c5fa5c7feeef6f049e730588d376d46045" }, "downloads": -1, "filename": "libmetric-0.6.0.linux-x86_64.tar.gz", "has_sig": false, "md5_digest": "683e6998a1b2b23bddafdcf056148c80", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14777, "upload_time": "2017-11-20T12:51:29", "url": "https://files.pythonhosted.org/packages/7e/15/f7a6e8a719cd46a45c60a9b0bf2ac6c838edc3dad4950650790813023ca8/libmetric-0.6.0.linux-x86_64.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "683e6998a1b2b23bddafdcf056148c80", "sha256": "80682f28358b59e6fbe38e5557c203c5fa5c7feeef6f049e730588d376d46045" }, "downloads": -1, "filename": "libmetric-0.6.0.linux-x86_64.tar.gz", "has_sig": false, "md5_digest": "683e6998a1b2b23bddafdcf056148c80", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14777, "upload_time": "2017-11-20T12:51:29", "url": "https://files.pythonhosted.org/packages/7e/15/f7a6e8a719cd46a45c60a9b0bf2ac6c838edc3dad4950650790813023ca8/libmetric-0.6.0.linux-x86_64.tar.gz" } ] }