Skip to main content

KairosDB REST API python client and interface

Project description

PythonPIP PythonSupport License RTFD

kairosdb - Python library to interface the KairosDB REST API (kairosdb.github.io)

This package provides a simple python library to interface the KairosDB REST API. Please read also: https://kairosdb.github.io/docs/build/html/restapi/index.html.

Installation

Install python-kairosdb module from https://pypi.python.org:

pip install python-kairosdb

Install python-kairosdb module from sources:

python setup.py install

Debian binary packages are also available. See the packaging directory for more information.

Documentation

Documentation is available online: http://python-kairosdb.readthedocs.io/en/latest/index.html

Examples

import kairosdb

if __name__ == "__main__":
    KDB_CLIENT = kairosdb.client.KairosDBAPIClient(
        api_endpoint="https://kdb.domain.tld:4443/api/v1")
    KDB_API = kairosdb.KairosDBAPI(KDB_CLIENT)

    print(KDB_API.version)
    print(KDB_API.health_status)
    print(KDB_API.health_check)
    print(KDB_API.metricnames)
    print(KDB_API.tagnames)

    print(KDB_API.query_metrics({
        "metrics": [{
            "name": "my_metric",
            "group_by": [{"name": "tag", "tags": ['host']}],
            "aggregators": [{
                "name": "avg",
                "align_sampling": True,
                "sampling": {"value": 30, "unit": "seconds"}
            }]
        }],
        "cache_time": 0,
        "start_relative": {"value": "2", "unit": "hours"}
    })

License

MIT LICENSE (see LICENSE file)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

python-kairosdb-0.2.1.tar.gz (5.6 kB view details)

Uploaded Source

File details

Details for the file python-kairosdb-0.2.1.tar.gz.

File metadata

File hashes

Hashes for python-kairosdb-0.2.1.tar.gz
Algorithm Hash digest
SHA256 54733982d5b9f3d13ff4ba7fb6059fc665741c7ed534ebda2a9baa9f26245221
MD5 8e10e525aba14ab32822344d8457785b
BLAKE2b-256 9a5892843c1f2d2a7136acb2493d9ec0e5d56d1409ec8e1b678a6b1be299aa08

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page