Run an ad-hoc timeseries 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"
}
],
"unit_config": {
"type": "data_size"
}
}
],
"limit": 50,
"num_of_slices": 100,
"formulas": [
{
"name": "error_rate",
"expression": "errors / total_requests * 100",
"aggregation": {
"reduce_to": "avg"
}
}
]
}
EOFimport requests
url = "https://api.eu.bronto.io/timeseries/search"
payload = {
"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"
}
],
"unit_config": { "type": "data_size" }
}
],
"limit": 50,
"num_of_slices": 100,
"formulas": [
{
"name": "error_rate",
"expression": "errors / total_requests * 100",
"aggregation": { "reduce_to": "avg" }
}
]
}
headers = {
"X-BRONTO-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-BRONTO-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
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'}],
unit_config: {type: 'data_size'}
}
],
limit: 50,
num_of_slices: 100,
formulas: [
{
name: 'error_rate',
expression: 'errors / total_requests * 100',
aggregation: {reduce_to: 'avg'}
}
]
})
};
fetch('https://api.eu.bronto.io/timeseries/search', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.eu.bronto.io/timeseries/search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'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'
]
],
'unit_config' => [
'type' => 'data_size'
]
]
],
'limit' => 50,
'num_of_slices' => 100,
'formulas' => [
[
'name' => 'error_rate',
'expression' => 'errors / total_requests * 100',
'aggregation' => [
'reduce_to' => 'avg'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-BRONTO-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.eu.bronto.io/timeseries/search"
payload := strings.NewReader("{\n \"time_range\": {\n \"from_ts\": 1709251200000,\n \"to_ts\": 1711390455601,\n \"natural\": \"Last 10 minutes\"\n },\n \"queries\": [\n {\n \"name\": \"<string>\",\n \"select\": [\n \"response_time_ms\"\n ],\n \"from\": [\n \"550e8400-e29b-41d4-a716-446655440000\",\n \"297bb888-83b1-44e0-8ab6-47879f1275a2\"\n ],\n \"where\": \"ip='10.0.0.1'\",\n \"from_expr\": \"[log_type = 'java gc' and team = 'A', environment= 'production' AND region = 'eu-west-1', metric_name = 'system.cpu.utilization']\",\n \"groups\": [\n \"[user, ip]\"\n ],\n \"aggregation\": [\n {\n \"time\": \"sum\",\n \"reduce_to\": \"avg\"\n }\n ],\n \"unit_config\": {\n \"type\": \"data_size\"\n }\n }\n ],\n \"limit\": 50,\n \"num_of_slices\": 100,\n \"formulas\": [\n {\n \"name\": \"error_rate\",\n \"expression\": \"errors / total_requests * 100\",\n \"aggregation\": {\n \"reduce_to\": \"avg\"\n }\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-BRONTO-API-KEY", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.eu.bronto.io/timeseries/search")
.header("X-BRONTO-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"time_range\": {\n \"from_ts\": 1709251200000,\n \"to_ts\": 1711390455601,\n \"natural\": \"Last 10 minutes\"\n },\n \"queries\": [\n {\n \"name\": \"<string>\",\n \"select\": [\n \"response_time_ms\"\n ],\n \"from\": [\n \"550e8400-e29b-41d4-a716-446655440000\",\n \"297bb888-83b1-44e0-8ab6-47879f1275a2\"\n ],\n \"where\": \"ip='10.0.0.1'\",\n \"from_expr\": \"[log_type = 'java gc' and team = 'A', environment= 'production' AND region = 'eu-west-1', metric_name = 'system.cpu.utilization']\",\n \"groups\": [\n \"[user, ip]\"\n ],\n \"aggregation\": [\n {\n \"time\": \"sum\",\n \"reduce_to\": \"avg\"\n }\n ],\n \"unit_config\": {\n \"type\": \"data_size\"\n }\n }\n ],\n \"limit\": 50,\n \"num_of_slices\": 100,\n \"formulas\": [\n {\n \"name\": \"error_rate\",\n \"expression\": \"errors / total_requests * 100\",\n \"aggregation\": {\n \"reduce_to\": \"avg\"\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eu.bronto.io/timeseries/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-BRONTO-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"time_range\": {\n \"from_ts\": 1709251200000,\n \"to_ts\": 1711390455601,\n \"natural\": \"Last 10 minutes\"\n },\n \"queries\": [\n {\n \"name\": \"<string>\",\n \"select\": [\n \"response_time_ms\"\n ],\n \"from\": [\n \"550e8400-e29b-41d4-a716-446655440000\",\n \"297bb888-83b1-44e0-8ab6-47879f1275a2\"\n ],\n \"where\": \"ip='10.0.0.1'\",\n \"from_expr\": \"[log_type = 'java gc' and team = 'A', environment= 'production' AND region = 'eu-west-1', metric_name = 'system.cpu.utilization']\",\n \"groups\": [\n \"[user, ip]\"\n ],\n \"aggregation\": [\n {\n \"time\": \"sum\",\n \"reduce_to\": \"avg\"\n }\n ],\n \"unit_config\": {\n \"type\": \"data_size\"\n }\n }\n ],\n \"limit\": 50,\n \"num_of_slices\": 100,\n \"formulas\": [\n {\n \"name\": \"error_rate\",\n \"expression\": \"errors / total_requests * 100\",\n \"aggregation\": {\n \"reduce_to\": \"avg\"\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{}{
"bad_request_validation": {
"summary": "Bad Request - Validation Error",
"description": "Example error when request validation fails",
"value": {
"code": 400,
"type": "Bad Request",
"correlation_id": "95c6a974e3ab01209b6b0dfedb1b16c5",
"details": "Validation failed: 'name' field is required and cannot be empty"
}
},
"bad_request_invalid_type": {
"summary": "Bad Request - Invalid Metric Type",
"description": "Example error when an invalid metric type is provided",
"value": {
"code": 400,
"type": "Bad Request",
"correlation_id": "00d8a51bb2874f2583670317a4fb8db7",
"details": "Invalid metric_type 'INVALID'. Must be one of: COUNTER, GAUGE, HISTOGRAM"
}
},
"forbidden": {
"summary": "Forbidden Access",
"description": "Example error when user lacks required permissions",
"value": {
"code": 403,
"type": "Forbidden",
"correlation_id": "40276639de0f49d586e32edd8c4f6b34",
"details": "Access denied. User does not have permission to create metric definition templates"
}
},
"not_found": {
"summary": "Resource Not Found",
"description": "Example error when requested resource doesn't exist",
"value": {
"code": 404,
"type": "Not Found",
"correlation_id": "605f832bcfe44a1081441691c8d42253",
"details": "Metric definition template with id '550e8400-e29b-41d4-a716-446655440000' not found"
}
},
"rate_limit": {
"summary": "Rate Limit Exceeded",
"description": "Example error when API rate limit is exceeded",
"value": {
"code": 429,
"type": "Too Many Requests",
"correlation_id": "53909ed43c544531b7a555e295960437",
"details": "Rate limit exceeded. Maximum 100 requests are allowed within a 5-minute window"
}
},
"internal_server_error": {
"summary": "Internal Server Error",
"description": "Example error for unexpected server-side failures",
"value": {
"code": 500,
"type": "Internal Server Error",
"correlation_id": "b129b8e0e66c41aa9541a30f67e38ce2",
"details": "An unexpected error occurred while processing your request"
}
}
}{
"bad_request_validation": {
"summary": "Bad Request - Validation Error",
"description": "Example error when request validation fails",
"value": {
"code": 400,
"type": "Bad Request",
"correlation_id": "95c6a974e3ab01209b6b0dfedb1b16c5",
"details": "Validation failed: 'name' field is required and cannot be empty"
}
},
"bad_request_invalid_type": {
"summary": "Bad Request - Invalid Metric Type",
"description": "Example error when an invalid metric type is provided",
"value": {
"code": 400,
"type": "Bad Request",
"correlation_id": "00d8a51bb2874f2583670317a4fb8db7",
"details": "Invalid metric_type 'INVALID'. Must be one of: COUNTER, GAUGE, HISTOGRAM"
}
},
"forbidden": {
"summary": "Forbidden Access",
"description": "Example error when user lacks required permissions",
"value": {
"code": 403,
"type": "Forbidden",
"correlation_id": "40276639de0f49d586e32edd8c4f6b34",
"details": "Access denied. User does not have permission to create metric definition templates"
}
},
"not_found": {
"summary": "Resource Not Found",
"description": "Example error when requested resource doesn't exist",
"value": {
"code": 404,
"type": "Not Found",
"correlation_id": "605f832bcfe44a1081441691c8d42253",
"details": "Metric definition template with id '550e8400-e29b-41d4-a716-446655440000' not found"
}
},
"rate_limit": {
"summary": "Rate Limit Exceeded",
"description": "Example error when API rate limit is exceeded",
"value": {
"code": 429,
"type": "Too Many Requests",
"correlation_id": "53909ed43c544531b7a555e295960437",
"details": "Rate limit exceeded. Maximum 100 requests are allowed within a 5-minute window"
}
},
"internal_server_error": {
"summary": "Internal Server Error",
"description": "Example error for unexpected server-side failures",
"value": {
"code": 500,
"type": "Internal Server Error",
"correlation_id": "b129b8e0e66c41aa9541a30f67e38ce2",
"details": "An unexpected error occurred while processing your request"
}
}
}{
"bad_request_validation": {
"summary": "Bad Request - Validation Error",
"description": "Example error when request validation fails",
"value": {
"code": 400,
"type": "Bad Request",
"correlation_id": "95c6a974e3ab01209b6b0dfedb1b16c5",
"details": "Validation failed: 'name' field is required and cannot be empty"
}
},
"bad_request_invalid_type": {
"summary": "Bad Request - Invalid Metric Type",
"description": "Example error when an invalid metric type is provided",
"value": {
"code": 400,
"type": "Bad Request",
"correlation_id": "00d8a51bb2874f2583670317a4fb8db7",
"details": "Invalid metric_type 'INVALID'. Must be one of: COUNTER, GAUGE, HISTOGRAM"
}
},
"forbidden": {
"summary": "Forbidden Access",
"description": "Example error when user lacks required permissions",
"value": {
"code": 403,
"type": "Forbidden",
"correlation_id": "40276639de0f49d586e32edd8c4f6b34",
"details": "Access denied. User does not have permission to create metric definition templates"
}
},
"not_found": {
"summary": "Resource Not Found",
"description": "Example error when requested resource doesn't exist",
"value": {
"code": 404,
"type": "Not Found",
"correlation_id": "605f832bcfe44a1081441691c8d42253",
"details": "Metric definition template with id '550e8400-e29b-41d4-a716-446655440000' not found"
}
},
"rate_limit": {
"summary": "Rate Limit Exceeded",
"description": "Example error when API rate limit is exceeded",
"value": {
"code": 429,
"type": "Too Many Requests",
"correlation_id": "53909ed43c544531b7a555e295960437",
"details": "Rate limit exceeded. Maximum 100 requests are allowed within a 5-minute window"
}
},
"internal_server_error": {
"summary": "Internal Server Error",
"description": "Example error for unexpected server-side failures",
"value": {
"code": 500,
"type": "Internal Server Error",
"correlation_id": "b129b8e0e66c41aa9541a30f67e38ce2",
"details": "An unexpected error occurred while processing your request"
}
}
}{
"bad_request_validation": {
"summary": "Bad Request - Validation Error",
"description": "Example error when request validation fails",
"value": {
"code": 400,
"type": "Bad Request",
"correlation_id": "95c6a974e3ab01209b6b0dfedb1b16c5",
"details": "Validation failed: 'name' field is required and cannot be empty"
}
},
"bad_request_invalid_type": {
"summary": "Bad Request - Invalid Metric Type",
"description": "Example error when an invalid metric type is provided",
"value": {
"code": 400,
"type": "Bad Request",
"correlation_id": "00d8a51bb2874f2583670317a4fb8db7",
"details": "Invalid metric_type 'INVALID'. Must be one of: COUNTER, GAUGE, HISTOGRAM"
}
},
"forbidden": {
"summary": "Forbidden Access",
"description": "Example error when user lacks required permissions",
"value": {
"code": 403,
"type": "Forbidden",
"correlation_id": "40276639de0f49d586e32edd8c4f6b34",
"details": "Access denied. User does not have permission to create metric definition templates"
}
},
"not_found": {
"summary": "Resource Not Found",
"description": "Example error when requested resource doesn't exist",
"value": {
"code": 404,
"type": "Not Found",
"correlation_id": "605f832bcfe44a1081441691c8d42253",
"details": "Metric definition template with id '550e8400-e29b-41d4-a716-446655440000' not found"
}
},
"rate_limit": {
"summary": "Rate Limit Exceeded",
"description": "Example error when API rate limit is exceeded",
"value": {
"code": 429,
"type": "Too Many Requests",
"correlation_id": "53909ed43c544531b7a555e295960437",
"details": "Rate limit exceeded. Maximum 100 requests are allowed within a 5-minute window"
}
},
"internal_server_error": {
"summary": "Internal Server Error",
"description": "Example error for unexpected server-side failures",
"value": {
"code": 500,
"type": "Internal Server Error",
"correlation_id": "b129b8e0e66c41aa9541a30f67e38ce2",
"details": "An unexpected error occurred while processing your request"
}
}
}timeseries
Run an ad-hoc timeseries query
Execute a one-off timeseries query or formula directly. This is not saved. Use for interactive mode or metrics explorer.
POST
/
timeseries
/
search
Run an ad-hoc timeseries 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"
}
],
"unit_config": {
"type": "data_size"
}
}
],
"limit": 50,
"num_of_slices": 100,
"formulas": [
{
"name": "error_rate",
"expression": "errors / total_requests * 100",
"aggregation": {
"reduce_to": "avg"
}
}
]
}
EOFimport requests
url = "https://api.eu.bronto.io/timeseries/search"
payload = {
"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"
}
],
"unit_config": { "type": "data_size" }
}
],
"limit": 50,
"num_of_slices": 100,
"formulas": [
{
"name": "error_rate",
"expression": "errors / total_requests * 100",
"aggregation": { "reduce_to": "avg" }
}
]
}
headers = {
"X-BRONTO-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-BRONTO-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
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'}],
unit_config: {type: 'data_size'}
}
],
limit: 50,
num_of_slices: 100,
formulas: [
{
name: 'error_rate',
expression: 'errors / total_requests * 100',
aggregation: {reduce_to: 'avg'}
}
]
})
};
fetch('https://api.eu.bronto.io/timeseries/search', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.eu.bronto.io/timeseries/search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'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'
]
],
'unit_config' => [
'type' => 'data_size'
]
]
],
'limit' => 50,
'num_of_slices' => 100,
'formulas' => [
[
'name' => 'error_rate',
'expression' => 'errors / total_requests * 100',
'aggregation' => [
'reduce_to' => 'avg'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-BRONTO-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.eu.bronto.io/timeseries/search"
payload := strings.NewReader("{\n \"time_range\": {\n \"from_ts\": 1709251200000,\n \"to_ts\": 1711390455601,\n \"natural\": \"Last 10 minutes\"\n },\n \"queries\": [\n {\n \"name\": \"<string>\",\n \"select\": [\n \"response_time_ms\"\n ],\n \"from\": [\n \"550e8400-e29b-41d4-a716-446655440000\",\n \"297bb888-83b1-44e0-8ab6-47879f1275a2\"\n ],\n \"where\": \"ip='10.0.0.1'\",\n \"from_expr\": \"[log_type = 'java gc' and team = 'A', environment= 'production' AND region = 'eu-west-1', metric_name = 'system.cpu.utilization']\",\n \"groups\": [\n \"[user, ip]\"\n ],\n \"aggregation\": [\n {\n \"time\": \"sum\",\n \"reduce_to\": \"avg\"\n }\n ],\n \"unit_config\": {\n \"type\": \"data_size\"\n }\n }\n ],\n \"limit\": 50,\n \"num_of_slices\": 100,\n \"formulas\": [\n {\n \"name\": \"error_rate\",\n \"expression\": \"errors / total_requests * 100\",\n \"aggregation\": {\n \"reduce_to\": \"avg\"\n }\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-BRONTO-API-KEY", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.eu.bronto.io/timeseries/search")
.header("X-BRONTO-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"time_range\": {\n \"from_ts\": 1709251200000,\n \"to_ts\": 1711390455601,\n \"natural\": \"Last 10 minutes\"\n },\n \"queries\": [\n {\n \"name\": \"<string>\",\n \"select\": [\n \"response_time_ms\"\n ],\n \"from\": [\n \"550e8400-e29b-41d4-a716-446655440000\",\n \"297bb888-83b1-44e0-8ab6-47879f1275a2\"\n ],\n \"where\": \"ip='10.0.0.1'\",\n \"from_expr\": \"[log_type = 'java gc' and team = 'A', environment= 'production' AND region = 'eu-west-1', metric_name = 'system.cpu.utilization']\",\n \"groups\": [\n \"[user, ip]\"\n ],\n \"aggregation\": [\n {\n \"time\": \"sum\",\n \"reduce_to\": \"avg\"\n }\n ],\n \"unit_config\": {\n \"type\": \"data_size\"\n }\n }\n ],\n \"limit\": 50,\n \"num_of_slices\": 100,\n \"formulas\": [\n {\n \"name\": \"error_rate\",\n \"expression\": \"errors / total_requests * 100\",\n \"aggregation\": {\n \"reduce_to\": \"avg\"\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eu.bronto.io/timeseries/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-BRONTO-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"time_range\": {\n \"from_ts\": 1709251200000,\n \"to_ts\": 1711390455601,\n \"natural\": \"Last 10 minutes\"\n },\n \"queries\": [\n {\n \"name\": \"<string>\",\n \"select\": [\n \"response_time_ms\"\n ],\n \"from\": [\n \"550e8400-e29b-41d4-a716-446655440000\",\n \"297bb888-83b1-44e0-8ab6-47879f1275a2\"\n ],\n \"where\": \"ip='10.0.0.1'\",\n \"from_expr\": \"[log_type = 'java gc' and team = 'A', environment= 'production' AND region = 'eu-west-1', metric_name = 'system.cpu.utilization']\",\n \"groups\": [\n \"[user, ip]\"\n ],\n \"aggregation\": [\n {\n \"time\": \"sum\",\n \"reduce_to\": \"avg\"\n }\n ],\n \"unit_config\": {\n \"type\": \"data_size\"\n }\n }\n ],\n \"limit\": 50,\n \"num_of_slices\": 100,\n \"formulas\": [\n {\n \"name\": \"error_rate\",\n \"expression\": \"errors / total_requests * 100\",\n \"aggregation\": {\n \"reduce_to\": \"avg\"\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{}{
"bad_request_validation": {
"summary": "Bad Request - Validation Error",
"description": "Example error when request validation fails",
"value": {
"code": 400,
"type": "Bad Request",
"correlation_id": "95c6a974e3ab01209b6b0dfedb1b16c5",
"details": "Validation failed: 'name' field is required and cannot be empty"
}
},
"bad_request_invalid_type": {
"summary": "Bad Request - Invalid Metric Type",
"description": "Example error when an invalid metric type is provided",
"value": {
"code": 400,
"type": "Bad Request",
"correlation_id": "00d8a51bb2874f2583670317a4fb8db7",
"details": "Invalid metric_type 'INVALID'. Must be one of: COUNTER, GAUGE, HISTOGRAM"
}
},
"forbidden": {
"summary": "Forbidden Access",
"description": "Example error when user lacks required permissions",
"value": {
"code": 403,
"type": "Forbidden",
"correlation_id": "40276639de0f49d586e32edd8c4f6b34",
"details": "Access denied. User does not have permission to create metric definition templates"
}
},
"not_found": {
"summary": "Resource Not Found",
"description": "Example error when requested resource doesn't exist",
"value": {
"code": 404,
"type": "Not Found",
"correlation_id": "605f832bcfe44a1081441691c8d42253",
"details": "Metric definition template with id '550e8400-e29b-41d4-a716-446655440000' not found"
}
},
"rate_limit": {
"summary": "Rate Limit Exceeded",
"description": "Example error when API rate limit is exceeded",
"value": {
"code": 429,
"type": "Too Many Requests",
"correlation_id": "53909ed43c544531b7a555e295960437",
"details": "Rate limit exceeded. Maximum 100 requests are allowed within a 5-minute window"
}
},
"internal_server_error": {
"summary": "Internal Server Error",
"description": "Example error for unexpected server-side failures",
"value": {
"code": 500,
"type": "Internal Server Error",
"correlation_id": "b129b8e0e66c41aa9541a30f67e38ce2",
"details": "An unexpected error occurred while processing your request"
}
}
}{
"bad_request_validation": {
"summary": "Bad Request - Validation Error",
"description": "Example error when request validation fails",
"value": {
"code": 400,
"type": "Bad Request",
"correlation_id": "95c6a974e3ab01209b6b0dfedb1b16c5",
"details": "Validation failed: 'name' field is required and cannot be empty"
}
},
"bad_request_invalid_type": {
"summary": "Bad Request - Invalid Metric Type",
"description": "Example error when an invalid metric type is provided",
"value": {
"code": 400,
"type": "Bad Request",
"correlation_id": "00d8a51bb2874f2583670317a4fb8db7",
"details": "Invalid metric_type 'INVALID'. Must be one of: COUNTER, GAUGE, HISTOGRAM"
}
},
"forbidden": {
"summary": "Forbidden Access",
"description": "Example error when user lacks required permissions",
"value": {
"code": 403,
"type": "Forbidden",
"correlation_id": "40276639de0f49d586e32edd8c4f6b34",
"details": "Access denied. User does not have permission to create metric definition templates"
}
},
"not_found": {
"summary": "Resource Not Found",
"description": "Example error when requested resource doesn't exist",
"value": {
"code": 404,
"type": "Not Found",
"correlation_id": "605f832bcfe44a1081441691c8d42253",
"details": "Metric definition template with id '550e8400-e29b-41d4-a716-446655440000' not found"
}
},
"rate_limit": {
"summary": "Rate Limit Exceeded",
"description": "Example error when API rate limit is exceeded",
"value": {
"code": 429,
"type": "Too Many Requests",
"correlation_id": "53909ed43c544531b7a555e295960437",
"details": "Rate limit exceeded. Maximum 100 requests are allowed within a 5-minute window"
}
},
"internal_server_error": {
"summary": "Internal Server Error",
"description": "Example error for unexpected server-side failures",
"value": {
"code": 500,
"type": "Internal Server Error",
"correlation_id": "b129b8e0e66c41aa9541a30f67e38ce2",
"details": "An unexpected error occurred while processing your request"
}
}
}{
"bad_request_validation": {
"summary": "Bad Request - Validation Error",
"description": "Example error when request validation fails",
"value": {
"code": 400,
"type": "Bad Request",
"correlation_id": "95c6a974e3ab01209b6b0dfedb1b16c5",
"details": "Validation failed: 'name' field is required and cannot be empty"
}
},
"bad_request_invalid_type": {
"summary": "Bad Request - Invalid Metric Type",
"description": "Example error when an invalid metric type is provided",
"value": {
"code": 400,
"type": "Bad Request",
"correlation_id": "00d8a51bb2874f2583670317a4fb8db7",
"details": "Invalid metric_type 'INVALID'. Must be one of: COUNTER, GAUGE, HISTOGRAM"
}
},
"forbidden": {
"summary": "Forbidden Access",
"description": "Example error when user lacks required permissions",
"value": {
"code": 403,
"type": "Forbidden",
"correlation_id": "40276639de0f49d586e32edd8c4f6b34",
"details": "Access denied. User does not have permission to create metric definition templates"
}
},
"not_found": {
"summary": "Resource Not Found",
"description": "Example error when requested resource doesn't exist",
"value": {
"code": 404,
"type": "Not Found",
"correlation_id": "605f832bcfe44a1081441691c8d42253",
"details": "Metric definition template with id '550e8400-e29b-41d4-a716-446655440000' not found"
}
},
"rate_limit": {
"summary": "Rate Limit Exceeded",
"description": "Example error when API rate limit is exceeded",
"value": {
"code": 429,
"type": "Too Many Requests",
"correlation_id": "53909ed43c544531b7a555e295960437",
"details": "Rate limit exceeded. Maximum 100 requests are allowed within a 5-minute window"
}
},
"internal_server_error": {
"summary": "Internal Server Error",
"description": "Example error for unexpected server-side failures",
"value": {
"code": 500,
"type": "Internal Server Error",
"correlation_id": "b129b8e0e66c41aa9541a30f67e38ce2",
"details": "An unexpected error occurred while processing your request"
}
}
}{
"bad_request_validation": {
"summary": "Bad Request - Validation Error",
"description": "Example error when request validation fails",
"value": {
"code": 400,
"type": "Bad Request",
"correlation_id": "95c6a974e3ab01209b6b0dfedb1b16c5",
"details": "Validation failed: 'name' field is required and cannot be empty"
}
},
"bad_request_invalid_type": {
"summary": "Bad Request - Invalid Metric Type",
"description": "Example error when an invalid metric type is provided",
"value": {
"code": 400,
"type": "Bad Request",
"correlation_id": "00d8a51bb2874f2583670317a4fb8db7",
"details": "Invalid metric_type 'INVALID'. Must be one of: COUNTER, GAUGE, HISTOGRAM"
}
},
"forbidden": {
"summary": "Forbidden Access",
"description": "Example error when user lacks required permissions",
"value": {
"code": 403,
"type": "Forbidden",
"correlation_id": "40276639de0f49d586e32edd8c4f6b34",
"details": "Access denied. User does not have permission to create metric definition templates"
}
},
"not_found": {
"summary": "Resource Not Found",
"description": "Example error when requested resource doesn't exist",
"value": {
"code": 404,
"type": "Not Found",
"correlation_id": "605f832bcfe44a1081441691c8d42253",
"details": "Metric definition template with id '550e8400-e29b-41d4-a716-446655440000' not found"
}
},
"rate_limit": {
"summary": "Rate Limit Exceeded",
"description": "Example error when API rate limit is exceeded",
"value": {
"code": 429,
"type": "Too Many Requests",
"correlation_id": "53909ed43c544531b7a555e295960437",
"details": "Rate limit exceeded. Maximum 100 requests are allowed within a 5-minute window"
}
},
"internal_server_error": {
"summary": "Internal Server Error",
"description": "Example error for unexpected server-side failures",
"value": {
"code": 500,
"type": "Internal Server Error",
"correlation_id": "b129b8e0e66c41aa9541a30f67e38ce2",
"details": "An unexpected error occurred while processing your request"
}
}
}Authorizations
ApiKeyAuthBearerAuth
Body
application/json
Show child attributes
Show child attributes
the list of simple queries computed to generate the timeseries
Required array length:
1 - 6 elements- Option 1
- Option 2
Show child attributes
Show child attributes
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 <= 10000Example:
50
The number of buckets to break the time series results into.
Example:
100
Show child attributes
Show child attributes
a list of formulas that combine the queries results
Maximum array length:
5Show child attributes
Show child attributes
Response
Timeseries search results
Map of the query/formula name and the related timeseries
contains the timeseries for a query or a formula
Show child attributes
Show child attributes
⌘I

