Skip to content

KairosDB

Bases: Spout

__init__(output, state, **kwargs)

Initialize the KairosDB class.

Parameters:

Name Type Description Default
output BatchOutput

An instance of the BatchOutput class for saving the data.

required
state State

An instance of the State class for maintaining the state.

required
**kwargs

Additional keyword arguments.

{}

Using geniusrise to invoke via command line

genius KairosDB rise \
    batch \
        --output_s3_bucket my_bucket \
        --output_s3_folder s3/folder \
    none \
    fetch \
        --args url=http://mykairosdbhost:8080/api/v1/datapoints query="SELECT * FROM mymetric"

Using geniusrise to invoke via YAML file

version: "1"
spouts:
    my_kairosdb_spout:
        name: "KairosDB"
        method: "fetch"
        args:
            url: "http://mykairosdbhost:8080/api/v1/datapoints"
            query: "SELECT * FROM mymetric"
        output:
            type: "batch"
            args:
                bucket: "my_bucket"
                s3_folder: "s3/folder"

fetch(url, query)

📖 Fetch data from a KairosDB metric and save it in batch.

Parameters:

Name Type Description Default
url str

The URL of the KairosDB API endpoint.

required
query str

The SQL query to execute.

required

Raises:

Type Description
Exception

If unable to connect to the KairosDB server or execute the query.