Get a trace
const url = 'http://localhost:8080/api/v1/projects/example/traces/example';const options = {method: 'GET', headers: {cookie: 'cetra_session=<cetra_session>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url http://localhost:8080/api/v1/projects/example/traces/example \ --cookie cetra_session=<cetra_session>Spans are a flat pre-order list: roots first, children sorted by start time then span id. depth is 0 at a root. detached is true when the parent is missing or the span sits in a parent cycle. At most 20000 spans; truncated is true when more exist.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Project UUID, URL-encoded org-slug/project-slug, or current.
Trace id, 16 bytes as hex. Responses use lowercase; requests may use either case. All zeros is invalid.
Trace id, 16 bytes as hex.
Query Parameters
Section titled “Query Parameters”RFC 3339 timestamp or epoch milliseconds.
Instant the client is looking at. RFC 3339 or epoch milliseconds.
Responses
Section titled “Responses”The trace and its span tree.
Trace summary plus its span tree.
Spec 09 § Response shapes.
object
Spans in pre-order. At most [MAX_TRACE_SPANS].
One span in a flat pre-order trace tree.
Spec 09 § Response shapes.
object
Distance from the root. Roots are 0.
The parent is missing, or this span sits in a parent cycle.
Light columns of the span.
object
Cache-read tokens.
Cache-write tokens.
Total cost, USD.
end_time - start_time, nanoseconds. Saturates on overflow.
End, nanoseconds since the Unix epoch. JSON is RFC 3339.
Deployment environment.
First 512 characters of the plain-text input rendering.
Input tokens, including cached tokens.
User metadata.
object
Response model, or the request model when the response names none.
Span name.
First 512 characters of the plain-text output rendering.
Output tokens, including reasoning tokens.
Parent span. Omitted when this span is a root of the received trace.
Prompt name from cetra.prompt.name or Langfuse’s prompt attributes (D-V-15, D-V-16).
Prompt version, a number of at least 1, from the convention that named the prompt.
Normalized provider name.
Reasoning tokens.
Release.
Resource service.name.
Session id.
Span id.
Kind of work.
Start, nanoseconds since the Unix epoch. JSON is RFC 3339.
OTel status.
Status description.
Tags.
Total tokens.
Trace id.
Time to first token, nanoseconds.
End-user id.
Trace row.
object
Sum of cache-read tokens. Omitted when every span omitted the field.
Sum of cache-write tokens. Omitted when every span omitted the field.
Sum of span costs, USD. Omitted when every span omitted the field.
end_time - start_time, nanoseconds.
Latest span end, nanoseconds since the Unix epoch. JSON is RFC 3339.
Deployment environment.
Number of spans with status error.
Whether a span with no parent is present.
Root input preview, or the first llm span’s.
Sum of span input tokens. Omitted when every span omitted the field.
Number of llm spans.
Root metadata, filled with keys from later spans when absent.
object
Sorted distinct model names.
Root span name, or the earliest span’s name when there is no root.
Root output preview, or the first llm span’s.
Sum of span output tokens. Omitted when every span omitted the field.
Distinct name@version of the prompt versions that this trace’s spans link (D-V-15).
Omitted when no span links a prompt version.
Sum of reasoning tokens. Omitted when every span omitted the field.
Release.
Span id of the root. Omitted when the trace has no root.
Latest score of each name attached to this trace.
The latest score of one name on a trace or session row.
Spec 09 § Response shapes.
object
Score name.
Score id.
Who wrote the score.
Score value.
A finite number.
object
A finite number.
True or false. Stored numerically as 1 or 0.
object
True or false. Stored numerically as 1 or 0.
A label and an optional numeric mapping.
object
A label and an optional numeric mapping.
object
Category label. Stored in value_str.
Optional numeric mapping. Stored in value_num. Omitted from JSON when absent.
Free text.
object
Free text.
Session id.
Number of spans.
Earliest span start, nanoseconds since the Unix epoch. JSON is RFC 3339.
error when any span errored, otherwise the root’s status, otherwise unset.
Sorted distinct tags of every span.
Sum of total tokens. Omitted when every span omitted the field.
Trace id.
End-user id.
True when spans were omitted because the trace is larger than [MAX_TRACE_SPANS].
Example
{ "spans": [ { "span": { "span_kind": "llm", "status": "unset" } } ], "trace": { "scores": [ { "source": "api", "value": { "data_type": "numeric" } } ], "status": "unset" }}The request is malformed or a filter is invalid.
RFC 7807 problem document.
Spec 09 § Conventions.
object
Machine-readable error code.
Extra explanation. Omitted when absent.
Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.
One field that failed validation.
Spec 09 § Conventions.
object
Request field, query parameter, or expression the error refers to.
What is wrong with the field.
Location inside the field value, for filter and SQL errors.
object
1-based column number, in characters.
1-based line number, in characters.
HTTP status code.
Short human-readable summary, the reason phrase of status.
Problem type URI. Always about:blank in this version.
Example
{ "code": "bad_request"}No credentials, or the credentials are invalid.
RFC 7807 problem document.
Spec 09 § Conventions.
object
Machine-readable error code.
Extra explanation. Omitted when absent.
Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.
One field that failed validation.
Spec 09 § Conventions.
object
Request field, query parameter, or expression the error refers to.
What is wrong with the field.
Location inside the field value, for filter and SQL errors.
object
1-based column number, in characters.
1-based line number, in characters.
HTTP status code.
Short human-readable summary, the reason phrase of status.
Problem type URI. Always about:blank in this version.
Example
{ "code": "bad_request"}The credentials do not allow this operation, or the organization’s plan does not include it (code plan_required).
RFC 7807 problem document.
Spec 09 § Conventions.
object
Machine-readable error code.
Extra explanation. Omitted when absent.
Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.
One field that failed validation.
Spec 09 § Conventions.
object
Request field, query parameter, or expression the error refers to.
What is wrong with the field.
Location inside the field value, for filter and SQL errors.
object
1-based column number, in characters.
1-based line number, in characters.
HTTP status code.
Short human-readable summary, the reason phrase of status.
Problem type URI. Always about:blank in this version.
Example
{ "code": "bad_request"}The resource does not exist.
RFC 7807 problem document.
Spec 09 § Conventions.
object
Machine-readable error code.
Extra explanation. Omitted when absent.
Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.
One field that failed validation.
Spec 09 § Conventions.
object
Request field, query parameter, or expression the error refers to.
What is wrong with the field.
Location inside the field value, for filter and SQL errors.
object
1-based column number, in characters.
1-based line number, in characters.
HTTP status code.
Short human-readable summary, the reason phrase of status.
Problem type URI. Always about:blank in this version.
Example
{ "code": "bad_request"}The query took longer than its time limit, needed more memory or temporary disk space than allowed, a filter deletion matched more than 100,000 traces, or the owner cannot be that user (code owner_not_allowed).
RFC 7807 problem document.
Spec 09 § Conventions.
object
Machine-readable error code.
Extra explanation. Omitted when absent.
Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.
One field that failed validation.
Spec 09 § Conventions.
object
Request field, query parameter, or expression the error refers to.
What is wrong with the field.
Location inside the field value, for filter and SQL errors.
object
1-based column number, in characters.
1-based line number, in characters.
HTTP status code.
Short human-readable summary, the reason phrase of status.
Problem type URI. Always about:blank in this version.
Example
{ "code": "bad_request"}Too many requests.
RFC 7807 problem document.
Spec 09 § Conventions.
object
Machine-readable error code.
Extra explanation. Omitted when absent.
Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.
One field that failed validation.
Spec 09 § Conventions.
object
Request field, query parameter, or expression the error refers to.
What is wrong with the field.
Location inside the field value, for filter and SQL errors.
object
1-based column number, in characters.
1-based line number, in characters.
HTTP status code.
Short human-readable summary, the reason phrase of status.
Problem type URI. Always about:blank in this version.
Example
{ "code": "bad_request"}The server is busy or a dependency is unavailable. Retry later.
RFC 7807 problem document.
Spec 09 § Conventions.
object
Machine-readable error code.
Extra explanation. Omitted when absent.
Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.
One field that failed validation.
Spec 09 § Conventions.
object
Request field, query parameter, or expression the error refers to.
What is wrong with the field.
Location inside the field value, for filter and SQL errors.
object
1-based column number, in characters.
1-based line number, in characters.
HTTP status code.
Short human-readable summary, the reason phrase of status.
Problem type URI. Always about:blank in this version.
Example
{ "code": "bad_request"}