This is an alpha release of FnordMetric. Expect bugs and vulnerabilities.

Edit this page on GitHub

FnordMetric Server HTTP API

GET /query

Execute a ChartSQL / SQL query and return the result.

Parameters:

q (mandatory) the ChartSQL / SQL query to execute
format the response format: svg or json (default: json)
width the width of the chart to be rendered in px (default: 800)
height the height of the chart to be rendered in px (default: 320)


POST /query

Execute a ChartSQL / SQL query and return the result. Send the ChartSQL query as the HTTP POST body and use the same GET query parameters as for the GET /query call

GET /metrics

Returns a list of all metrics.

Parameters:

format the response format: csv, or json (default)


Examples:

>> GET /metrics HTTP/1.1
<< HTTP/1.1 200 OK
<< ...
<< {
<<   "metrics": [
<<     {
<<       "key": "http_status_codes",
<<       "labels": ["statuscode", "hostname"],
<<       "last_insert": 1414241420602240,
<<       "total_stored_bytes": 24641536
<<     },
<<     {
<<       "key": "http_latency",
<<       "labels": ["url", "hostname"],
<<       "last_insert": 1414241420602240,
<<       "total_stored_bytes": 129499136
<<     },
<<   ]
<< }

POST /metrics

Insert a sample into a metric. If no metric with this key exists, a new one will be created.

Parameters:

metric (mandatory) the key of this metric (e.g. my-counter-sum-15 or /frontend/http_status_code)
value (mandatory) the value to add/sample to this metric


Examples:

>> POST /metrics/total_sales_in_euro-sum-30?value=351 HTTP/1.1
<< HTTP/1.1 201 CREATED

>> POST /metrics/http_status_codes?value=351&label[statuscode]=200&label[hostname]=myhost1 HTTP/1.1
<< HTTP/1.1 201 CREATED