API Documentation | Caql

The CAQL API endpoint provides a way to extract data from Circonus using a CAQL query. Please note that this is a BETA API endpoint, and is subject to change without notice.

Example

Fetching Data

To extract data, perform an HTTP GET request to /caql including the following query parameters:

query (required)
A well-formed CAQL query
start
The start time, in epoch seconds, of the duration you wish to query data from
(default: 60 seconds before end)
end
The end time, in epoch seconds, of the duration you wish to query data from
(default: 5 minutes before the current time rounded to the nearest minute)
period
The resolution of data, in seconds, you want to get back
(default: 60)
GET /caql?query=metric:average("73c91407-6218-4523-ad56-1edc8aeb325c","duration")&start=1469732700&end=1469732880&period=60
{"_query":"metric:average(\"73c91407-6218-4523-ad56-1edc8aeb325c\",\"duration\")","_data":[[1469732700,[756]],[1469732760,[780]],[1469732820,[710]]],"_start":1469732700,"_end":1469732880,"_period":60}

In addition to specifying metrics by Check UUID and Metric Name, you can use the CAQL Search Package to find matching metrics. In the following example, we search for data from all Checks having a "duration" metric:

GET /caql?query=search:metric("duration")&start=1469732700&end=1469732880&period=60
{"_start":1469732700,"_data":[[1469732700,[756,764,17,20.5]],[1469732760,[780,770,16,null]],[1469732820,[710,720,17,20]]],"_query":"search:metric(\"duration\")","_period":60,"_end":1469732880}

See the CAQL Reference Manual for a full description of the CAQL syntax and packages available.