Skip to main content
POST
/
timeseries
/
search
Run an ad-hoc metric query
curl --request POST \
  --url https://api.eu.bronto.io/timeseries/search \
  --header 'Content-Type: application/json' \
  --header 'X-BRONTO-API-KEY: <api-key>' \
  --data @- <<EOF
{
  "time_range": {
    "from_ts": 1709251200000,
    "to_ts": 1711390455601,
    "natural": "Last 10 minutes"
  },
  "queries": [
    {
      "name": "<string>",
      "select": [
        "response_time_ms"
      ],
      "from": [
        "550e8400-e29b-41d4-a716-446655440000",
        "297bb888-83b1-44e0-8ab6-47879f1275a2"
      ],
      "where": "ip='10.0.0.1'",
      "from_expr": "[log_type = 'java gc' and team = 'A', environment= 'production' AND region = 'eu-west-1', metric_name = 'system.cpu.utilization']",
      "groups": [
        "[user, ip]"
      ],
      "aggregation": [
        {
          "time": "sum",
          "reduce_to": "avg"
        }
      ]
    }
  ],
  "limit": 50,
  "num_of_slices": 100,
  "formulas": [
    {
      "name": "error_rate",
      "expression": "errors / total_requests * 100",
      "aggregation": {
        "reduce_to": "avg"
      }
    }
  ]
}
EOF
{}

Authorizations

X-BRONTO-API-KEY
string
header
required

Body

application/json
time_range
object
required
queries
object[]
required

the list of simple queries computed to generate the timeseries

Required array length: 1 - 6 elements
limit
integer
default:100

In a query with a group by, it limits the number of groups returned. It does not affect a query using aggregate functions.

Required range: 1 <= x <= 10000
Example:

50

num_of_slices
object

The number of buckets to break the time series results into.

Example:

100

delta
object
formulas
object[]

a list of formulas that combine the queries results

Maximum array length: 5

Response

Metric search results

Map of the query/formula name and the related timeseries

{key}
object

contains the timeseries for a query or a formula