Ambil metrik kesehatan server
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
Ambil metrik kesehatan server
Memori proses dan kontainernya (cgroup v2, lalu v1), waktu CPU, ukuran statics/media dan storages (hasil penelusuran di-cache selama satu menit), ruang kosong pada volume, penyimpanan sesi, serta jumlah perangkat yang terdaftar, sudah login, dan terhubung. Tidak memerlukan perangkat. Field bernilai null berarti tidak diketahui pada platform saat ini (non-Linux) atau tidak dibatasi (batas memori kontainer). Penggunaan folder dihitung semampunya: entri yang hilang atau tidak dapat dibaca diabaikan, dan target symlink tidak ditelusuri. Metrik kontainer menggunakan mount standar /sys/fs/cgroup dan bernilai null saat tidak tersedia. Uptime mencakup inisialisasi proses.
GET
/
app
/
metrics
Ambil metrik kesehatan server
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
}
}
}
}