Get Trace Detail
Return the trace + its span tree.
Trace lookup uses the full 16-byte W3C id stored on
standalone_trace. The span query uses the trailing 8-byte slice
(trace_id[8:]) — that’s the form the exporter persists onto
standalone_span.otel_trace_id.
curl --request GET \
--url https://api.example.com/admin/api/v1/traces/{otel_trace_id}import requests
url = "https://api.example.com/admin/api/v1/traces/{otel_trace_id}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/admin/api/v1/traces/{otel_trace_id}', 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/admin/api/v1/traces/{otel_trace_id}",
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/admin/api/v1/traces/{otel_trace_id}"
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/admin/api/v1/traces/{otel_trace_id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/admin/api/v1/traces/{otel_trace_id}")
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{
"trace": {
"otelTraceId": "<string>",
"name": "<string>",
"startedAt": "2023-11-07T05:31:56Z",
"endedAt": "2023-11-07T05:31:56Z",
"latencyMs": 123,
"totalTokens": 123,
"totalCostUsd": 123,
"models": [
"<string>"
],
"status": "<string>",
"userId": "<string>",
"sessionId": "<string>",
"tags": [
"<string>"
]
},
"tree": [
{
"span": {
"otelSpanId": "<string>",
"otelTraceId": "<string>",
"name": "<string>",
"kind": "<string>",
"startedAt": "2023-11-07T05:31:56Z",
"parentSpanId": "<string>",
"endedAt": "2023-11-07T05:31:56Z",
"latencyMs": 123,
"model": "<string>",
"provider": "<string>",
"promptTokens": 123,
"completionTokens": 123,
"cacheReadTokens": 123,
"cacheWriteTokens": 123,
"totalTokens": 123,
"costUsd": 123,
"costBreakdown": {},
"costSource": "<string>",
"status": "<string>",
"attributes": {},
"events": [
{}
]
},
"children": "<array>"
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Path Parameters
Response
Successful Response
Body of GET /admin/api/v1/traces/{otel_trace_id}.
tree holds the top-level spans of the trace. Orphan spans
(those whose parent_span_id is not present in the same trace,
e.g. truncated traces or cross-trace links) are also surfaced as
roots so the UI never silently hides them.
One row in GET /admin/api/v1/traces list response.
otel_trace_id is the lowercase hex encoding of the 16-byte
W3C trace id. The DB stores raw bytes; routers convert at the
boundary so JSON consumers never see a binary blob.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Was this page helpful?
curl --request GET \
--url https://api.example.com/admin/api/v1/traces/{otel_trace_id}import requests
url = "https://api.example.com/admin/api/v1/traces/{otel_trace_id}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/admin/api/v1/traces/{otel_trace_id}', 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/admin/api/v1/traces/{otel_trace_id}",
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/admin/api/v1/traces/{otel_trace_id}"
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/admin/api/v1/traces/{otel_trace_id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/admin/api/v1/traces/{otel_trace_id}")
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{
"trace": {
"otelTraceId": "<string>",
"name": "<string>",
"startedAt": "2023-11-07T05:31:56Z",
"endedAt": "2023-11-07T05:31:56Z",
"latencyMs": 123,
"totalTokens": 123,
"totalCostUsd": 123,
"models": [
"<string>"
],
"status": "<string>",
"userId": "<string>",
"sessionId": "<string>",
"tags": [
"<string>"
]
},
"tree": [
{
"span": {
"otelSpanId": "<string>",
"otelTraceId": "<string>",
"name": "<string>",
"kind": "<string>",
"startedAt": "2023-11-07T05:31:56Z",
"parentSpanId": "<string>",
"endedAt": "2023-11-07T05:31:56Z",
"latencyMs": 123,
"model": "<string>",
"provider": "<string>",
"promptTokens": 123,
"completionTokens": 123,
"cacheReadTokens": 123,
"cacheWriteTokens": 123,
"totalTokens": 123,
"costUsd": 123,
"costBreakdown": {},
"costSource": "<string>",
"status": "<string>",
"attributes": {},
"events": [
{}
]
},
"children": "<array>"
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}