curl --request GET \
--url https://api.upstash.com/v2/redis/insights/{id} \
--header 'Authorization: Basic <encoded-value>'import requests
url = "https://api.upstash.com/v2/redis/insights/{id}"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('https://api.upstash.com/v2/redis/insights/{id}', 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.upstash.com/v2/redis/insights/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>"
],
]);
$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.upstash.com/v2/redis/insights/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Basic <encoded-value>")
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.upstash.com/v2/redis/insights/{id}")
.header("Authorization", "Basic <encoded-value>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.upstash.com/v2/redis/insights/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic <encoded-value>'
response = http.request(request)
puts response.read_body{
"groups": [
{
"key": "<string>",
"label": "<string>",
"kind": "all"
}
],
"metrics": {}
}Get Database Insights
This endpoint returns the Insights series of a database: latency percentiles, engine, lock-wait, Lua and disk-load latency, keys loaded from disk, throughput and disk size, for the whole database, one replica or every region. Latencies are in milliseconds. Available for databases on a Pro plan or with the Production Pack.
curl --request GET \
--url https://api.upstash.com/v2/redis/insights/{id} \
--header 'Authorization: Basic <encoded-value>'import requests
url = "https://api.upstash.com/v2/redis/insights/{id}"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('https://api.upstash.com/v2/redis/insights/{id}', 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.upstash.com/v2/redis/insights/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>"
],
]);
$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.upstash.com/v2/redis/insights/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Basic <encoded-value>")
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.upstash.com/v2/redis/insights/{id}")
.header("Authorization", "Basic <encoded-value>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.upstash.com/v2/redis/insights/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic <encoded-value>'
response = http.request(request)
puts response.read_body{
"groups": [
{
"key": "<string>",
"label": "<string>",
"kind": "all"
}
],
"metrics": {}
}Authorizations
Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.
Path Parameters
The ID of the database
Query Parameters
The period of the series: 1h, 3h, 12h, 1d, 3d, 7d or 30d. Defaults to 3h.
Restrict the series to one replica, by its id from the groups list.
Set to region to receive one series per region next to the total.
region Response
Database insights retrieved successfully
Every group the database has, regardless of the scope requested
Show child attributes
Show child attributes
Metric name to group key to data points. The all group is always present; region groups are added with by=region. Metrics: latency_p50, latency_p90, latency_p99, command_latency_99, wait_latency_99, lua_latency_99, disk_load_latency_99, disk_loads, throughput and diskusage.
Show child attributes
Show child attributes
Was this page helpful?