Metrics History
curl --request GET \
--url https://api.example.com/api/metrics/historyimport requests
url = "https://api.example.com/api/metrics/history"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/metrics/history', 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.example.com/api/metrics/history",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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.example.com/api/metrics/history"
req, _ := http.NewRequest("GET", url, nil)
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.example.com/api/metrics/history")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/metrics/history")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"data": {
"service-one": {
"name": "Service One",
"points": [
{ "t": 1703750400000, "v": 1250 },
{ "t": 1703754000000, "v": 1380 }
]
}
}
}
Metrics
Metrics History
Get historical data points for all services
GET
/
api
/
metrics
/
history
Metrics History
curl --request GET \
--url https://api.example.com/api/metrics/historyimport requests
url = "https://api.example.com/api/metrics/history"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/metrics/history', 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.example.com/api/metrics/history",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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.example.com/api/metrics/history"
req, _ := http.NewRequest("GET", url, nil)
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.example.com/api/metrics/history")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/metrics/history")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"data": {
"service-one": {
"name": "Service One",
"points": [
{ "t": 1703750400000, "v": 1250 },
{ "t": 1703754000000, "v": 1380 }
]
}
}
}
Metrics History
Retrieve historical online count data points for all services over the last 24 hours.Response
object
Example Request
curl -X GET "https://www.orcrev.fit/api/metrics/history"
Example Response
{
"data": {
"service-one": {
"name": "Service One",
"points": [
{ "t": 1703750400000, "v": 1250 },
{ "t": 1703754000000, "v": 1380 },
{ "t": 1703757600000, "v": 1520 }
]
},
"service-two": {
"name": "Service Two",
"points": [
{ "t": 1703750400000, "v": 850 },
{ "t": 1703754000000, "v": 920 }
]
}
}
}
Use this endpoint to build charts and graphs showing online count trends over time.
This endpoint returns data for the last 24 hours only. Older data is automatically pruned.
{
"data": {
"service-one": {
"name": "Service One",
"points": [
{ "t": 1703750400000, "v": 1250 },
{ "t": 1703754000000, "v": 1380 }
]
}
}
}
⌘I

