Get server health metrics
curl --request GET \
--url http://localhost:3000/app/metrics \
--header 'Authorization: Basic <encoded-value>'import requests
url = "http://localhost:3000/app/metrics"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('http://localhost:3000/app/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_PORT => "3000",
CURLOPT_URL => "http://localhost:3000/app/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 => [
"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 := "http://localhost:3000/app/metrics"
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("http://localhost:3000/app/metrics")
.header("Authorization", "Basic <encoded-value>")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3000/app/metrics")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic <encoded-value>'
response = http.request(request)
puts response.read_body{
"status": 200,
"code": "SUCCESS",
"message": "Fetch app metrics success",
"results": {
"version": "v9.6.0",
"session_store": "sqlite",
"devices": {
"total": 5,
"logged_in": 3,
"connected": 3
},
"system": {
"started_at": "2023-11-07T05:31:56Z",
"uptime_seconds": 3600,
"go_version": "go1.26.9",
"cpu_seconds": 17.9,
"memory": {
"heap_alloc_bytes": 123,
"runtime_sys_bytes": 123,
"process_rss_bytes": 123,
"container_bytes": 123,
"container_limit_bytes": 123,
"goroutines": 123,
"gc_cycles": 123
},
"folders": {},
"filesystem": {
"total_bytes": 123,
"free_bytes": 123
}
}
}
}app
Get server health metrics
Memory of the process and of its container (cgroup v2, then v1), CPU time, size of statics/media and storages (walk cached for a minute), free space on the volume, the session store and how many devices are registered, logged in and connected. Requires no device. Nullable fields are unknown on the current platform (non-Linux) or unlimited (container memory limit). Folder usage is best effort: missing or unreadable entries are omitted, and symlink targets are not traversed. Container metrics use the standard /sys/fs/cgroup mount and are null when unavailable. Uptime includes process initialization.
GET
/
app
/
metrics
Get server health metrics
curl --request GET \
--url http://localhost:3000/app/metrics \
--header 'Authorization: Basic <encoded-value>'import requests
url = "http://localhost:3000/app/metrics"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('http://localhost:3000/app/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_PORT => "3000",
CURLOPT_URL => "http://localhost:3000/app/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 => [
"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 := "http://localhost:3000/app/metrics"
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("http://localhost:3000/app/metrics")
.header("Authorization", "Basic <encoded-value>")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3000/app/metrics")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic <encoded-value>'
response = http.request(request)
puts response.read_body{
"status": 200,
"code": "SUCCESS",
"message": "Fetch app metrics success",
"results": {
"version": "v9.6.0",
"session_store": "sqlite",
"devices": {
"total": 5,
"logged_in": 3,
"connected": 3
},
"system": {
"started_at": "2023-11-07T05:31:56Z",
"uptime_seconds": 3600,
"go_version": "go1.26.9",
"cpu_seconds": 17.9,
"memory": {
"heap_alloc_bytes": 123,
"runtime_sys_bytes": 123,
"process_rss_bytes": 123,
"container_bytes": 123,
"container_limit_bytes": 123,
"goroutines": 123,
"gc_cycles": 123
},
"folders": {},
"filesystem": {
"total_bytes": 123,
"free_bytes": 123
}
}
}
}Authorizations
Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.
