Query traces
curl --request POST \
--url https://api.alerty.ai/query/traces \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"start_time": "2023-01-01T00:00:00Z",
"end_time": "2023-01-02T00:00:00Z",
"service_name": "<string>",
"span_name": "<string>",
"limit": 100
}
'import requests
url = "https://api.alerty.ai/query/traces"
payload = {
"start_time": "2023-01-01T00:00:00Z",
"end_time": "2023-01-02T00:00:00Z",
"service_name": "<string>",
"span_name": "<string>",
"limit": 100
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
start_time: '2023-01-01T00:00:00Z',
end_time: '2023-01-02T00:00:00Z',
service_name: '<string>',
span_name: '<string>',
limit: 100
})
};
fetch('https://api.alerty.ai/query/traces', 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.alerty.ai/query/traces",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'start_time' => '2023-01-01T00:00:00Z',
'end_time' => '2023-01-02T00:00:00Z',
'service_name' => '<string>',
'span_name' => '<string>',
'limit' => 100
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.alerty.ai/query/traces"
payload := strings.NewReader("{\n \"start_time\": \"2023-01-01T00:00:00Z\",\n \"end_time\": \"2023-01-02T00:00:00Z\",\n \"service_name\": \"<string>\",\n \"span_name\": \"<string>\",\n \"limit\": 100\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.alerty.ai/query/traces")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"start_time\": \"2023-01-01T00:00:00Z\",\n \"end_time\": \"2023-01-02T00:00:00Z\",\n \"service_name\": \"<string>\",\n \"span_name\": \"<string>\",\n \"limit\": 100\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.alerty.ai/query/traces")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"start_time\": \"2023-01-01T00:00:00Z\",\n \"end_time\": \"2023-01-02T00:00:00Z\",\n \"service_name\": \"<string>\",\n \"span_name\": \"<string>\",\n \"limit\": 100\n}"
response = http.request(request)
puts response.read_body[
{
"timestamp": "2023-11-07T05:31:56Z",
"trace_id": "<string>",
"span_id": "<string>",
"parent_span_id": "<string>",
"trace_state": "<string>",
"span_name": "<string>",
"span_kind": "<string>",
"service_name": "<string>",
"resource_attributes": {},
"scope_name": "<string>",
"scope_version": "<string>",
"span_attributes": {},
"duration": 123,
"status_code": "<string>",
"status_message": "<string>",
"events": [
{
"timestamp": "2023-11-07T05:31:56Z",
"name": "<string>",
"attributes": {}
}
],
"links": [
{
"trace_id": "<string>",
"span_id": "<string>",
"trace_state": "<string>",
"attributes": {}
}
]
}
]{
"description": "A descriptive error message",
"code": 1400,
"field": "name"
}{
"description": "A descriptive error message",
"code": 1400,
"field": "name"
}API Reference
Query traces
Retrieve traces based on the specified filters.
POST
/
query
/
traces
Query traces
curl --request POST \
--url https://api.alerty.ai/query/traces \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"start_time": "2023-01-01T00:00:00Z",
"end_time": "2023-01-02T00:00:00Z",
"service_name": "<string>",
"span_name": "<string>",
"limit": 100
}
'import requests
url = "https://api.alerty.ai/query/traces"
payload = {
"start_time": "2023-01-01T00:00:00Z",
"end_time": "2023-01-02T00:00:00Z",
"service_name": "<string>",
"span_name": "<string>",
"limit": 100
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
start_time: '2023-01-01T00:00:00Z',
end_time: '2023-01-02T00:00:00Z',
service_name: '<string>',
span_name: '<string>',
limit: 100
})
};
fetch('https://api.alerty.ai/query/traces', 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.alerty.ai/query/traces",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'start_time' => '2023-01-01T00:00:00Z',
'end_time' => '2023-01-02T00:00:00Z',
'service_name' => '<string>',
'span_name' => '<string>',
'limit' => 100
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.alerty.ai/query/traces"
payload := strings.NewReader("{\n \"start_time\": \"2023-01-01T00:00:00Z\",\n \"end_time\": \"2023-01-02T00:00:00Z\",\n \"service_name\": \"<string>\",\n \"span_name\": \"<string>\",\n \"limit\": 100\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.alerty.ai/query/traces")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"start_time\": \"2023-01-01T00:00:00Z\",\n \"end_time\": \"2023-01-02T00:00:00Z\",\n \"service_name\": \"<string>\",\n \"span_name\": \"<string>\",\n \"limit\": 100\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.alerty.ai/query/traces")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"start_time\": \"2023-01-01T00:00:00Z\",\n \"end_time\": \"2023-01-02T00:00:00Z\",\n \"service_name\": \"<string>\",\n \"span_name\": \"<string>\",\n \"limit\": 100\n}"
response = http.request(request)
puts response.read_body[
{
"timestamp": "2023-11-07T05:31:56Z",
"trace_id": "<string>",
"span_id": "<string>",
"parent_span_id": "<string>",
"trace_state": "<string>",
"span_name": "<string>",
"span_kind": "<string>",
"service_name": "<string>",
"resource_attributes": {},
"scope_name": "<string>",
"scope_version": "<string>",
"span_attributes": {},
"duration": 123,
"status_code": "<string>",
"status_message": "<string>",
"events": [
{
"timestamp": "2023-11-07T05:31:56Z",
"name": "<string>",
"attributes": {}
}
],
"links": [
{
"trace_id": "<string>",
"span_id": "<string>",
"trace_state": "<string>",
"attributes": {}
}
]
}
]{
"description": "A descriptive error message",
"code": 1400,
"field": "name"
}{
"description": "A descriptive error message",
"code": 1400,
"field": "name"
}Authorizations
bearerAuthcookieAuth
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Start time for the query.
Example:
"2023-01-01T00:00:00Z"
End time for the query.
Example:
"2023-01-02T00:00:00Z"
Filter traces by service name.
Filter traces by span name.
Limit the number of results.
Response
Traces retrieved
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
⌘I

