curl --request GET \
--url https://api.rafftechnologies.com/api/v1/databases/{database_id}/metrics \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.rafftechnologies.com/api/v1/databases/{database_id}/metrics"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.rafftechnologies.com/api/v1/databases/{database_id}/metrics', 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.rafftechnologies.com/api/v1/databases/{database_id}/metrics",
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-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.rafftechnologies.com/api/v1/databases/{database_id}/metrics"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-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.rafftechnologies.com/api/v1/databases/{database_id}/metrics")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.rafftechnologies.com/api/v1/databases/{database_id}/metrics")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"success": true,
"cpu_used_millicores": 123,
"cpu_capacity_millicores": 123,
"mem_used_bytes": 123,
"mem_capacity_bytes": 123,
"storage_used_bytes": 123,
"storage_capacity_bytes": 123,
"connections_active": 123,
"connections_max": 123,
"replication_lag_bytes": 123,
"archive_lag_bytes": 123,
"metrics_updated_at": "<string>",
"pooled_connections_active": 123,
"pooled_connections_max": 123,
"ops_per_sec": 123,
"cache_hit_pct": 123,
"evictions_per_min": 123,
"merges_running": 123,
"compression_ratio": 123,
"pooler_server_active": 123,
"pooler_server_idle": 123,
"pooler_cl_waiting": 123,
"pooler_maxwait_us": 123,
"pooler_version": "<string>",
"conn_rejected_total": 123,
"conn_idle_timeout_secs": 123,
"storage_data_bytes": 123,
"storage_log_bytes": 123,
"storage_read_only": true
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}Get metrics
Latest usage snapshot: CPU, memory, storage, connections, and replication lag. Metrics refresh about every 60 seconds; zero values mean not measured yet, and -1 means the engine does not report that number.
curl --request GET \
--url https://api.rafftechnologies.com/api/v1/databases/{database_id}/metrics \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.rafftechnologies.com/api/v1/databases/{database_id}/metrics"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.rafftechnologies.com/api/v1/databases/{database_id}/metrics', 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.rafftechnologies.com/api/v1/databases/{database_id}/metrics",
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-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.rafftechnologies.com/api/v1/databases/{database_id}/metrics"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-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.rafftechnologies.com/api/v1/databases/{database_id}/metrics")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.rafftechnologies.com/api/v1/databases/{database_id}/metrics")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"success": true,
"cpu_used_millicores": 123,
"cpu_capacity_millicores": 123,
"mem_used_bytes": 123,
"mem_capacity_bytes": 123,
"storage_used_bytes": 123,
"storage_capacity_bytes": 123,
"connections_active": 123,
"connections_max": 123,
"replication_lag_bytes": 123,
"archive_lag_bytes": 123,
"metrics_updated_at": "<string>",
"pooled_connections_active": 123,
"pooled_connections_max": 123,
"ops_per_sec": 123,
"cache_hit_pct": 123,
"evictions_per_min": 123,
"merges_running": 123,
"compression_ratio": 123,
"pooler_server_active": 123,
"pooler_server_idle": 123,
"pooler_cl_waiting": 123,
"pooler_maxwait_us": 123,
"pooler_version": "<string>",
"conn_rejected_total": 123,
"conn_idle_timeout_secs": 123,
"storage_data_bytes": 123,
"storage_log_bytes": 123,
"storage_read_only": true
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}Authorizations
API key for authentication. Each key is bound to a specific account.
Path Parameters
Database ID (UUID) or short id (the database_id field, e.g. a1b2c3d4)
Response
Latest metrics snapshot
Latest usage snapshot, refreshed about every 60 seconds. Zero values mean not measured yet.
CPU in use, millicores
CPU capacity, millicores
Memory in use, bytes
Memory capacity, bytes
Storage in use, bytes
Storage capacity, bytes
Active client connections
Connection limit
Standby/replica lag in bytes (0 without HA or replicas)
WAL archiving lag in bytes (PostgreSQL)
When this snapshot was taken, RFC 3339 (empty before the first sample)
Client connections on the pooler (PostgreSQL)
Pooler connection limit (PostgreSQL)
Transactions (PostgreSQL), queries (MySQL, ClickHouse) or commands (Valkey) per second. -1 when not measured
Share of reads served from memory, percent. -1 when not measured
Keys removed because memory was full, per minute (Valkey). -1 for other engines
Background merges running (ClickHouse). -1 for other engines
Data size before compression divided by size on disk (ClickHouse). -1 for other engines
Server connections the pooler is using (PostgreSQL). -1 without a pooler
Idle server connections in the pool (PostgreSQL). -1 without a pooler
Client connections waiting for a server connection (PostgreSQL). Above 0 for long means the pool is too small for the load
Longest current wait for a server connection, microseconds (PostgreSQL)
Pooler version (PostgreSQL)
Connections refused because the limit was reached, since the database started. -1 when not measured
Seconds after which idle connections are closed. -1 when not set
Part of storage_used_bytes taken by data. -1 when not measured
Part of storage_used_bytes taken by the write-ahead or binary log. -1 when not measured
True while storage is at 95% or more and PostgreSQL or MySQL accept reads only. Writes come back below 90%