Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Excerpt

Trend Detections are configured on projects to look for anomalies in time series data.

 For an introduction and tutorial on this feature, read the Trend Detection chapter.

Methods

Table of Contents
outlinetrue
excludeMethods

...

Parameters:
  • tenant – User tenant.
  • project_id – Project identifier.
JSON Data:

Data is passed in as a JSON object.

Valid object keys:

  • name (required) – Human-readable name of the trend detection entity.
  • query (required) – The query on which the trend is analyzed. The query may be an empty string, in which case all items in the project are analyzed.
  • email_user (required) – Email address to send an alert to when an anomaly is detected.
  • aggregation_interval (required) – Determines the time buckets into which the data is fitted.
    The format of the interval is "<number><unit>" - for example "1d" for a daily interval. The full list of allowed units is "m" - minute, "h" - hour , "d" - day, "w" - week.
    See the Aggregation Interval reference for full details on this parameter.
  • aggregation_field – Facet field on which to detect the trends. If this is not specified, the trend is computed on the number of results in a time frame.
  • aggregation_method – Aggregation method on how the numeric values are combined. Only used if aggregation_field is set too.
    Valid options: avg (default), sum, max, min.
    See the Aggregation Method reference for full details on this parameter.
  • aggregation_time_field – Datetime facet field on which axis to calculate the trend. This defaults to $item_created_at.
Headers:See Common Headers.
Status Codes:
  • 201 – Trend detection entity created.

See also Common Status Codes.

Returns:

Created trend detection in the "data" property.

Code Block
js
js
{
    "deprecated": false, 
    "data": {
        "aggregation_time_field": "$item_created_at", 
        "aggregation_field": "Price", 
        "name": "EU Egg Price Trend", 
        "created_at": "2016-06-15T11:15:46", 
        "modified_at": "2016-06-15T11:15:46", 
        "aggregation_interval": "1d", 
        "aggregation_method": "avg", 
        "query": "Type:\"Egg Price\" \"Country\":EU", 
        "project_id": "V73xio3rR6-8lPwBOG_EVA", 
        "id": "hI9E58PvT_mTPtpC6_rQkQ"
    }, 
    "id": "2e4fe4f6-2b7e-4815-946e-2b904cd3c66d", 
    "apiVersion": "v0"
}

...