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": {},
"comparison_window": "3h",
"comparison": {},
"counters": {},
"anomalies": {}
}Get Database Insights
This endpoint returns the Insights series of a database: service latency percentiles, read, write, engine, replication, lock-wait and Lua latency, expired entries, replication lag, throughput, bandwidth and disk size, for the whole database, one replica or every region, with each series’ latest window compared to the one before it, and how much the limit, security and Lua counters grew over the period. 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": {},
"comparison_window": "3h",
"comparison": {},
"counters": {},
"anomalies": {}
}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 the key of a group whose kind is replica. Other keys are rejected with 400.
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, read_latency_99, write_latency_99, command_latency_99, replication_latency_999, wait_latency_99, lua_latency_p50, lua_latency_99, expired_entries (per minute), replication_lag (entries), throughput, bandwidth (bytes per second) and diskusage.
Show child attributes
Show child attributes
Length of the latest window the comparison averages: the whole period up to three hours, the last three hours for longer periods.
"3h"
Metric name to group key to the mean over the latest window and over the equal window right before it. previous is absent when that earlier window has no data.
Show child attributes
Show child attributes
Growth of each counter over the period, for the whole database: over_size_requests (TCP and REST), over_size_record_accesses, throttled_commands (writes delayed by persistence backpressure), undeliverable (requests and connections the proxies could not hand to any replica), auth_failures (TCP and REST, including commands sent before authenticating and REST requests over the rate limit), keyspace_notifications, connections_opened, bandwidth_ingress, bandwidth_egress (bytes), rest_commands, lua_executions, lua_commands (commands run inside scripts), lua_failures, lua_timeouts and lua_memory_limits.
Show child attributes
Show child attributes
Metric name to up to three anomalies of its all series, largest first: stretches where the value stayed above both the period's median plus three standard deviations, estimated as 1.4826 times the median absolute deviation, and 30% over the median. A series with fewer than 8 points after its first positive value reports none. The median is raised to a small per-metric floor, so a nearly idle series does not report huge changes. An empty stretch at the start of the series is ignored, and a stretch longer than a third of the analyzed points is a level change, not an anomaly. Every metric is present; diskusage is never checked and always has an empty list.
Show child attributes
Show child attributes
Was this page helpful?