Skip to main content
GET
/
api
/
v1
/
logs
/
stats
cURL
curl --request GET \
  --url https://api.staging.qyl.dev/api/v1/logs/stats
import requests

url = "https://api.staging.qyl.dev/api/v1/logs/stats"

response = requests.get(url)

print(response.text)
const options = {method: 'GET'};

fetch('https://api.staging.qyl.dev/api/v1/logs/stats', 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.staging.qyl.dev/api/v1/logs/stats",
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.staging.qyl.dev/api/v1/logs/stats"

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.staging.qyl.dev/api/v1/logs/stats")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.staging.qyl.dev/api/v1/logs/stats")

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
{
  "total_count": 1,
  "by_severity": [
    {
      "count": 1,
      "percentage": 50
    }
  ],
  "by_service": [
    {
      "dimension": "<string>",
      "count": 1,
      "error_count": 1
    }
  ],
  "logs_per_second": 123,
  "error_rate": 0.5
}
{
"type": "about:blank",
"title": "Internal Server Error",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"error_code": "<string>"
}

Query Parameters

serviceName
string

Service name filter

startTime
string<date-time>

Start time

endTime
string<date-time>

End time

Response

The request has succeeded.

Aggregated log statistics

total_count
integer<int64>
required

Total log count

Required range: x >= 0
by_severity
object[]
required

Log counts by severity

by_service
object[]
required

Log counts by service

logs_per_second
number<double>
required

Logs per second rate

error_rate
number<double>
required

Error log rate

Required range: 0 <= x <= 1