List spans with simple filters (no DSL)
curl --request GET \
--url https://api.example.com/v1/projects/{project_identifier}/spansimport requests
url = "https://api.example.com/v1/projects/{project_identifier}/spans"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/v1/projects/{project_identifier}/spans', 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/v1/projects/{project_identifier}/spans",
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/v1/projects/{project_identifier}/spans"
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/v1/projects/{project_identifier}/spans")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/projects/{project_identifier}/spans")
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": [
{
"attributes": {
"llm.model_name": "gpt-4",
"llm.token_count.completion": 50,
"llm.token_count.prompt": 100
},
"context": {
"span_id": "1a2b3c4d5e6f7a8b",
"trace_id": "a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4"
},
"end_time": "2024-01-01T12:00:01Z",
"events": [],
"name": "llm_call",
"span_kind": "LLM",
"start_time": "2024-01-01T12:00:00Z",
"status_code": "OK",
"status_message": ""
}
],
"next_cursor": "<string>"
}<string><string><string>Spans
List spans with simple filters (no DSL)
Return spans within a project filtered by time range. Supports cursor-based pagination.
GET
/
v1
/
projects
/
{project_identifier}
/
spans
List spans with simple filters (no DSL)
curl --request GET \
--url https://api.example.com/v1/projects/{project_identifier}/spansimport requests
url = "https://api.example.com/v1/projects/{project_identifier}/spans"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/v1/projects/{project_identifier}/spans', 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/v1/projects/{project_identifier}/spans",
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/v1/projects/{project_identifier}/spans"
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/v1/projects/{project_identifier}/spans")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/projects/{project_identifier}/spans")
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": [
{
"attributes": {
"llm.model_name": "gpt-4",
"llm.token_count.completion": 50,
"llm.token_count.prompt": 100
},
"context": {
"span_id": "1a2b3c4d5e6f7a8b",
"trace_id": "a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4"
},
"end_time": "2024-01-01T12:00:01Z",
"events": [],
"name": "llm_call",
"span_kind": "LLM",
"start_time": "2024-01-01T12:00:00Z",
"status_code": "OK",
"status_message": ""
}
],
"next_cursor": "<string>"
}<string><string><string>Path Parameters
Query Parameters
Filter spans by key:value. Key is a dot-path (e.g. user.id, metadata.tier). Value is JSON-parsed: k:12345 is int, k:true is bool, otherwise string (k:user-42). To match a numeric- or boolean-looking STRING, JSON-quote it: user.id:"12345" (URL-encoded %2212345%22). Split is on the first : only, so values may contain colons (session.id:sess:abc:123, ISO timestamps). Repeat the param to AND filters. List-valued attributes (e.g. tag.tags) cannot be matched here. Returns 422 on malformed input (missing colon, empty key/value, or list/dict/null value).
Was this page helpful?

