Skip to content
GitHubLog inStart free
cetra is not released yet. These docs describe the development version.

Get a span

GET
/api/v1/projects/{project}/traces/{trace_id}/spans/{span_id}
curl --request GET \
--url http://localhost:8080/api/v1/projects/example/traces/example/spans/example \
--cookie cetra_session=<cetra_session>
project
required
string

Project UUID, URL-encoded org-slug/project-slug, or current.

trace_id
required

Trace id, 16 bytes as hex. Responses use lowercase; requests may use either case. All zeros is invalid.

string
/^[0-9a-fA-F]{32}$/

Trace id, 16 bytes as hex.

span_id
required

Span id, 8 bytes as hex. Responses use lowercase; requests may use either case. All zeros is invalid.

string
/^[0-9a-fA-F]{16}$/

Span id, 8 bytes as hex.

The span, including payloads.

Media typeapplication/json

Every stored span column except project_id, plus computed duration_ns and model.

input_format and output_format are the format tag of [Payload]. Spec 01 § Span.

object
attributes
required

Span attributes not consumed by normalization.

object
key
additional properties
string
cache_read_tokens

Cache-read tokens.

integer format: int64
cache_write_tokens

Cache-write tokens.

integer format: int64
conventions
required

Conventions detected on the span.

Array<string>
Allowed values: cetra genai voltagent openinference openllmetry vercel langfuse laminar google_adk
cost_input

Input cost, USD.

number format: double
cost_output

Output cost, USD.

number format: double
cost_source

How cost was obtained.

string
Allowed values: computed reported none
cost_total

Total cost, USD.

number format: double
duration_ns
required

end_time - start_time, nanoseconds. Saturates on overflow.

integer format: int64
end_time
required

End, nanoseconds since the Unix epoch. JSON is RFC 3339.

string format: date-time
environment

Deployment environment.

string
events
required

Span events.

Array<object>

One span event as returned by the API.

Absent stored attributes become {}. Spec 01 events.

object
attributes
required

Event attributes. {} when the stored span had none.

name
required

Event name.

string
time
required

Event time, nanoseconds since the Unix epoch. JSON is RFC 3339.

string format: date-time
ingest_time
required

Server receive time, nanoseconds since the Unix epoch. JSON is RFC 3339.

string format: date-time
input

Parsed input. Omitted when the stored span has no input text.

One of:

A JSON array of canonical messages.

object
format
required

Payload encoding.

string
Allowed values: messages
value
required
Array<object>

One message in a conversation. Spec 01 § Canonical message format.

object
finish_reason

Why generation stopped. Omitted when absent. An explicit null from the source is kept (D65).

string | null
name

Optional speaker name. Omitted when absent. An explicit null from the source is kept (D65).

string | null
parts
required

Message parts. Always present; empty when the message has none.

Array

One part of a canonical message. Spec 01 § Canonical message format.

One of:

Plain text.

object
content
required

The text.

string
type
required

Part type.

string
Allowed values: text
key
additional properties
any
role
required

Message speaker. Known values are system, user, assistant, and tool. Any other string is kept.

string
key
additional properties
any
input_preview

First 512 characters of the plain-text input rendering.

string
input_tokens

Input tokens, including cached tokens.

integer format: int64
links
required

Span links.

Array<object>

One span link as returned by the API.

Absent stored attributes become {}. Spec 01 links.

object
attributes
required

Link attributes. {} when the stored span had none.

span_id
required

Linked span id.

string
/^[0-9a-fA-F]{16}$/
trace_id
required

Linked trace id.

string
/^[0-9a-fA-F]{32}$/
media_refs
required

SHA-256 hex of extracted media blobs.

Array<string>
metadata
required

User metadata.

object
key
additional properties
string
model

Response model, or the request model when the response names none.

string
name
required

Span name.

string
operation

GenAI operation name.

string
output

Parsed output. Omitted when the stored span has no output text.

One of:

A JSON array of canonical messages.

object
format
required

Payload encoding.

string
Allowed values: messages
value
required
Array<object>

One message in a conversation. Spec 01 § Canonical message format.

object
finish_reason

Why generation stopped. Omitted when absent. An explicit null from the source is kept (D65).

string | null
name

Optional speaker name. Omitted when absent. An explicit null from the source is kept (D65).

string | null
parts
required

Message parts. Always present; empty when the message has none.

Array

One part of a canonical message. Spec 01 § Canonical message format.

One of:

Plain text.

object
content
required

The text.

string
type
required

Part type.

string
Allowed values: text
key
additional properties
any
role
required

Message speaker. Known values are system, user, assistant, and tool. Any other string is kept.

string
key
additional properties
any
output_preview

First 512 characters of the plain-text output rendering.

string
output_tokens

Output tokens, including reasoning tokens.

integer format: int64
parent_span_id

Parent span. Omitted when this span is a root of the received trace.

string
/^[0-9a-fA-F]{16}$/
prompt_name

Prompt name from cetra.prompt.name or Langfuse’s prompt attributes (D-V-15, D-V-16).

string
prompt_version

Prompt version, a number of at least 1, from the convention that named the prompt.

integer format: int64
provider

Normalized provider name.

string
reasoning_tokens

Reasoning tokens.

integer format: int64
release

Release.

string
request_model

Model named in the request.

string
request_params

Request parameters. A JSON string when the stored text is not JSON.

resource_attributes
required

Resource attributes except service.name.

object
key
additional properties
string
response_model

Model named in the response.

string
schema_version
required

Normalization version of this row.

integer format: int32
scope_name

Instrumentation scope name.

string
scope_version

Instrumentation scope version.

string
service_name

Resource service.name.

string
session_id

Session id.

string
span_id
required

Span id.

string
/^[0-9a-fA-F]{16}$/
span_kind
required

Kind of work.

string
Allowed values: llm embedding tool agent chain retriever reranker guardrail evaluator span
start_time
required

Start, nanoseconds since the Unix epoch. JSON is RFC 3339.

string format: date-time
status
required

OTel status.

string
Allowed values: unset ok error
status_message

Status description.

string
system_instructions

System instructions. A JSON string when the stored text is not JSON.

tags
required

Tags.

Array<string>
tool_definitions

Tool definitions. A JSON string when the stored text is not JSON.

total_tokens

Total tokens.

integer format: int64
trace_id
required

Trace id.

string
/^[0-9a-fA-F]{32}$/
truncated
required

Names of attributes truncated at ingest.

Array<string>
ttft_ns

Time to first token, nanoseconds.

integer format: int64
user_id

End-user id.

string

Example

{
"conventions": [
"cetra"
],
"cost_source": "computed",
"input": {
"format": "messages",
"value": [
{
"parts": [
{
"type": "text"
}
]
}
]
},
"output": {
"format": "messages",
"value": [
{
"parts": [
{
"type": "text"
}
]
}
]
},
"span_kind": "llm",
"status": "unset"
}

The request is malformed or a filter is invalid.

Media typeapplication/problem+json

RFC 7807 problem document.

Spec 09 § Conventions.

object
code
required

Machine-readable error code.

string
Allowed values: bad_request invalid_filter query_failed query_timeout query_too_large too_many_traces too_many_items busy restore_mode unauthorized forbidden sso_required email_not_verified plan_limit plan_required scim_managed owner_not_allowed not_found method_not_allowed payload_too_large unsupported_media_type range_not_satisfiable conflict authorization_pending slow_down access_denied expired_token quota_exceeded rate_limited internal
detail

Extra explanation. Omitted when absent.

string
errors

Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.

Array<object>

One field that failed validation.

Spec 09 § Conventions.

object
field
required

Request field, query parameter, or expression the error refers to.

string
message
required

What is wrong with the field.

string
position

Location inside the field value, for filter and SQL errors.

object
column
required

1-based column number, in characters.

integer format: int32
line
required

1-based line number, in characters.

integer format: int32
status
required

HTTP status code.

integer format: int32
title
required

Short human-readable summary, the reason phrase of status.

string
type
required

Problem type URI. Always about:blank in this version.

string

Example

{
"code": "bad_request"
}

No credentials, or the credentials are invalid.

Media typeapplication/problem+json

RFC 7807 problem document.

Spec 09 § Conventions.

object
code
required

Machine-readable error code.

string
Allowed values: bad_request invalid_filter query_failed query_timeout query_too_large too_many_traces too_many_items busy restore_mode unauthorized forbidden sso_required email_not_verified plan_limit plan_required scim_managed owner_not_allowed not_found method_not_allowed payload_too_large unsupported_media_type range_not_satisfiable conflict authorization_pending slow_down access_denied expired_token quota_exceeded rate_limited internal
detail

Extra explanation. Omitted when absent.

string
errors

Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.

Array<object>

One field that failed validation.

Spec 09 § Conventions.

object
field
required

Request field, query parameter, or expression the error refers to.

string
message
required

What is wrong with the field.

string
position

Location inside the field value, for filter and SQL errors.

object
column
required

1-based column number, in characters.

integer format: int32
line
required

1-based line number, in characters.

integer format: int32
status
required

HTTP status code.

integer format: int32
title
required

Short human-readable summary, the reason phrase of status.

string
type
required

Problem type URI. Always about:blank in this version.

string

Example

{
"code": "bad_request"
}

The credentials do not allow this operation, or the organization’s plan does not include it (code plan_required).

Media typeapplication/problem+json

RFC 7807 problem document.

Spec 09 § Conventions.

object
code
required

Machine-readable error code.

string
Allowed values: bad_request invalid_filter query_failed query_timeout query_too_large too_many_traces too_many_items busy restore_mode unauthorized forbidden sso_required email_not_verified plan_limit plan_required scim_managed owner_not_allowed not_found method_not_allowed payload_too_large unsupported_media_type range_not_satisfiable conflict authorization_pending slow_down access_denied expired_token quota_exceeded rate_limited internal
detail

Extra explanation. Omitted when absent.

string
errors

Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.

Array<object>

One field that failed validation.

Spec 09 § Conventions.

object
field
required

Request field, query parameter, or expression the error refers to.

string
message
required

What is wrong with the field.

string
position

Location inside the field value, for filter and SQL errors.

object
column
required

1-based column number, in characters.

integer format: int32
line
required

1-based line number, in characters.

integer format: int32
status
required

HTTP status code.

integer format: int32
title
required

Short human-readable summary, the reason phrase of status.

string
type
required

Problem type URI. Always about:blank in this version.

string

Example

{
"code": "bad_request"
}

The resource does not exist.

Media typeapplication/problem+json

RFC 7807 problem document.

Spec 09 § Conventions.

object
code
required

Machine-readable error code.

string
Allowed values: bad_request invalid_filter query_failed query_timeout query_too_large too_many_traces too_many_items busy restore_mode unauthorized forbidden sso_required email_not_verified plan_limit plan_required scim_managed owner_not_allowed not_found method_not_allowed payload_too_large unsupported_media_type range_not_satisfiable conflict authorization_pending slow_down access_denied expired_token quota_exceeded rate_limited internal
detail

Extra explanation. Omitted when absent.

string
errors

Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.

Array<object>

One field that failed validation.

Spec 09 § Conventions.

object
field
required

Request field, query parameter, or expression the error refers to.

string
message
required

What is wrong with the field.

string
position

Location inside the field value, for filter and SQL errors.

object
column
required

1-based column number, in characters.

integer format: int32
line
required

1-based line number, in characters.

integer format: int32
status
required

HTTP status code.

integer format: int32
title
required

Short human-readable summary, the reason phrase of status.

string
type
required

Problem type URI. Always about:blank in this version.

string

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).

Media typeapplication/problem+json

RFC 7807 problem document.

Spec 09 § Conventions.

object
code
required

Machine-readable error code.

string
Allowed values: bad_request invalid_filter query_failed query_timeout query_too_large too_many_traces too_many_items busy restore_mode unauthorized forbidden sso_required email_not_verified plan_limit plan_required scim_managed owner_not_allowed not_found method_not_allowed payload_too_large unsupported_media_type range_not_satisfiable conflict authorization_pending slow_down access_denied expired_token quota_exceeded rate_limited internal
detail

Extra explanation. Omitted when absent.

string
errors

Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.

Array<object>

One field that failed validation.

Spec 09 § Conventions.

object
field
required

Request field, query parameter, or expression the error refers to.

string
message
required

What is wrong with the field.

string
position

Location inside the field value, for filter and SQL errors.

object
column
required

1-based column number, in characters.

integer format: int32
line
required

1-based line number, in characters.

integer format: int32
status
required

HTTP status code.

integer format: int32
title
required

Short human-readable summary, the reason phrase of status.

string
type
required

Problem type URI. Always about:blank in this version.

string

Example

{
"code": "bad_request"
}

Too many requests.

Media typeapplication/problem+json

RFC 7807 problem document.

Spec 09 § Conventions.

object
code
required

Machine-readable error code.

string
Allowed values: bad_request invalid_filter query_failed query_timeout query_too_large too_many_traces too_many_items busy restore_mode unauthorized forbidden sso_required email_not_verified plan_limit plan_required scim_managed owner_not_allowed not_found method_not_allowed payload_too_large unsupported_media_type range_not_satisfiable conflict authorization_pending slow_down access_denied expired_token quota_exceeded rate_limited internal
detail

Extra explanation. Omitted when absent.

string
errors

Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.

Array<object>

One field that failed validation.

Spec 09 § Conventions.

object
field
required

Request field, query parameter, or expression the error refers to.

string
message
required

What is wrong with the field.

string
position

Location inside the field value, for filter and SQL errors.

object
column
required

1-based column number, in characters.

integer format: int32
line
required

1-based line number, in characters.

integer format: int32
status
required

HTTP status code.

integer format: int32
title
required

Short human-readable summary, the reason phrase of status.

string
type
required

Problem type URI. Always about:blank in this version.

string

Example

{
"code": "bad_request"
}

The server is busy or a dependency is unavailable. Retry later.

Media typeapplication/problem+json

RFC 7807 problem document.

Spec 09 § Conventions.

object
code
required

Machine-readable error code.

string
Allowed values: bad_request invalid_filter query_failed query_timeout query_too_large too_many_traces too_many_items busy restore_mode unauthorized forbidden sso_required email_not_verified plan_limit plan_required scim_managed owner_not_allowed not_found method_not_allowed payload_too_large unsupported_media_type range_not_satisfiable conflict authorization_pending slow_down access_denied expired_token quota_exceeded rate_limited internal
detail

Extra explanation. Omitted when absent.

string
errors

Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.

Array<object>

One field that failed validation.

Spec 09 § Conventions.

object
field
required

Request field, query parameter, or expression the error refers to.

string
message
required

What is wrong with the field.

string
position

Location inside the field value, for filter and SQL errors.

object
column
required

1-based column number, in characters.

integer format: int32
line
required

1-based line number, in characters.

integer format: int32
status
required

HTTP status code.

integer format: int32
title
required

Short human-readable summary, the reason phrase of status.

string
type
required

Problem type URI. Always about:blank in this version.

string

Example

{
"code": "bad_request"
}