curl --request GET \
--url https://api.eu.bronto.io/metrics/{metric_id}/top-keys \
--header 'X-BRONTO-API-KEY: <api-key>'import requests
url = "https://api.eu.bronto.io/metrics/{metric_id}/top-keys"
headers = {"X-BRONTO-API-KEY": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-BRONTO-API-KEY': '<api-key>'}};
fetch('https://api.eu.bronto.io/metrics/{metric_id}/top-keys', 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/metrics/{metric_id}/top-keys",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://api.eu.bronto.io/metrics/{metric_id}/top-keys"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-BRONTO-API-KEY", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.eu.bronto.io/metrics/{metric_id}/top-keys")
.header("X-BRONTO-API-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eu.bronto.io/metrics/{metric_id}/top-keys")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-BRONTO-API-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"Resource:service.name": {
"type": "STRING",
"field_type": "ATTRIBUTE",
"values": {
"checkout": {
"value": "checkout"
},
"payments": {
"value": "payments"
}
}
},
"Resource:host.name": {
"type": "STRING",
"field_type": "ATTRIBUTE",
"values": {
"ip-10-0-1-23": {
"value": "ip-10-0-1-23"
}
}
},
"cpu": {
"type": "NUMBER",
"field_type": "ATTRIBUTE",
"values": {
"0": {
"value": "0"
},
"1": {
"value": "1"
}
}
}
}{
"code": 404,
"type": "Not Found",
"correlation_id": "605f832bcfe44a1081441691c8d42253",
"details": "Resource not found."
}{
"code": 500,
"type": "Internal Server Error",
"correlation_id": "b129b8e0e66c41aa9541a30f67e38ce2",
"details": "Internal Server Error"
}Retrieve the top keys and sample values for a metric
Returns the keys (attributes) received for a metric within a time window, together with each key’s data type and a sample of the values seen for it. Use this to discover which dimensions you can filter or group a metric by.
Set the time window in one of two ways:
time_range, a relative range such aslast 20 minutes, orfrom_tsandto_tstogether, as an absolute range in Unix milliseconds.
If no time window is provided, the most recent keys and values are returned. The response is an object keyed by key name. Values are a sample, not an exhaustive list.
curl --request GET \
--url https://api.eu.bronto.io/metrics/{metric_id}/top-keys \
--header 'X-BRONTO-API-KEY: <api-key>'import requests
url = "https://api.eu.bronto.io/metrics/{metric_id}/top-keys"
headers = {"X-BRONTO-API-KEY": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-BRONTO-API-KEY': '<api-key>'}};
fetch('https://api.eu.bronto.io/metrics/{metric_id}/top-keys', 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/metrics/{metric_id}/top-keys",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://api.eu.bronto.io/metrics/{metric_id}/top-keys"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-BRONTO-API-KEY", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.eu.bronto.io/metrics/{metric_id}/top-keys")
.header("X-BRONTO-API-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eu.bronto.io/metrics/{metric_id}/top-keys")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-BRONTO-API-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"Resource:service.name": {
"type": "STRING",
"field_type": "ATTRIBUTE",
"values": {
"checkout": {
"value": "checkout"
},
"payments": {
"value": "payments"
}
}
},
"Resource:host.name": {
"type": "STRING",
"field_type": "ATTRIBUTE",
"values": {
"ip-10-0-1-23": {
"value": "ip-10-0-1-23"
}
}
},
"cpu": {
"type": "NUMBER",
"field_type": "ATTRIBUTE",
"values": {
"0": {
"value": "0"
},
"1": {
"value": "1"
}
}
}
}{
"code": 404,
"type": "Not Found",
"correlation_id": "605f832bcfe44a1081441691c8d42253",
"details": "Resource not found."
}{
"code": 500,
"type": "Internal Server Error",
"correlation_id": "b129b8e0e66c41aa9541a30f67e38ce2",
"details": "Internal Server Error"
}Authorizations
Path Parameters
The unique identifier (UUID) of the metric.
Query Parameters
The relative time range for which to retrieve the keys.
The starting time (unix time in milliseconds) for which retrieve the keys. Must be used together with to_ts. This parameter is incompatible with time_range.
The ending time (unix time in milliseconds) for which to retrieve the keys. Must be used together with from_ts. This parameter is incompatible with time_range.
Response
Metric keys retrieved successfully
Show child attributes
Show child attributes
