Query current metric values
curl --request GET \
--url https://controller.platform.simplecloud.app/v0/metrics/query \
--header 'X-Network-ID: <x-network-id>' \
--header 'X-Network-Secret: <x-network-secret>'import requests
url = "https://controller.platform.simplecloud.app/v0/metrics/query"
headers = {
"X-Network-ID": "<x-network-id>",
"X-Network-Secret": "<x-network-secret>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'X-Network-ID': '<x-network-id>', 'X-Network-Secret': '<x-network-secret>'}
};
fetch('https://controller.platform.simplecloud.app/v0/metrics/query', 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://controller.platform.simplecloud.app/v0/metrics/query",
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-Network-ID: <x-network-id>",
"X-Network-Secret: <x-network-secret>"
],
]);
$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://controller.platform.simplecloud.app/v0/metrics/query"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Network-ID", "<x-network-id>")
req.Header.Add("X-Network-Secret", "<x-network-secret>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://controller.platform.simplecloud.app/v0/metrics/query")
.header("X-Network-ID", "<x-network-id>")
.header("X-Network-Secret", "<x-network-secret>")
.asString();require 'uri'
require 'net/http'
url = URI("https://controller.platform.simplecloud.app/v0/metrics/query")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Network-ID"] = '<x-network-id>'
request["X-Network-Secret"] = '<x-network-secret>'
response = http.request(request)
puts response.read_body{
"samples": [
{
"labels": {},
"metric": "<string>",
"timestamp": "<string>",
"value": 123
}
]
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}metrics
Query current metric values
Get the latest values for a metric, optionally grouped by a label
GET
/
v0
/
metrics
/
query
Query current metric values
curl --request GET \
--url https://controller.platform.simplecloud.app/v0/metrics/query \
--header 'X-Network-ID: <x-network-id>' \
--header 'X-Network-Secret: <x-network-secret>'import requests
url = "https://controller.platform.simplecloud.app/v0/metrics/query"
headers = {
"X-Network-ID": "<x-network-id>",
"X-Network-Secret": "<x-network-secret>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'X-Network-ID': '<x-network-id>', 'X-Network-Secret': '<x-network-secret>'}
};
fetch('https://controller.platform.simplecloud.app/v0/metrics/query', 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://controller.platform.simplecloud.app/v0/metrics/query",
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-Network-ID: <x-network-id>",
"X-Network-Secret: <x-network-secret>"
],
]);
$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://controller.platform.simplecloud.app/v0/metrics/query"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Network-ID", "<x-network-id>")
req.Header.Add("X-Network-Secret", "<x-network-secret>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://controller.platform.simplecloud.app/v0/metrics/query")
.header("X-Network-ID", "<x-network-id>")
.header("X-Network-Secret", "<x-network-secret>")
.asString();require 'uri'
require 'net/http'
url = URI("https://controller.platform.simplecloud.app/v0/metrics/query")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Network-ID"] = '<x-network-id>'
request["X-Network-Secret"] = '<x-network-secret>'
response = http.request(request)
puts response.read_body{
"samples": [
{
"labels": {},
"metric": "<string>",
"timestamp": "<string>",
"value": 123
}
]
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Query Parameters
Metric name (e.g., server.player_count, server.cpu_usage_percent)
Label to group by (e.g., server_group_name, persistent_server_name)
Comma-separated server IDs to filter
Comma-separated server group IDs to filter
Comma-separated persistent server IDs to filter
Comma-separated server group types to filter (e.g., SERVER, PROXY)
Response
OK
Show child attributes
Show child attributes
Was this page helpful?
⌘I