Skip to main content

trace_spans

Creates, updates, deletes, gets or lists a trace_spans resource.

Overview​

Nametrace_spans
TypeResource
Idrailway.observability.trace_spans

Fields​

The following fields are returned by SELECT queries:

One row per TraceSpan. One span of a trace.

NameDatatypeDescription
namestring
deployment_idstring
deployment_instance_idstring
parent_span_idstringAbsent on a root span
service_idstringRailway service the span belongs to, when known
span_idstring16 lower-case hex characters
trace_idstring
service_namestringThe exporter's service.name resource attribute
componentstringWhich hop exported the span: edge, proxy or service
duration_msnumber
eventsarrayList of TraceSpanEvent objects
kindstringINTERNAL, SERVER, CLIENT, PRODUCER, CONSUMER or UNSPECIFIED
linksarrayList of TraceSpanLink objects
resource_attributesobjectResource attributes as exported, without the railway.* keys Railway promotes into typed fields
span_attributesobject
started_atstringISO timestamp
status_codestringUNSET, OK or ERROR
status_messagestring

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectenvironment_id, trace_idmax_spansThe spans of one trace, oldest first. Only spans belonging to the environment are returned. Backed by the Railway GraphQL query trace.

Parameters​

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
environment_idstring
trace_idstringW3C trace id, 32 hex characters.
max_spansintegerSpans returned (defaults 1000, max 2000).

SELECT examples​

The spans of one trace, oldest first. Only spans belonging to the environment are returned. Backed by the Railway GraphQL query trace.

SELECT
name,
deployment_id,
deployment_instance_id,
parent_span_id,
service_id,
span_id,
trace_id,
service_name,
component,
duration_ms,
events,
kind,
links,
resource_attributes,
span_attributes,
started_at,
status_code,
status_message
FROM railway.observability.trace_spans
WHERE environment_id = '{{ environment_id }}' -- required
AND trace_id = '{{ trace_id }}' -- required
AND max_spans = '{{ max_spans }}'
;