Query Traces Spans
curl --request POST \
--url https://engine-api.unomiq.com/engine/query \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Unomiq-App-Id: <x-unomiq-app-id>' \
--data '
{
"filter": {
"field": "span_attributes.http.method",
"op": "eq",
"value": "GET"
}
}
'import requests
url = "https://engine-api.unomiq.com/engine/query"
payload = { "filter": {
"field": "span_attributes.http.method",
"op": "eq",
"value": "GET"
} }
headers = {
"X-Unomiq-App-Id": "<x-unomiq-app-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Unomiq-App-Id': '<x-unomiq-app-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({filter: {field: 'span_attributes.http.method', op: 'eq', value: 'GET'}})
};
fetch('https://engine-api.unomiq.com/engine/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://engine-api.unomiq.com/engine/query",
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([
'filter' => [
'field' => 'span_attributes.http.method',
'op' => 'eq',
'value' => 'GET'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Unomiq-App-Id: <x-unomiq-app-id>"
],
]);
$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://engine-api.unomiq.com/engine/query"
payload := strings.NewReader("{\n \"filter\": {\n \"field\": \"span_attributes.http.method\",\n \"op\": \"eq\",\n \"value\": \"GET\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Unomiq-App-Id", "<x-unomiq-app-id>")
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://engine-api.unomiq.com/engine/query")
.header("X-Unomiq-App-Id", "<x-unomiq-app-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"filter\": {\n \"field\": \"span_attributes.http.method\",\n \"op\": \"eq\",\n \"value\": \"GET\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://engine-api.unomiq.com/engine/query")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Unomiq-App-Id"] = '<x-unomiq-app-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"filter\": {\n \"field\": \"span_attributes.http.method\",\n \"op\": \"eq\",\n \"value\": \"GET\"\n }\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"trace_id": "<string>",
"span_id": "<string>",
"span_start_time_unix_nano": 123,
"span_end_time_unix_nano": 123,
"duration_ms": 123,
"span_name": "<string>",
"span_kind": "<string>",
"parent_span_id": "<string>",
"service_name": "<string>",
"unit": "<string>",
"parent_unit": "<string>",
"resource_attributes": {},
"span_attributes": {},
"cost": 123,
"billing": {
"resource_type": "<string>",
"resource_name": "<string>",
"service_id": "<string>",
"service_name": "<string>",
"sku_id": "<string>",
"sku_name": "<string>",
"region": "<string>"
},
"usage": {
"amount": 123,
"unit": "<string>"
}
}
],
"total": 123,
"page": 123,
"limit": 123
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Engine
Query Traces & Spans
Query traces and spans using a filter expression.
Requires a valid JWT token with the read:traces permission.
The following fields are supported in nested AND/OR conditions:
Identifiers
| Field | Description |
|---|---|
trace_id | Trace identifier |
span_id | Span identifier |
Span fields
| Field | Description |
|---|---|
span_attributes.* | Any span attribute (e.g., span_attributes.http.method) |
resource_attributes.* | Any resource attribute |
span_kind | Span kind |
span_name | Span name |
service_name | Service name (equivalent to resource_attributes.service.name) |
unit | Unit (equivalent to span_attributes.unomiq.unit) |
parent_unit | Parent unit (equivalent to span_attributes.unomiq.parent_unit) |
duration_ms | Span duration in milliseconds |
Billing & Usage
| Field | Description |
|---|---|
billing.resource_type | Resource type (e.g., db_job, api_request, llm_generate_content) |
billing.resource_name | Billing resource name |
billing.service_id | Billing service ID |
billing.service_name | Billing service name |
billing.sku_id | Billing SKU ID |
billing.sku_name | Billing SKU name |
billing.region | Billing region |
cost | Cost |
usage.amount | Usage amount |
usage.unit | Usage unit |
Returns a paginated list of matching traces with total count.
POST
/
engine
/
query
Query Traces Spans
curl --request POST \
--url https://engine-api.unomiq.com/engine/query \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Unomiq-App-Id: <x-unomiq-app-id>' \
--data '
{
"filter": {
"field": "span_attributes.http.method",
"op": "eq",
"value": "GET"
}
}
'import requests
url = "https://engine-api.unomiq.com/engine/query"
payload = { "filter": {
"field": "span_attributes.http.method",
"op": "eq",
"value": "GET"
} }
headers = {
"X-Unomiq-App-Id": "<x-unomiq-app-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Unomiq-App-Id': '<x-unomiq-app-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({filter: {field: 'span_attributes.http.method', op: 'eq', value: 'GET'}})
};
fetch('https://engine-api.unomiq.com/engine/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://engine-api.unomiq.com/engine/query",
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([
'filter' => [
'field' => 'span_attributes.http.method',
'op' => 'eq',
'value' => 'GET'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Unomiq-App-Id: <x-unomiq-app-id>"
],
]);
$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://engine-api.unomiq.com/engine/query"
payload := strings.NewReader("{\n \"filter\": {\n \"field\": \"span_attributes.http.method\",\n \"op\": \"eq\",\n \"value\": \"GET\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Unomiq-App-Id", "<x-unomiq-app-id>")
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://engine-api.unomiq.com/engine/query")
.header("X-Unomiq-App-Id", "<x-unomiq-app-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"filter\": {\n \"field\": \"span_attributes.http.method\",\n \"op\": \"eq\",\n \"value\": \"GET\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://engine-api.unomiq.com/engine/query")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Unomiq-App-Id"] = '<x-unomiq-app-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"filter\": {\n \"field\": \"span_attributes.http.method\",\n \"op\": \"eq\",\n \"value\": \"GET\"\n }\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"trace_id": "<string>",
"span_id": "<string>",
"span_start_time_unix_nano": 123,
"span_end_time_unix_nano": 123,
"duration_ms": 123,
"span_name": "<string>",
"span_kind": "<string>",
"parent_span_id": "<string>",
"service_name": "<string>",
"unit": "<string>",
"parent_unit": "<string>",
"resource_attributes": {},
"span_attributes": {},
"cost": 123,
"billing": {
"resource_type": "<string>",
"resource_name": "<string>",
"service_id": "<string>",
"service_name": "<string>",
"sku_id": "<string>",
"sku_name": "<string>",
"region": "<string>"
},
"usage": {
"amount": 123,
"unit": "<string>"
}
}
],
"total": 123,
"page": 123,
"limit": 123
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Query Parameters
Start datetime (inclusive)
Example:
"2025-01-15T00:00:00Z"
End datetime (exclusive)
Example:
"2025-01-16T00:00:00Z"
Page number for pagination (1-indexed)
Required range:
x >= 1Number of items per page
Required range:
1 <= x <= 100Body
application/json
Request model for query filter.
A single filter condition.
- Condition
- AndGroup
- OrGroup
Show child attributes
Show child attributes