trace_spans
Creates, updates, deletes, gets or lists a trace_spans resource.
Overview​
| Name | trace_spans |
| Type | Resource |
| Id | railway.observability.trace_spans |
Fields​
The following fields are returned by SELECT queries:
- list
One row per TraceSpan. One span of a trace.
| Name | Datatype | Description |
|---|---|---|
name | string | |
deployment_id | string | |
deployment_instance_id | string | |
parent_span_id | string | Absent on a root span |
service_id | string | Railway service the span belongs to, when known |
span_id | string | 16 lower-case hex characters |
trace_id | string | |
service_name | string | The exporter's service.name resource attribute |
component | string | Which hop exported the span: edge, proxy or service |
duration_ms | number | |
events | array | List of TraceSpanEvent objects |
kind | string | INTERNAL, SERVER, CLIENT, PRODUCER, CONSUMER or UNSPECIFIED |
links | array | List of TraceSpanLink objects |
resource_attributes | object | Resource attributes as exported, without the railway.* keys Railway promotes into typed fields |
span_attributes | object | |
started_at | string | ISO timestamp |
status_code | string | UNSET, OK or ERROR |
status_message | string |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list | select | environment_id, trace_id | max_spans | The 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.
| Name | Datatype | Description |
|---|---|---|
environment_id | string | |
trace_id | string | W3C trace id, 32 hex characters. |
max_spans | integer | Spans returned (defaults 1000, max 2000). |
SELECT examples​
- list
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 }}'
;