Skip to content
syamp edited this page Aug 16, 2017 · 3 revisions

API Version 2.0

Ingest

POST /v2.0/:tenantId/ingest

Single tenant data. The payload should be an array of metrics. Each metric object should contain the following fields:

  • collectionTime: long integer. milliseconds since epoch.
  • ttlInSeconds: long integer. number of seconds before full-resolution data expires from the database. This can be overridden by configuration, causing this value to be ignored.
  • metricValue: numeric. metric value.
  • metricName: string. unique name of metric. Treat this as a primary key.

Example:

[
    {
      "collectionTime": 1376509892612,
      "ttlInSeconds": 172800,
      "metricValue": 66,
      "metricName": "example.metric.one"
    },
    {
      "collectionTime": 1376509892612,
      "ttlInSeconds": 172800,
      "metricValue": 66,
      "metricName": "example.metric.two"
    },
    {
      "collectionTime": 1376509892612,
      "ttlInSeconds": 172800,
      "metricValue": 66,
      "metricName": "example.metric.three"
    }
 ]

POST /v2.0/:tenantId/ingest/multi

POST /v2.0/:tenantId/ingest/aggregated

Query

GET /v2.0/:tenantId/metrics/:metricName?from=:timestamp&to=:timestamp&points=:integer

Returns single tenant data in full-resolution or rolled up form.

The following query parameters are honored:

  • from: long integer. milliseconds since epoch of when to start querying for data.
  • `to': long integer. milliseconds since epoch (end-inclusive) of when to stop querying for data.
  • points: ([optional) long integer. number of desired points to return. This can impact the resolution of the data returned.
  • select: ([optional) string {average|max|min}. Select the rollup data type)
  • resolution: (optional) string { FULL | MIN5 | MIN60 | MIN240 | MIN1440 }. Forces query to be pegged to a specific resolution. Using this in your query causes the points value to be ignored.

Example rollup output:

{
  "values": [
    {
      "numPoints": 1,
      "timestamp": 1376509892612,
      "average": 66
    }
  ],
  "metadata": {
    "limit": null,
    "next_href": null,
    "count": 1,
    "marker": null
  }
}

Example full resolution output:

todo.

POST /v2.0/:tenantId/views

GET /v2.0/:tenantId/views/histograms/:metricName

Search

GET /v2.0/:tenantId/metrics/search?query=foo

Searches and returns metric information from an indexing service.

The following query parameters are honored:

  • query: string. glob-type query string. Examples: "foo", "fo", "fo*", etc.

If there is no index configured, this becomes a no-op.

Example output:

[  
   {  
      "metric":"example.metric.one",
      "unit":"milliseconds"
   },
   {  
      "metric":"example.metric.two",
      "unit":"milliseconds"
   },
   {  
      "metric":"example.metric.three",
      "unit":"bytes"
   }
]
Clone this wiki locally